@@ -27,7 +27,9 @@ const typeDefs = /* GraphQL */ `
27
27
mutation: Mutation
28
28
}
29
29
30
- # The query type, represents all of the entry points into our object graph
30
+ """
31
+ The query type, represents all of the entry points into our object graph
32
+ """
31
33
type Query {
32
34
hero(episode: Episode): Character
33
35
reviews(episode: Episode!): [Review]
@@ -38,155 +40,251 @@ const typeDefs = /* GraphQL */ `
38
40
starship(id: ID!): Starship
39
41
}
40
42
41
- # The mutation type, represents all updates we can make to our data
43
+ """
44
+ The mutation type, represents all updates we can make to our data
45
+ """
42
46
type Mutation {
43
47
createReview(episode: Episode, review: ReviewInput!): Review
44
48
}
45
49
46
- # The episodes in the Star Wars trilogy
50
+ """
51
+ The episodes in the Star Wars trilogy
52
+ """
47
53
enum Episode {
48
- # Star Wars Episode IV: A New Hope, released in 1977.
54
+ """
55
+ Star Wars Episode IV: A New Hope, released in 1977.
56
+ """
49
57
NEWHOPE
50
58
51
- # Star Wars Episode V: The Empire Strikes Back, released in 1980.
59
+ """
60
+ Star Wars Episode V: The Empire Strikes Back, released in 1980.
61
+ """
52
62
EMPIRE
53
63
54
- # Star Wars Episode VI: Return of the Jedi, released in 1983.
64
+ """
65
+ Star Wars Episode VI: Return of the Jedi, released in 1983.
66
+ """
55
67
JEDI
56
68
}
57
69
58
- # A character from the Star Wars universe
70
+ """
71
+ A character from the Star Wars universe
72
+ """
59
73
interface Character {
60
- # The ID of the character
74
+ """
75
+ The ID of the character
76
+ """
61
77
id: ID!
62
78
63
- # The name of the character
79
+ """
80
+ The name of the character
81
+ """
64
82
name: String!
65
83
66
- # The friends of the character, or an empty list if they have none
84
+ """
85
+ The friends of the character, or an empty list if they have none
86
+ """
67
87
friends: [Character]
68
88
69
- # The friends of the character exposed as a connection with edges
89
+ """
90
+ The friends of the character exposed as a connection with edges
91
+ """
70
92
friendsConnection(first: Int, after: ID): FriendsConnection!
71
93
72
- # The movies this character appears in
94
+ """
95
+ The movies this character appears in
96
+ """
73
97
appearsIn: [Episode]!
74
98
}
75
99
76
- # Units of height
100
+ """
101
+ Units of height
102
+ """
77
103
enum LengthUnit {
78
- # The standard unit around the world
104
+ """
105
+ The standard unit around the world
106
+ """
79
107
METER
80
108
81
- # Primarily used in the United States
109
+ """
110
+ Primarily used in the United States
111
+ """
82
112
FOOT
83
113
}
84
114
85
- # A humanoid creature from the Star Wars universe
115
+ """
116
+ A humanoid creature from the Star Wars universe
117
+ """
86
118
type Human implements Character {
87
- # The ID of the human
119
+ """
120
+ The ID of the human
121
+ """
88
122
id: ID!
89
123
90
- # What this human calls themselves
124
+ """
125
+ What this human calls themselves
126
+ """
91
127
name: String!
92
128
93
- # Height in the preferred unit, default is meters
129
+ """
130
+ Height in the preferred unit, default is meters
131
+ """
94
132
height(unit: LengthUnit = METER): Float
95
133
96
- # Mass in kilograms, or null if unknown
134
+ """
135
+ Mass in kilograms, or null if unknown
136
+ """
97
137
mass: Float
98
138
99
- # This human's friends, or an empty list if they have none
139
+ """
140
+ This human's friends, or an empty list if they have none
141
+ """
100
142
friends: [Character]
101
143
102
- # The friends of the human exposed as a connection with edges
144
+ """
145
+ The friends of the human exposed as a connection with edges
146
+ """
103
147
friendsConnection(first: Int, after: ID): FriendsConnection!
104
148
105
- # The movies this human appears in
149
+ """
150
+ The movies this human appears in
151
+ """
106
152
appearsIn: [Episode]!
107
153
108
- # A list of starships this person has piloted, or an empty list if none
154
+ """
155
+ A list of starships this person has piloted, or an empty list if none
156
+ """
109
157
starships: [Starship]
110
158
}
111
159
112
- # An autonomous mechanical character in the Star Wars universe
160
+ """
161
+ An autonomous mechanical character in the Star Wars universe
162
+ """
113
163
type Droid implements Character {
114
- # The ID of the droid
164
+ """
165
+ The ID of the droid
166
+ """
115
167
id: ID!
116
168
117
- # What others call this droid
169
+ """
170
+ What others call this droid
171
+ """
118
172
name: String!
119
173
120
- # This droid's friends, or an empty list if they have none
174
+ """
175
+ This droid's friends, or an empty list if they have none
176
+ """
121
177
friends: [Character]
122
178
123
- # The friends of the droid exposed as a connection with edges
179
+ """
180
+ The friends of the droid exposed as a connection with edges
181
+ """
124
182
friendsConnection(first: Int, after: ID): FriendsConnection!
125
183
126
- # The movies this droid appears in
184
+ """
185
+ The movies this droid appears in
186
+ """
127
187
appearsIn: [Episode]!
128
188
129
- # This droid's primary function
189
+ """
190
+ This droid's primary function
191
+ """
130
192
primaryFunction: String
131
193
}
132
194
133
- # A connection object for a character's friends
195
+ """
196
+ A connection object for a character's friends
197
+ """
134
198
type FriendsConnection {
135
- # The total number of friends
199
+ """
200
+ The total number of friends
201
+ """
136
202
totalCount: Int
137
203
138
- # The edges for each of the character's friends.
204
+ """
205
+ The edges for each of the character's friends.
206
+ """
139
207
edges: [FriendsEdge]
140
208
141
- # A list of the friends, as a convenience when edges are not needed.
209
+ """
210
+ A list of the friends, as a convenience when edges are not needed.
211
+ """
142
212
friends: [Character]
143
213
144
- # Information for paginating this connection
214
+ """
215
+ Information for paginating this connection
216
+ """
145
217
pageInfo: PageInfo!
146
218
}
147
219
148
- # An edge object for a character's friends
220
+ """
221
+ An edge object for a character's friends
222
+ """
149
223
type FriendsEdge {
150
- # A cursor used for pagination
224
+ """
225
+ A cursor used for pagination
226
+ """
151
227
cursor: ID!
152
228
153
- # The character represented by this friendship edge
229
+ """
230
+ The character represented by this friendship edge
231
+ """
154
232
node: Character
155
233
}
156
234
157
- # Information for paginating this connection
235
+ """
236
+ Information for paginating this connection
237
+ """
158
238
type PageInfo {
159
239
startCursor: ID
160
240
endCursor: ID
161
241
hasNextPage: Boolean!
162
242
}
163
243
164
- # Represents a review for a movie
244
+ """
245
+ Represents a review for a movie
246
+ """
165
247
type Review {
166
- # The number of stars this review gave, 1-5
248
+ """
249
+ The number of stars this review gave, 1-5
250
+ """
167
251
stars: Int!
168
252
169
- # Comment about the movie
253
+ """
254
+ Comment about the movie
255
+ """
170
256
commentary: String
171
257
}
172
258
173
- # The input object sent when someone is creating a new review
259
+ """
260
+ The input object sent when someone is creating a new review
261
+ """
174
262
input ReviewInput {
175
- # 0-5 stars
263
+ """
264
+ 0-5 stars
265
+ """
176
266
stars: Int!
177
267
178
- # Comment about the movie, optional
268
+ """
269
+ Comment about the movie, optional
270
+ """
179
271
commentary: String
180
272
}
181
273
182
274
type Starship {
183
- # The ID of the starship
275
+ """
276
+ The ID of the starship
277
+ """
184
278
id: ID!
185
279
186
- # The name of the starship
280
+ """
281
+ The name of the starship
282
+ """
187
283
name: String!
188
284
189
- # Length of the starship, along the longest axis
285
+ """
286
+ Length of the starship, along the longest axis
287
+ """
190
288
length(unit: LengthUnit = METER): Float
191
289
}
192
290
0 commit comments