mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-26 11:33:55 +03:00
Fixed mutation docs (adding missing info arg in mutate)
This commit is contained in:
parent
1d52148b37
commit
7455063728
|
@ -19,7 +19,7 @@ This example defines a Mutation:
|
||||||
ok = graphene.Boolean()
|
ok = graphene.Boolean()
|
||||||
person = graphene.Field(lambda: Person)
|
person = graphene.Field(lambda: Person)
|
||||||
|
|
||||||
def mutate(self, name):
|
def mutate(self, info, name):
|
||||||
person = Person(name=name)
|
person = Person(name=name)
|
||||||
ok = True
|
ok = True
|
||||||
return CreatePerson(person=person, ok=ok)
|
return CreatePerson(person=person, ok=ok)
|
||||||
|
@ -104,10 +104,7 @@ To use an InputField you define an InputObjectType that specifies the structure
|
||||||
person = graphene.Field(Person)
|
person = graphene.Field(Person)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def mutate(root, person_data=None):
|
def mutate(root, info, person_data=None):
|
||||||
name = p_data.get('name')
|
|
||||||
age = p_data.get('age')
|
|
||||||
|
|
||||||
person = Person(
|
person = Person(
|
||||||
name=person_data.name,
|
name=person_data.name,
|
||||||
age=person_data.age
|
age=person_data.age
|
||||||
|
|
Loading…
Reference in New Issue
Block a user