django-graph-auth
django-graph-auth copied to clipboard
Exception when i try to use the mutation examples: "mutate_and_get_payload() got an unexpected keyword argument 'email'"
I am trying to use the examples mutations in api.md:
mutation { registerUser(input: { email: "[email protected]", password: "test_password", firstName: "Morgante", lastName: "Pell" }) { ok, user { id, firstName, email, token } } }
and I get this "mutate_and_get_payload() got an unexpected keyword argument 'email'"
my pip list: Django (1.11.6) django-filter (1.1.0) django-graph-auth (0.3.1) djangorestframework (3.7.1) djangorestframework-jwt (1.11.0) graphene (2.0.dev20170802065539) graphene-django (2.0.dev2017083101) graphql-core (2.0.dev20170801051721) graphql-relay (0.4.5) iso8601 (0.1.12) pip (9.0.1) promise (2.1.dev0) psycopg2 (2.7.3.1) PyJWT (1.5.3) pytz (2017.2) setuptools (28.8.0) six (1.10.0) wheel (0.30.0)
Thanks for your work.
What is your config? If you don't include email as a required registration property this might fail.
My schema.py
import graph_auth.schema
import graphene
from graphene import relay, ObjectType
class Query(graph_auth.schema.Query, ObjectType):
node = relay.Node.Field()
class Mutation(graph_auth.schema.Mutation, ObjectType):
pass
schema = graphene.Schema(query=Query, mutation=Mutation)
queries work well, but mutations not
How about your GRAPH_AUTH
settings in settings.py (documented here)?
Sorry i did not see that
I put the GRAPH_AUTH
. Still the same error
What happens if you drop the email
property from your mutation?
Bad request. "Argument "input" has invalid value {username: "morgante", password: "test_password", firstName: "Morgante", lastName: "Pell"}.In field "email": Expected "String!", found null."
Weird, I'll have to do some further investigation. Sorry for the issue.
did anyone find solution to this problem? I got similar problem. ''' graphql.error.located_error.GraphQLLocatedError: mutate_and_get_payload() got an unexpected keyword argument 'node' '''
FYI I'm not actively working on this but would be happy to accept a PR.