I chose to handle sending multiple Queries and Mutations as follow,
First I defined a Schema
defined in schema.py:
# schema.py code
from graphene import Schema, Field, ObjectType
from .basic_objects.queries import BasicQuery
from .basic_objects.mutations import BasicMutation
schema = Schema(query=BasicQuery, mutation=BasicMutation)
Then I have updated the schema.py
file:
from graphene import Schema, Field, ObjectType
from .basic_objects.queries import BasicQuery
from .basic_objects.mutations import BasicMutation
class Query(ObjectType):
BasicQuery = Field(BasicQuery)
#otherQuery
class Mutation(ObjectType):
BasicMutation = Field(BasicMutation)
schema = Schema(query=Query, mutation=Mutation)
But while trying to send the following GraphQL request:
query MyQuery {
BasicQueryData {
oneNode(id: 1) {
comment
coordinateY
}
}
}
from query oneNode directly working and graphene find the method and it is working.
How can I make that this time from query first go to BasicQueryData and then call oneNode method?
I fixed like this