2021-01-04 23:25:59 +03:00
|
|
|
import graphene
|
2021-01-10 15:51:59 +03:00
|
|
|
|
2021-03-20 02:26:38 +03:00
|
|
|
from graphene_django import DjangoObjectType
|
2021-01-20 22:10:57 +03:00
|
|
|
|
2021-03-20 02:26:38 +03:00
|
|
|
from .graphqlTypes import DisposableEventType, UserType, TimeEventType, StaffEventType
|
2021-01-20 22:10:57 +03:00
|
|
|
from graphene_django.filter import DjangoFilterConnectionField
|
|
|
|
|
2021-03-20 02:26:38 +03:00
|
|
|
from .mutations import *
|
2021-01-20 22:10:57 +03:00
|
|
|
|
2021-03-20 02:26:38 +03:00
|
|
|
import graphql_jwt
|
2021-01-10 15:51:59 +03:00
|
|
|
|
2021-03-20 02:26:38 +03:00
|
|
|
class Query(graphene.ObjectType):
|
|
|
|
DisposableEvents = DjangoFilterConnectionField(DisposableEventType)
|
|
|
|
DisposableEvent = graphene.relay.Node.Field(DisposableEventType)
|
2021-01-20 22:10:57 +03:00
|
|
|
|
2021-01-10 15:51:59 +03:00
|
|
|
|
2021-03-20 02:26:38 +03:00
|
|
|
TimeEvents = DjangoFilterConnectionField(TimeEventType)
|
|
|
|
TimeEvent = graphene.relay.Node.Field(TimeEventType)
|
2021-01-10 15:51:59 +03:00
|
|
|
|
|
|
|
|
2021-03-20 02:26:38 +03:00
|
|
|
StaffEvents = DjangoFilterConnectionField(StaffEventType)
|
|
|
|
StaffEvent = graphene.relay.Node.Field(StaffEventType)
|
2021-01-10 15:51:59 +03:00
|
|
|
|
2021-01-04 23:25:59 +03:00
|
|
|
|
2021-03-20 02:26:38 +03:00
|
|
|
Users = DjangoFilterConnectionField(UserType)
|
|
|
|
User = graphene.relay.Node.Field(UserType)
|
2021-01-04 23:25:59 +03:00
|
|
|
|
|
|
|
|
2021-03-20 02:26:38 +03:00
|
|
|
class Mutation(graphene.ObjectType):
|
|
|
|
createTimeEvent = CreateTimeEvent.Field()
|
|
|
|
deleteTimeEvent = DeleteTimeEvent.Field()
|
|
|
|
changeTimeEventStatus = ChangeTimeEventStatus.Field()
|
2021-01-10 15:51:59 +03:00
|
|
|
|
2021-03-20 02:26:38 +03:00
|
|
|
token_auth = graphql_jwt.ObtainJSONWebToken.Field()
|
|
|
|
registration = RegUser.Field()
|