-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresolvers.js
94 lines (92 loc) · 2.69 KB
/
resolvers.js
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import {queries as monsterQueries} from "./entities/monster";
import {queries as mapQueries, mutations as mapMutations} from "./entities/maps";
import {
queries as initiativeQueries,
mutations as initiativeMutations,
subscriptions as initiativeSubscriptions
} from "./entities/initiative";
import {
queries as characterQueries,
mutations as characterMutations,
subscriptions as characterSubscriptions,
details as characterDetails
} from "./entities/characters";
import {
queries as backgroundLayerQueries,
mutations as backgroundLayerMutations,
subscriptions as backgroundLayerSubscriptions
} from "./entities/backgroundlayer";
import {
queries as playerQueries,
mutations as playerMutations,
subscriptions as playerSubscriptions,
details as playerDetails
} from "./entities/players";
import {
queries as measurementQueries,
mutations as measurementMutations,
subscriptions as measurementSubscriptions
} from "./entities/measurements";
import {
queries as fogOfWarQueries,
mutations as fogOfWarMutations,
subscriptions as fogOfWarSubscriptions
} from "./entities/fogofwar";
import {
queries as viewportQueries,
mutations as viewportMutations,
subscriptions as viewportSubscriptions
} from "./entities/viewport";
import {
queries as drawingQueries,
mutations as drawingMutations,
subscriptions as drawingSubscriptions
} from "./entities/drawing";
import {URLResolver, JSONResolver} from 'graphql-scalars';
const resolvers = {
Query: {
...playerQueries,
...characterQueries,
...measurementQueries,
...mapQueries,
...monsterQueries,
...initiativeQueries,
...backgroundLayerQueries,
...fogOfWarQueries,
...viewportQueries,
...drawingQueries
},
Mutation: {
...characterMutations,
...mapMutations,
...initiativeMutations,
...backgroundLayerMutations,
...fogOfWarMutations,
...viewportMutations,
...drawingMutations,
...measurementMutations,
...playerMutations,
},
Subscription: {
...characterSubscriptions,
...initiativeSubscriptions,
...backgroundLayerSubscriptions,
...fogOfWarSubscriptions,
...viewportSubscriptions,
...drawingSubscriptions,
...measurementSubscriptions,
...playerSubscriptions
},
Player: playerDetails,
Character: characterDetails,
PositionSquare: {
rot: parent => parent.rot || 0,
size: parent => parent.size || 1
},
Pointer: {
color: parent => parent.color || 'black'
},
URL: URLResolver,
JSON: JSONResolver
};
export default resolvers;