@@ -27,6 +27,7 @@ import { getFriends, getHero, getHuman, getDroid } from './starWarsData';
27
27
* Using our shorthand to describe type systems, the type system for our
28
28
* Star Wars example is:
29
29
*
30
+ * ```graphql
30
31
* enum Episode { NEW_HOPE, EMPIRE, JEDI }
31
32
*
32
33
* interface Character {
@@ -57,6 +58,7 @@ import { getFriends, getHero, getHuman, getDroid } from './starWarsData';
57
58
* human(id: String!): Human
58
59
* droid(id: String!): Droid
59
60
* }
61
+ * ```
60
62
*
61
63
* We begin by setting up our schema.
62
64
*/
@@ -65,7 +67,9 @@ import { getFriends, getHero, getHuman, getDroid } from './starWarsData';
65
67
* The original trilogy consists of three movies.
66
68
*
67
69
* This implements the following type system shorthand:
68
- * enum Episode { NEW_HOPE, EMPIRE, JEDI }
70
+ * ```graphql
71
+ * enum Episode { NEW_HOPE, EMPIRE, JEDI }
72
+ * ```
69
73
*/
70
74
const episodeEnum = new GraphQLEnumType ( {
71
75
name : 'Episode' ,
@@ -90,13 +94,15 @@ const episodeEnum = new GraphQLEnumType({
90
94
* Characters in the Star Wars trilogy are either humans or droids.
91
95
*
92
96
* This implements the following type system shorthand:
93
- * interface Character {
94
- * id: String!
95
- * name: String
96
- * friends: [Character]
97
- * appearsIn: [Episode]
98
- * secretBackstory: String
99
- * }
97
+ * ```graphql
98
+ * interface Character {
99
+ * id: String!
100
+ * name: String
101
+ * friends: [Character]
102
+ * appearsIn: [Episode]
103
+ * secretBackstory: String
104
+ * }
105
+ * ```
100
106
*/
101
107
const characterInterface : GraphQLInterfaceType = new GraphQLInterfaceType ( {
102
108
name : 'Character' ,
@@ -141,13 +147,15 @@ const characterInterface: GraphQLInterfaceType = new GraphQLInterfaceType({
141
147
* We define our human type, which implements the character interface.
142
148
*
143
149
* This implements the following type system shorthand:
144
- * type Human : Character {
145
- * id: String!
146
- * name: String
147
- * friends: [Character]
148
- * appearsIn: [Episode]
149
- * secretBackstory: String
150
- * }
150
+ * ```graphql
151
+ * type Human : Character {
152
+ * id: String!
153
+ * name: String
154
+ * friends: [Character]
155
+ * appearsIn: [Episode]
156
+ * secretBackstory: String
157
+ * }
158
+ * ```
151
159
*/
152
160
const humanType = new GraphQLObjectType ( {
153
161
name : 'Human' ,
@@ -190,14 +198,16 @@ const humanType = new GraphQLObjectType({
190
198
* The other type of character in Star Wars is a droid.
191
199
*
192
200
* This implements the following type system shorthand:
193
- * type Droid : Character {
194
- * id: String!
195
- * name: String
196
- * friends: [Character]
197
- * appearsIn: [Episode]
198
- * secretBackstory: String
199
- * primaryFunction: String
200
- * }
201
+ * ```graphql
202
+ * type Droid : Character {
203
+ * id: String!
204
+ * name: String
205
+ * friends: [Character]
206
+ * appearsIn: [Episode]
207
+ * secretBackstory: String
208
+ * primaryFunction: String
209
+ * }
210
+ * ```
201
211
*/
202
212
const droidType = new GraphQLObjectType ( {
203
213
name : 'Droid' ,
@@ -243,12 +253,13 @@ const droidType = new GraphQLObjectType({
243
253
* of the Star Wars trilogy, R2-D2, directly.
244
254
*
245
255
* This implements the following type system shorthand:
246
- * type Query {
247
- * hero(episode: Episode): Character
248
- * human(id: String!): Human
249
- * droid(id: String!): Droid
250
- * }
251
- *
256
+ * ```graphql
257
+ * type Query {
258
+ * hero(episode: Episode): Character
259
+ * human(id: String!): Human
260
+ * droid(id: String!): Droid
261
+ * }
262
+ * ```
252
263
*/
253
264
const queryType = new GraphQLObjectType ( {
254
265
name : 'Query' ,
0 commit comments