-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathschema.sdl
388 lines (279 loc) · 10.4 KB
/
schema.sdl
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
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
# Schema definition for *Star Wars API* backend in GraphQL/Relay
## An individual person or character within the Star Wars universe.
type Person implements Node @rootConnection(field: "allPeople") {
## Node unique identifier.
id: ID!
## The name of this person.
name: String!
## The birth year of the person, using the in-universe standard of BBY or
## ABY - Before the Battle of Yavin or After the Battle of Yavin. The Battle
## of Yavin is a battle that occurs at the end of Star Wars episode IV: A
## New Hope.
birthYear: String
## The eye color of this person. Will be null if not known or "n/a" if the
## person does not have an eye.
eyeColor: String
## The hair color of this person. Will be n/a if not applicable or null
## if unknown.
hairColor: String
## The gender of this person. Will be n/a if not applicable or null if
## unknown.
gender: String
## The height of the person in centimeters.
height: Int
## The mass of the person in kilograms.
mass: Float
## The skin color of this person.
skinColor: String
## A planet that this person was born on or inhabits.
homeWorlds: NodeConnection(Planet, residents)
## Films that this person has been in.
films: NodeConnection(Film, characters)
## Species that this person belongs to.
species: NodeConnection(Species, people)
## Craft that this person has piloted.
craft: NodeConnection(Craft, pilots)
## ISO 8601 date of when entry was created.
created: String
## ISO 8601 date of when entry was edited.
edited: String
}
## A Star Wars film.
type Film implements Node @rootConnection(field: "allFilms") {
## Node unique identifier.
id: ID!
## The title of this film.
title: String!
## The episode number of this film.
episodeId: Int! @rootPluralId(field: "episode")
## The opening paragraphs at the beginning of this film.
openingCrawl: String
## The name of the director of this film.
director: String
## List of the producers of this film.
producers: [String!]
## The ISO 8601 date format of film release at original creator country.
releaseDate: String
## Species that are in this film.
species: NodeConnection(Species, films)
## Craft that are in this film.
craft: NodeConnection(Craft, films)
## People that are in this film.
characters: NodeConnection(Person, films)
## Planets that are in this film.
planets: NodeConnection(Planet, films)
## ISO 8601 date of when entry was created.
created: String
## ISO 8601 date of when entry was edited.
edited: String
}
## A Planet is a large mass, planet or planetoid in the Star Wars Universe,
## at the time of 0 ABY.
type Planet implements Node @rootConnection(field: "allPlanets") {
## Node unique identifier.
id: ID!
## The name of this planet.
name: String!
## The diameter of this planet in kilometers.
diameter: Int
## The number of standard hours it takes for this planet to complete a single
## rotation on its axis.
rotationPeriod: Int
## The number of standard days it takes for this planet to complete a single
## orbit of its local star.
orbitalPeriod: Int
## A number denoting the gravity of this planet, where 1 is normal or 1
## standard G. 2 is twice or 2 standard Gs. 0.5 is half or 0.5 standard Gs.
gravity: String
## The average population of sentient beings inhabiting this planet.
population: Int
## List of the climates of this planet.
climates: [String!]
## List of the terrains of this planet.
terrains: [String!]
## The percentage of the planet surface that is naturally occurring water or
## bodies of water.
surfaceWater: Float
## People that live on this planet.
residents: NodeConnection(Person, homeWorlds)
## Films that this planet has appeared in.
films: NodeConnection(Film, planets)
## ISO 8601 date of when entry was created.
created: String
## ISO 8601 date of when entry was edited.
edited: String
}
## A Species is a type of person or character within the Star Wars Universe.
type Species implements Node @rootConnection(field: "allSpecies") {
## Node unique identifier.
id: ID!
## The name of this species.
name: String
## The classification of this species, such as "mammal" or "reptile".
classification: String
## The designation of this species, such as "SENTIENT".
designation: Designation
## The average height of this species in centimeters.
averageHeight: Float
## The average lifespan of this species in years.
averageLifespan: Int
## Common eye colors for this species, empty list if this species does
## not typically have eyes and null if unknown.
eyeColors: [String!]
## Common hair colors for this species, empty list if this species does
## not typically have hair and null if unknown.
hairColors: [String!]
## Common skin colors for this species, empty list if this species does
## not typically have skin and null if unknown.
skinColors: [String!]
## The language commonly spoken by this species.
language: String
## A planet that this species originates from.
homeWorld: Planet
## People that are a part of this species.
people: NodeConnection(Person, species)
## Films that this species has appeared in.
films: NodeConnection(Film, species)
## ISO 8601 date of when entry was created.
created: String
## ISO 8601 date of when entry was edited.
edited: String
}
## Craft represents a transport craft
interface Craft {
## The name of this starship. The common name, such as Death Star.
name: String!
## The model or official name of this starship. Such as T-65 X-wing
## or DS-1 Orbital Battle Station.
model: String
## The class of this starship, such as Starfighter or Deep Space Mobile
## Battlestation
class: String
## The manufacturers of this starship.
manufacturers: [String!]
## The cost of this starship new, in galactic credits.
costInCredits: Int
## The length of this starship in meters.
length: Float
## The number of personnel needed to run or pilot this starship.
crew: String
## The number of non-essential people this starship can transport.
passengers: String
## The maximum speed of this starship in atmosphere. null if this starship
## is incapable of atmospheric flight.
maxAtmosphericSpeed: Int
## The maximum number of kilograms that this starship can transport.
cargoCapacity: Int
## The maximum length of time that this starship can provide consumables
## for its entire crew without having to resupply.
consumables: Duration
## Films that this starship has appeared in.
films: NodeConnection(Film, craft)
## People that this starship has been piloted by.
pilots: NodeConnection(Person, craft)
## ISO 8601 date of when entry was created.
created: String
## ISO 8601 date of when entry was edited.
edited: String
}
## Starship is a transport craft that has hyperdrive capability.
type Starship implements Node, Craft @rootConnection(field: "allStarships") {
## Node unique identifier.
id: ID!
## The name of this starship. The common name, such as Death Star.
name: String!
## The model or official name of this starship. Such as T-65 X-wing
## or DS-1 Orbital Battle Station.
model: String
## The class of this starship, such as Starfighter or Deep Space Mobile
## Battlestation
class: String
## The manufacturers of this starship.
manufacturers: [String!]
## The cost of this starship new, in galactic credits.
costInCredits: Int
## The length of this starship in meters.
length: Float
## The number of personnel needed to run or pilot this starship.
crew: String
## The number of non-essential people this starship can transport.
passengers: String
## The maximum speed of this starship in atmosphere. null if this starship
## is incapable of atmospheric flight.
maxAtmosphericSpeed: Int
## The maximum number of kilograms that this starship can transport.
cargoCapacity: Int
## The maximum length of time that this starship can provide consumables
## for its entire crew without having to resupply.
consumables: Duration
## Films that this starship has appeared in.
films: NodeConnection(Film, craft)
## People that this starship has been piloted by.
pilots: NodeConnection(Person, craft)
## The Maximum number of Megalights this starship can travel in a standard
## hour. A Megalight is a standard unit of distance and has never been
## defined before within the Star Wars universe. This figure is only really
## useful for measuring the difference in speed of starships. We can assume
## it is similar to AU, the distance between our Sun (Sol) and Earth.
mglt: Int
## The class of this starships hyperdrive.
hyperdriveRating: Float
## ISO 8601 date of when entry was created.
created: String
## ISO 8601 date of when entry was edited.
edited: String
}
## Vehicle is a transport craft that does not have hyperdrive capability.
type Vehicle implements Node, Craft @rootConnection(field: "allVehicles") {
## Node unique identifier.
id: ID!
## The name of this vehicle. The common name, such as "Sand Crawler" or
## "Speeder bike".
name: String!
## The model or official name of this vehicle.
## Such as "All-Terrain Attack Transport".
model: String
## The class of this vehicle, such as "Wheeled" or "Repulsorcraft".
class: String
## The manufacturers of this vehicle.
manufacturers: [String!]
## The cost of this vehicle new, in galactic credits.
costInCredits: Int
## The length of this vehicle in meters.
length: Float
## The number of personnel needed to run or pilot this vehicle.
crew: String
## The number of non-essential people this vehicle can transport.
passengers: String
## The maximum speed of this vehicle in atmosphere. null if this vehicle
## is incapable of atmospheric flight.
maxAtmosphericSpeed: Int
## The maximum number of kilograms that this vehicle can transport.
cargoCapacity: Int
## The maximum length of time that this vehicle can provide consumables
## for its entire crew without having to resupply.
consumables: Duration
## Films that this vehicle has appeared in.
films: NodeConnection(Film, craft)
## People that this vehicle has been piloted by.
pilots: NodeConnection(Person, craft)
## ISO 8601 date of when entry was created.
created: String
## ISO 8601 date of when entry was edited.
edited: String
}
enum Designation {
SENTIENT
REPTILIAN
}
type Duration {
duration: Int
period: DurationPeriod
}
enum DurationPeriod {
HOURS
DAYS
WEEKS
MONTHS
YEARS
}