morgante / django-graph-auth

Simple GraphQL queries and mutations for managing Django users.
MIT License
46 stars 14 forks source link

Exception when i try to use the mutation examples: "mutate_and_get_payload() got an unexpected keyword argument 'email'" #12

Open avaldevilap opened 7 years ago

avaldevilap commented 7 years ago

I am trying to use the examples mutations in api.md: mutation { registerUser(input: { email: "morgante@mastermade.co", 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.

morgante commented 7 years ago

What is your config? If you don't include email as a required registration property this might fail.

avaldevilap commented 7 years ago

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

morgante commented 7 years ago

How about your GRAPH_AUTH settings in settings.py (documented here)?

avaldevilap commented 7 years ago

Sorry i did not see that

avaldevilap commented 7 years ago

I put the GRAPH_AUTH. Still the same error

morgante commented 7 years ago

What happens if you drop the email property from your mutation?

avaldevilap commented 7 years ago

Bad request. "Argument "input" has invalid value {username: "morgante", password: "test_password", firstName: "Morgante", lastName: "Pell"}.In field "email": Expected "String!", found null."

morgante commented 7 years ago

Weird, I'll have to do some further investigation. Sorry for the issue.

allania7med11 commented 5 years ago

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' '''

morgante commented 5 years ago

FYI I'm not actively working on this but would be happy to accept a PR.