-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.graphql
More file actions
172 lines (159 loc) · 5.33 KB
/
schema.graphql
File metadata and controls
172 lines (159 loc) · 5.33 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
"A map"
type Map {
"the ID of this map"
id: ID!
"The date on which this map was created"
createdAt: String!
"The name of this map"
mapName: String
"The description for this map"
description: String
"The creator of this map"
creatorName: String
}
"Filter which can be applyed to mapList"
input MapListQuery {
"returns all maps with a"
id: ID
"returns all maps with a given map name"
mapName: String
"Returns all maps with a given creator name"
creatorName: String
"Returns all maps created after the given date"
startDate: String
"Returns all maps created before the given date"
endDate: String
"search operation to preform w/ fields (default AND)"
operation: Operation
" set true to retrieve a psuedo-random selection of map (note: overides all other params except size, may return duplicate maps)"
random: Boolean
}
"A point on a map"
type Point {
"the ID of this point"
id: ID!
"The ID of the map with which the point is associated"
mapId: ID!
"The name of this point"
name: String!
"the coordinates of the point"
coordinates: Coordinates!
"The description for this point"
description: String
"The category of this point"
category: String
"string to describe categories filled in as other"
otherText: String
"The creator of this point"
creatorName: String
}
"Filter which can be applyed pointList"
input PointListQuery {
"the ID of a point"
id: ID
"The ID of the point's map"
mapId: ID
" coordinates of the point"
coordinates: [Int!]
" set to retrieve all points within this distance of a given set of cordinates exclusive"
within: Int
"name of the creator of the map"
creatorName: String
"the category of the point"
category: String
"search operation to preform w/ fields (default AND)"
operation: Operation
" set true to retrieve a psuedo-random selection of points (note: overides all other params except size, may return duplicate points)"
random: Boolean
}
" stores the coordinates of a point"
type Coordinates {
" the x coordinate of the point"
x: Int!
" the y coordinate of the point"
y: Int!
}
"Input for adding a point"
input PointAdd {
"the name of the point"
name: String!
"the coordinates of the point"
coordinates: [Int!]!
"The description for this point"
description: String
"The category of this point"
category: String
"string to describe categories filled in as other"
otherText: String
"The creator of this point"
creatorName: String
}
" Search operations"
enum Operation {
AND
OR
NOR
}
type Query {
"Given a map's id, returns that map"
map(id: ID!): Map
"Get the list maps of a given size starting at a given page conforming to a given filter"
mapList(
"query object for more specific searches"
query: MapListQuery
"The number of maps to return (default 10)"
size: Int
"The index of the page to return (default 0)"
page: Int
): [Map]
"Given a points's id, returns that point"
point(id: ID!): Point
"Get the list points of a given size starting at a given page conforming to a given filter"
pointList(
"query object for more specific searches"
query: PointListQuery
"The number of points to return (default 10)"
size: Int
"The index of the page to return (default 0)"
page: Int
): [Point]
}
type Mutation {
"Used to add a map. Returns the ID of the added map"
addMap(
"The name of this map"
mapName: String
"The description for this map"
description: String
"The creator of this map"
creatorName: String
): ID
" used to add a point. Returns the ID of the added point"
addPoint(
"The ID of the point's map"
mapId: ID!
"the name of this point"
name: String!
"An array of ints of length 2 giving the [x, y] coordinates of the point"
coordinates: [Int!]!
"The description for this point"
description: String
"The category of this point"
category: String
" text to describe the category if it isn't one of the enumerated categories"
otherText: String
"The creator of this point"
creatorName: String
): ID
"(for use by the frontend) saves a map and associated points and returns maps ID"
saveMap(
"The name of this map"
mapName: String
"The description for this map"
description: String
"The creator of this map"
creatorName: String
"points on this map"
points: [PointAdd]
): ID
}