skillbox/server/api/schema.py

30 lines
868 B
Python

import graphene
from django.conf import settings
from graphene import relay
from graphene_django.debug import DjangoDebug
# Keep this import exactly here, it's necessary for StreamField conversion
from api import graphene_wagtail
from book.schema.mutations import BookMutations
from filteredbook.schema import BookQuery
from objectives.schema import ObjectivesQuery
from rooms.schema import RoomsQuery, RoomMutations
from user.schema import UsersQuery
class Query(UsersQuery, RoomsQuery, ObjectivesQuery, BookQuery, graphene.ObjectType):
node = relay.Node.Field()
if settings.DEBUG:
debug = graphene.Field(DjangoDebug, name='__debug')
class Mutation(BookMutations, RoomMutations, graphene.ObjectType):
if settings.DEBUG:
debug = graphene.Field(DjangoDebug, name='__debug')
schema = graphene.Schema(query=Query, mutation=Mutation)