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
mutation {
createMember(input: {name: "new name", email: "[email protected]", password: "123"}) {
member {
id
}
errors {
fieldmessage
}
}
}
Similarly, I like to have an errors list returned in all my other mutations to make sure the mutation was performed correctly. This can be easily done for a single mutation by having a errors = graphene.List( graphene.NonNull(commons.Error), description='List of errors that occurred executing the mutation.', ) attribute in my schema.
But as my schema grows larger the amount of repeated code I have for these mutations increases.
Is there a way I can somehow abstract this errors attribute to a BaseMutation class and then inherit my mutations from that instead?
The text was updated successfully, but these errors were encountered:
This is not a bug of graphene. Error handling is out of the scope of this codebase and from Graphql definition in general, and is more a design desition of your particular implementation.
Please check out #902 for a more extensive discussion about some ways you could treat error handling in your queries or mutations.
Uh oh!
There was an error while loading. Please reload this page.
I find myself making this mutation often:
Similarly, I like to have an
errors
list returned in all my other mutations to make sure the mutation was performed correctly. This can be easily done for a single mutation by having aerrors = graphene.List( graphene.NonNull(commons.Error), description='List of errors that occurred executing the mutation.', )
attribute in my schema.But as my schema grows larger the amount of repeated code I have for these mutations increases.
Is there a way I can somehow abstract this
errors
attribute to aBaseMutation
class and then inherit my mutations from that instead?The text was updated successfully, but these errors were encountered: