-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyourbcabus.graphql
285 lines (243 loc) · 5.8 KB
/
yourbcabus.graphql
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# GraphQL Cost Analysis
directive @cost(
multipliers: [String!],
useMultipliers: Boolean,
complexity: Int
) on OBJECT | FIELD_DEFINITION
type Query {
school(id: ID!): School @cost(complexity: 2)
schools: [RedactedSchool!]! @cost(complexity: 2)
bus(id: ID!): Bus @cost(complexity: 2)
stop(id: ID!): Stop @cost(complexity: 2)
alert(id: ID!): Alert @cost(complexity: 2)
dismissalTimeData(id: ID!): DismissalTimeData @cost(complexity: 2)
currentSchoolScopes(schoolID: ID!): [String!]!
test: String! @cost(complexity: 1)
}
type Mutation {
createSchool(school: SchoolInput!): School!
updateSchool(schoolID: ID!, school: SchoolInput!): School!
updateSchoolMappingData(schoolID: ID!, mappingData: MappingDataInput!): School!
setUserPermissions(schoolID: ID!, userID: ID!, scopes: [String!]!): Boolean!
setClientPermissions(schoolID: ID!, clientID: ID!, scopes: [String!]!): Boolean!
clearAll(schoolID: ID!): Boolean!
createBus(schoolID: ID!, bus: BusInput!): Bus!
updateBus(busID: ID!, bus: BusInput!): Bus!
updateBusStatus(busID: ID!, status: BusStatusInput!): Bus!
deleteBus(busID: ID!): ID!
createStop(busID: ID!, stop: StopInput!): Stop!
updateStop(stopID: ID!, stop: StopInput!): Stop!
deleteStop(stopID: ID!): ID!
createAlert(schoolID: ID!, alert: AlertInput!): Alert!
updateAlert(alertID: ID!, alert: AlertInput!): Alert!
deleteAlert(alertID: ID!): ID!
addDismissalTimeData(schoolID: ID!, data: DismissalTimeDataInput!): DismissalTimeData!
updateDismissalTimeData(dataID: ID!, data: DismissalTimeDataInput!): DismissalTimeData!
deleteDismissalTimeData(dataID: ID!): ID!
}
scalar DateTime
scalar Time
type Location {
lat: Float!
long: Float!
}
input LocationInput {
lat: Float!
long: Float!
}
type BoardingArea {
name: String!
location: Location!
}
input BoardingAreaInput {
name: String!
location: LocationInput!
}
type MappingData {
boundingBoxA: Location!
boundingBoxB: Location!
boardingAreas: [BoardingArea!]!
}
input MappingDataInput {
boundingBoxA: LocationInput!
boundingBoxB: LocationInput!
boardingAreas: [BoardingAreaInput!]!
}
type School {
id: ID!
name: String
location: Location
available: Boolean!
mappingData: MappingData
buses: [Bus!]! @cost(complexity: 4)
alerts: [Alert!]! @cost(complexity: 4)
dismissalTimeData(date: DateTime): DismissalTimeData @cost(complexity: 3)
allDismissalTimeData: [DismissalTimeData!]! @cost(complexity: 4)
timeZone: String
publicScopes: [String!]!
userPermissions: [UserPermission!]! @cost(complexity: 2)
clientPermissions: [ClientPermission!]! @cost(complexity: 2)
}
type RedactedSchool {
id: ID!
name: String
location: Location
readable: Boolean!
available: Boolean!
}
input SchoolInput {
name: String
location: LocationInput
available: Boolean!
timeZone: String
publicScopes: [String!]!
}
type UserPermission {
userID: String!
scopes: [String!]!
}
type ClientPermission {
clientID: String!
scopes: [String!]!
}
type LocationHistoryEntry {
busID: ID!
bus: Bus! @cost(complexity: 4)
locations: [String!]!
time: DateTime
source: String
}
type Bus {
id: ID!
schoolID: ID!
school: School! @cost(complexity: 4)
boardingArea: String
otherNames: [String!]!
invalidateTime: DateTime
available: Boolean!
name: String
company: String
phone: [String!]!
numbers: [String!]!
recentHistory: [LocationHistoryEntry!]! @cost(complexity: 4)
stops: [Stop!]! @cost(complexity: 4)
}
input BusInput {
otherNames: [String!]!
available: Boolean!
name: String
company: String
phone: [String!]!
}
input BusStatusInput {
invalidateTime: DateTime
boardingArea: String
}
type Stop {
id: ID!
busID: ID!
bus: Bus! @cost(complexity: 4)
name: String
description: String
location: Location
order: Float
arrivalTime: DateTime
invalidateTime: DateTime
available: Boolean!
}
input StopInput {
name: String
description: String
location: LocationInput
order: Float
arrivalTime: DateTime
invalidateTime: DateTime
available: Boolean!
}
type DismissalTimeData {
id: ID!
schoolID: ID!
school: School! @cost(complexity: 4)
startDate: DateTime!
endDate: DateTime!
dismissalTime: Time
alertStartTime: Time
alertEndTime: Time
daysOfWeek: [Int!]!
}
input DismissalTimeDataInput {
startDate: DateTime!
endDate: DateTime!
dismissalTime: Time
alertStartTime: Time
alertEndTime: Time
daysOfWeek: [Int!]!
}
type AlertAppearanceColor {
appearance: String!
name: String
r: Int!
g: Int!
b: Int!
alpha: Int!
}
input AlertAppearanceColorInput {
appearance: String!
name: String
r: Int!
g: Int!
b: Int!
alpha: Int!
}
type ResolvedColor {
appearance: String
name: String
r: Int!
g: Int!
b: Int!
alpha: Int!
}
type AlertColor {
name: String
r: Int!
g: Int!
b: Int!
alpha: Int!
appearances: [AlertAppearanceColor!]!
color(appearance: String!): ResolvedColor!
}
input AlertColorInput {
name: String
r: Int!
g: Int!
b: Int!
alpha: Int!
appearances: [AlertAppearanceColorInput!]!
}
type AlertType {
name: String
color: AlertColor
}
input AlertTypeInput {
name: String!
color: AlertColorInput!
}
type Alert {
id: ID!
schoolID: ID!
school: School! @cost(complexity: 4)
start: DateTime!
end: DateTime!
type: AlertType
title: String!
content: String!
dismissable: Boolean!
}
input AlertInput {
start: DateTime!
end: DateTime!
type: AlertTypeInput
title: String!
content: String!
dismissable: Boolean!
}