django-graph-auth icon indicating copy to clipboard operation
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'"

Open avaldevilap opened this issue 7 years ago • 10 comments

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.

avaldevilap avatar Oct 27 '17 16:10 avaldevilap

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

morgante avatar Nov 01 '17 18:11 morgante

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

avaldevilap avatar Nov 01 '17 19:11 avaldevilap

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

morgante avatar Nov 01 '17 19:11 morgante

Sorry i did not see that

avaldevilap avatar Nov 01 '17 19:11 avaldevilap

I put the GRAPH_AUTH. Still the same error

avaldevilap avatar Nov 01 '17 19:11 avaldevilap

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

morgante avatar Nov 01 '17 19:11 morgante

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

avaldevilap avatar Nov 01 '17 19:11 avaldevilap

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

morgante avatar Nov 01 '17 19:11 morgante

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

allania7med11 avatar Jan 29 '19 16:01 allania7med11

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

morgante avatar Jan 30 '19 06:01 morgante