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
Currently explicitly supplying null value in a mutation query and leaving out a field & its value resulted in the same {'field': None} value in the mutate function, instead of what was described by @jkimbo in #103
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via
a github repo, https://repl.it or similar (you can use this template as a starting point: https://repl.it/@jkimbo/Graphene-Django-Example).
Say this is my schema:
type UserType {
id: ID!
name: String!
phone: String!
}
This is the UserMutation defined in schema.py:
class MediatorMutation(graphene.Mutation):
class Arguments:
id = graphene.ID(required=True)
name = graphene.String()
phone = graphene.String()
user = graphene.Field(UserType)
def mutate(self, info, **args):
print(args)
return UserMutation(user=user)
This is my mutation query:
mutation {
updateUser(id: 1, phone: null){
user {
id
name
phone
}
}
}
What is the expected behavior?
I expect the print line to be {'id': '1', 'phone': None}, but it's currently printing {'id': '1', 'name': None, 'phone': None}
What is the motivation / use case for changing the behavior?
This is important for updating when we want to set a nullable field to null/None. See relevant GraphQL spec change: graphql/graphql-spec#83
Please tell us about your environment:
Version: graphene-django==3.0.0b7
Platform: macos
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)
I just want to hear maintainer & community's thoughts on this and if it's just a user issue on my end. Happy to send a patch/PR once we confirm this is indeed a bug.
The text was updated successfully, but these errors were encountered:
Currently explicitly supplying null value in a mutation query and leaving out a field & its value resulted in the same
{'field': None}
value in themutate
function, instead of what was described by @jkimbo in #103a github repo, https://repl.it or similar (you can use this template as a starting point: https://repl.it/@jkimbo/Graphene-Django-Example).
Say this is my schema:
This is the
UserMutation
defined inschema.py
:This is my mutation query:
I expect the print line to be
{'id': '1', 'phone': None}
, but it's currently printing{'id': '1', 'name': None, 'phone': None}
This is important for updating when we want to set a nullable field to null/None. See relevant GraphQL spec change: graphql/graphql-spec#83
Please tell us about your environment:
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)
I just want to hear maintainer & community's thoughts on this and if it's just a user issue on my end. Happy to send a patch/PR once we confirm this is indeed a bug.
The text was updated successfully, but these errors were encountered: