In my app, I would like to have something like:
@strawberry.django.input(Criterion)
class CriterionInput:
...
@strawberry.type
class Mutation:
create_criterion: List[Criterion] = strawberry.django.mutations.create(CriterionInput, handle_django_errors=True)
This generates a mutation with schema:
createCriterion(data: CriterionInput!): CreateCriterionPayload!
I expect this to have a schema of:
createCriterion(data: [CriterionInput!]!): [CreateCriterionPayload!]!
because if handle_django_errors
is removed, the mutation has schema:
createCriterion(data: [CriterionInput!]!): [Criterion!]!
I'm able to get the behavior I want by wrapping payload union in DjangoMutationBase#resolve_type
with StrawberryList
if the original resolved type is an instance of StrawberryList
, but I'm not certain it's the correct solution.
I'm still quite new to Strawberry and GraphQL, so apologies in advance if I'm using the API incorrectly.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too