Skip to content

Commit a9625da

Browse files
authored
Update requirement for Query type in mutation docs (#1213)
1 parent a1fc368 commit a9625da

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

docs/types/mutations.rst

+1-5
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,7 @@ So, we can finish our schema like this:
4848
class MyMutations(graphene.ObjectType):
4949
create_person = CreatePerson.Field()
5050
51-
# We must define a query for our schema
52-
class Query(graphene.ObjectType):
53-
person = graphene.Field(Person)
54-
55-
schema = graphene.Schema(query=Query, mutation=MyMutations)
51+
schema = graphene.Schema(mutation=MyMutations)
5652
5753
Executing the Mutation
5854
----------------------

graphene/types/schema.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ class Schema:
381381
questions about the types through introspection.
382382
383383
Args:
384-
query (Type[ObjectType]): Root query *ObjectType*. Describes entry point for fields to *read*
384+
query (Optional[Type[ObjectType]]): Root query *ObjectType*. Describes entry point for fields to *read*
385385
data in your Schema.
386386
mutation (Optional[Type[ObjectType]]): Root mutation *ObjectType*. Describes entry point for
387387
fields to *create, update or delete* data in your API.

0 commit comments

Comments
 (0)