{"action":"created","issue":{"url":"https://api.github.com/repos/graphql-python/graphene-django/issues/78","repository_url":"https://api.github.com/repos/graphql-python/graphene-django","labels_url":"https://api.github.com/repos/graphql-python/graphene-django/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/graphql-python/graphene-django/issues/78/comments","events_url":"https://api.github.com/repos/graphql-python/graphene-django/issues/78/events","html_url":"https://github.com/graphql-python/graphene-django/issues/78","id":197373354,"number":78,"title":"Mutation Error: \"mutate() takes 4 positional arguments but 5 were given\"","user":{"login":"lealhugui","id":2677325,"avatar_url":"https://avatars.githubusercontent.com/u/2677325?v=3","gravatar_id":"","url":"https://api.github.com/users/lealhugui","html_url":"https://github.com/lealhugui","followers_url":"https://api.github.com/users/lealhugui/followers","following_url":"https://api.github.com/users/lealhugui/following{/other_user}","gists_url":"https://api.github.com/users/lealhugui/gists{/gist_id}","starred_url":"https://api.github.com/users/lealhugui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lealhugui/subscriptions","organizations_url":"https://api.github.com/users/lealhugui/orgs","repos_url":"https://api.github.com/users/lealhugui/repos","events_url":"https://api.github.com/users/lealhugui/events{/privacy}","received_events_url":"https://api.github.com/users/lealhugui/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-23T13:55:45Z","updated_at":"2016-12-23T17:26:27Z","closed_at":"2016-12-23T17:26:27Z","body":"I have the following schema:\r\n\r\n```python\r\n# app/schema.py\r\nimport graphene\r\nfrom graphene import relay, AbstractType\r\nfrom graphene_django import DjangoObjectType\r\nfrom graphene_django.filter import DjangoFilterConnectionField\r\n\r\nfrom .models import Person\r\n\r\nclass PersonNode(DjangoObjectType):\r\n\r\n    class Meta:\r\n        model = Person\r\n        filter_fields = [\"id\", \"first_name\", \"last_name\"]\r\n        interfaces = (relay.Node, )\r\n\r\nclass Query(AbstractType):\r\n    all_person = DjangoFilterConnectionField(PersonNode)\r\n\r\nclass CreatePerson(graphene.Mutation):\r\n    class Input:\r\n        firstName = graphene.String()\r\n        lastName = graphene.String()\r\n    \r\n    person = graphene.Field(PersonNode)\r\n    ok = graphene.Boolean()\r\n\r\n    @classmethod\r\n    def mutate(cls, input, args, info):\r\n        f_name = args.get('firstName')\r\n        l_name = args.get('lastName')\r\n        p = Person.objects.create(first_name=f_name, last_name=l_name)\r\n        return CreatePerson(person=PersonNode(p), ok=True)\r\n\r\nclass MutationPerson(AbstractType):\r\n    createPerson = CreatePerson.Field()\r\n\r\n# .\\schema.py\r\nimport graphene\r\n\r\nimport srv_engine.main.schema as main_schema\r\n\r\n\r\nclass Query(main_schema.Query, graphene.ObjectType):\r\n    pass\r\n\r\nclass Mutation(main_schema.MutationPerson, graphene.ObjectType):\r\n    pass\r\n\r\nschema = graphene.Schema(query=Query, mutation=Mutation)\r\n```\r\n\r\nWhen i try to execute the mutation, with the following query:\r\n```javascript\r\nmutation{\r\n  createPerson(firstName: \"Foo\", lastName: \"Bar\" ){\r\n    ok,\r\n    person{\r\n      firstName\r\n    }\r\n  }\r\n}\r\n```\r\nI get the following result:\r\n\r\n```json\r\n{\r\n  \"errors\": [\r\n    {\r\n      \"message\": \"mutate() takes 4 positional arguments but 5 were given\",\r\n      \"locations\": [\r\n        {\r\n          \"line\": 2,\r\n          \"column\": 3\r\n        }\r\n      ]\r\n    }\r\n  ],\r\n  \"data\": {\r\n    \"createPerson\": null\r\n  }\r\n}\r\n```\r\n\r\nAny help would be good."},"comment":{"url":"https://api.github.com/repos/graphql-python/graphene-django/issues/comments/269021294","html_url":"https://github.com/graphql-python/graphene-django/issues/78#issuecomment-269021294","issue_url":"https://api.github.com/repos/graphql-python/graphene-django/issues/78","id":269021294,"user":{"login":"lealhugui","id":2677325,"avatar_url":"https://avatars.githubusercontent.com/u/2677325?v=3","gravatar_id":"","url":"https://api.github.com/users/lealhugui","html_url":"https://github.com/lealhugui","followers_url":"https://api.github.com/users/lealhugui/followers","following_url":"https://api.github.com/users/lealhugui/following{/other_user}","gists_url":"https://api.github.com/users/lealhugui/gists{/gist_id}","starred_url":"https://api.github.com/users/lealhugui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lealhugui/subscriptions","organizations_url":"https://api.github.com/users/lealhugui/orgs","repos_url":"https://api.github.com/users/lealhugui/repos","events_url":"https://api.github.com/users/lealhugui/events{/privacy}","received_events_url":"https://api.github.com/users/lealhugui/received_events","type":"User","site_admin":false},"created_at":"2016-12-23T17:26:27Z","updated_at":"2016-12-23T17:26:27Z","body":"Yes, I'll use Relay as front-end.\r\nI just implemented the mutation subclassing \"ClientIDMutation\" (like in the exemple) and it worked like a charm!\r\n\r\nThank you @blakegong !"}}
{"actor":{"display_login":"lealhugui"}}