-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.py
45 lines (35 loc) · 1.06 KB
/
schema.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import graphene
import graphql_jwt
import api.schema
import authentication.schema
RootQuery = type(
'RootQuery',
tuple(
authentication.schema.query_list +
api.schema.query_list
),
{}
)
RootMutation = type(
'RootMutation',
tuple(
authentication.schema.mutation_list +
api.schema.mutation_list
),
{}
)
class Query(RootQuery, graphene.ObjectType):
# This class will inherit from multiple Queries
# as we begin to add more apps to our project
pass
class Mutation(RootMutation, graphene.ObjectType):
# This class will inherit from multiple Mutations
# as we begin to add more apps to our project
# auth mutations
token_auth = graphql_jwt.ObtainJSONWebToken.Field()
verify_token = graphql_jwt.Verify.Field()
refresh_token = graphql_jwt.Refresh.Field()
delete_token_cookie = graphql_jwt.DeleteJSONWebTokenCookie.Field()
# delete_refresh_token_cookie = graphql_jwt.refresh_token.DeleteRefreshTokenCookie.Field()
pass
schema = graphene.Schema(query=Query, mutation=Mutation)