-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathschema.graphql
339 lines (258 loc) · 7.9 KB
/
schema.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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
schema {
query: RootQuery
}
"""Root Query"""
type RootQuery {
"""Information about the metro stations of the city of Barcelona"""
metroStations(after: String, first: Int, before: String, last: Int, filterBy: FilterByInputTmb): MetroStationConnection
"""Returns the information about a metro station"""
metroStation(findBy: FindByInput!): MetroStationQueryResponse
"""Returns the information about a metro line"""
metroLine(findBy: FindByInput!): MetroLineQueryResponse
"""Information about the metro lines of the city of Barcelona"""
metroLines(after: String, first: Int, before: String, last: Int): MetroLineConnection
"""
Information about the public bike stations (SMOU) of the city of Barcelona
"""
bikeStations(after: String, first: Int, before: String, last: Int, filterBy: FilterByInputBike): BikeStationConnection
"""Returns the information about a bike station"""
bikeStation(findBy: FindByInput!): BikeStationQueryResponse
"""Returns the information about a bus stop"""
busStop(findBy: FindByInput!): BusStopQueryResponse
"""Information about the bus stops of the city of Barcelona"""
busStops(after: String, first: Int, before: String, last: Int, filterBy: FilterByInputTmb): BusStopConnection
"""Returns the information about a bus line"""
busLine(findBy: FindByInput!): BusLineQueryResponse
"""Information about the bus lines of the city of Barcelona"""
busLines(after: String, first: Int, before: String, last: Int): BusLineConnection
}
"""A connection to a list of items."""
type MetroStationConnection {
"""Information to aid in pagination."""
pageInfo: PageInfo!
"""A list of edges."""
edges: [MetroStationEdge]
}
"""Information about pagination in a connection."""
type PageInfo {
"""When paginating forwards, are there more items?"""
hasNextPage: Boolean!
"""When paginating backwards, are there more items?"""
hasPreviousPage: Boolean!
"""When paginating backwards, the cursor to continue."""
startCursor: String
"""When paginating forwards, the cursor to continue."""
endCursor: String
}
"""An edge in a connection."""
type MetroStationEdge {
"""The item at the end of the edge"""
node: MetroStation
"""A cursor for use in pagination"""
cursor: String!
}
"""Metro station information"""
type MetroStation {
"""Unique ID of the station"""
id: ID
"""Name of the station"""
name: String
"""Location coordinates of the station"""
coordinates: CoordinatesOutput
"""Lines the station belongs to e.g. L1, L2"""
lines: [String]
}
"""Coordinates (Latitude, Longitude, Altitude), of a given station/stop"""
type CoordinatesOutput {
latitude: Float
longitude: Float
altitude: Float
}
"""
Input for the filterBy argument of the metro and bus queries, which allows filtering a connection by some parameters (e.g. lineName or lineId)
"""
input FilterByInputTmb {
lineId: Int
lineName: String
}
union MetroStationQueryResponse = MetroStation | NotFoundError
type NotFoundError {
"""Search params that resulted in a not found error"""
params: JSON
}
"""
The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
"""
scalar JSON
"""
Input for the FindBy argument of the queries, which allows finding an entity by some parameters (e.g. name or id)
"""
input FindByInput {
id: Int
name: String
"""Finds the closest station given some coordinates"""
closest: CoordinatesInput
}
"""Coordinates (Latitude, Longitude, Altitude), of a given station/stop"""
input CoordinatesInput {
latitude: Float
longitude: Float
altitude: Float
}
union MetroLineQueryResponse = MetroLine | NotFoundError
"""Metro line information"""
type MetroLine {
"""Numeric Code of the line"""
id: Int
"""Name of the line"""
name: String
"""Origin station of the line"""
originStation: MetroStation
"""Ending station of the line"""
endingStation: MetroStation
"""Stations of the line"""
stations(after: String, first: Int, before: String, last: Int): MetroStationConnection
"""Color of the line represented as a Hexadecimal string"""
color: String
}
"""A connection to a list of items."""
type MetroLineConnection {
"""Information to aid in pagination."""
pageInfo: PageInfo!
"""A list of edges."""
edges: [MetroLineEdge]
}
"""An edge in a connection."""
type MetroLineEdge {
"""The item at the end of the edge"""
node: MetroLine
"""A cursor for use in pagination"""
cursor: String!
}
"""A connection to a list of items."""
type BikeStationConnection {
"""Information to aid in pagination."""
pageInfo: PageInfo!
"""A list of edges."""
edges: [BikeStationEdge]
}
"""An edge in a connection."""
type BikeStationEdge {
"""The item at the end of the edge"""
node: BikeStation
"""A cursor for use in pagination"""
cursor: String!
}
"""Bike station information"""
type BikeStation {
"""Unique ID of the station"""
id: ID
"""Status of the station e.g. IN_SERVICE"""
status: BikeStationStatus
"""Last updated information timestamp (in ms since epoch)"""
lastUpdated: Int
"""Name of the station"""
name: String
"""Total number of bikes the station has"""
capacity: Int
"""Location coordinates of the station"""
coordinates: CoordinatesOutput
"""Information about the available bikes and docks of the station"""
available: BikeStationAvailabilityInfo
}
enum BikeStationStatus {
IN_SERVICE
MAINTENANCE
CLOSED
}
"""Information about the available bikes and docks of the station"""
type BikeStationAvailabilityInfo {
"""Number of available bikes in the station by type"""
bikes: BikeAvailabilityInfo
"""Number of available docks in the station"""
docks: Int
}
"""Information of the bike availability of a station by type"""
type BikeAvailabilityInfo {
"""Number of available electrical bikes in the station"""
electrical: Int
"""Number of available mechanical bikes in the station"""
mechanical: Int
"""Total number of available bikes in the station"""
total: Int
}
"""
Input for the filterBy argument of the bikes queries, which allows filtering a connection by some parameters (e.g. only with available bikes)
"""
input FilterByInputBike {
only: OnlyFilterByInputBike
}
input OnlyFilterByInputBike {
hasAvailableBikes: Boolean
hasAvailableElectricalBikes: Boolean
isInService: Boolean
hasAvailableDocks: Boolean
}
union BikeStationQueryResponse = BikeStation | NotFoundError
union BusStopQueryResponse = BusStop | NotFoundError
"""Bus stop information"""
type BusStop {
"""Unique ID of the stop"""
id: ID
"""Name of the stop"""
name: String
"""Location of the stop"""
location: Location
}
"""Location of a stop/station"""
type Location {
address: String
city: String
district: String
street: String
coordinates: CoordinatesOutput
}
"""A connection to a list of items."""
type BusStopConnection {
"""Information to aid in pagination."""
pageInfo: PageInfo!
"""A list of edges."""
edges: [BusStopEdge]
}
"""An edge in a connection."""
type BusStopEdge {
"""The item at the end of the edge"""
node: BusStop
"""A cursor for use in pagination"""
cursor: String!
}
union BusLineQueryResponse = BusLine | NotFoundError
"""Bus line information"""
type BusLine {
"""Numeric Code of the line"""
id: Int
"""Name of the line"""
name: String
"""Origin stop of the line"""
originStop: BusStop
"""Ending stop of the line"""
endingStop: BusStop
"""Stops of the line"""
stops(after: String, first: Int, before: String, last: Int): BusStopConnection
"""Color of the line represented as a Hexadecimal string"""
color: String
}
"""A connection to a list of items."""
type BusLineConnection {
"""Information to aid in pagination."""
pageInfo: PageInfo!
"""A list of edges."""
edges: [BusLineEdge]
}
"""An edge in a connection."""
type BusLineEdge {
"""The item at the end of the edge"""
node: BusLine
"""A cursor for use in pagination"""
cursor: String!
}