You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.
This was working fine until I've tried to switch from gql.mutation to gql.django.mutation to use OperationType for handling the errors. The problem is that the two mutations, even though they return different types according to the type annotations, in the generated graphql they share the same union (MutPayload) which is the payload of one of the two. Therefore, for one mutation it works fine, while the other has a broken schema.
Is this supported? Are there plans to support it? Am I missing some docs regarding it?
The project I'm working on has many mutations, and we'd like to keep them grouped. Sure, we can rename them to have unique names, but it feels kinda odd (especially since there is no warning or error message about the duplicates).
Thanks!
The text was updated successfully, but these errors were encountered:
That's an interesting use case, it is the first time I saw someone doing mutations inside a type =P
This is a corner case I have not handled because mutations are usually directly inside the root Mutation, and thus it would not be possible for them to have duplicated names.
What can probably be done here is to add an optional parameter with a payload name that should be used instead of the automatically generated one. What do you think?
Is it possible to have multiple mutations with the same name, under different parent types?
For example:
used as:
This was working fine until I've tried to switch from
gql.mutation
togql.django.mutation
to useOperationType
for handling the errors. The problem is that the two mutations, even though they return different types according to the type annotations, in the generated graphql they share the same union (MutPayload
) which is the payload of one of the two. Therefore, for one mutation it works fine, while the other has a broken schema.Is this supported? Are there plans to support it? Am I missing some docs regarding it?
The project I'm working on has many mutations, and we'd like to keep them grouped. Sure, we can rename them to have unique names, but it feels kinda odd (especially since there is no warning or error message about the duplicates).
Thanks!
The text was updated successfully, but these errors were encountered: