@@ -27,6 +27,7 @@ import { getFriends, getHero, getHuman, getDroid } from './starWarsData';
2727 * Using our shorthand to describe type systems, the type system for our
2828 * Star Wars example is:
2929 *
30+ * ```graphql
3031 * enum Episode { NEW_HOPE, EMPIRE, JEDI }
3132 *
3233 * interface Character {
@@ -57,6 +58,7 @@ import { getFriends, getHero, getHuman, getDroid } from './starWarsData';
5758 * human(id: String!): Human
5859 * droid(id: String!): Droid
5960 * }
61+ * ```
6062 *
6163 * We begin by setting up our schema.
6264 */
@@ -65,7 +67,9 @@ import { getFriends, getHero, getHuman, getDroid } from './starWarsData';
6567 * The original trilogy consists of three movies.
6668 *
6769 * This implements the following type system shorthand:
68- * enum Episode { NEW_HOPE, EMPIRE, JEDI }
70+ * ```graphql
71+ * enum Episode { NEW_HOPE, EMPIRE, JEDI }
72+ * ```
6973 */
7074const episodeEnum = new GraphQLEnumType ( {
7175 name : 'Episode' ,
@@ -90,13 +94,15 @@ const episodeEnum = new GraphQLEnumType({
9094 * Characters in the Star Wars trilogy are either humans or droids.
9195 *
9296 * 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+ * ```
100106 */
101107const characterInterface : GraphQLInterfaceType = new GraphQLInterfaceType ( {
102108 name : 'Character' ,
@@ -141,13 +147,15 @@ const characterInterface: GraphQLInterfaceType = new GraphQLInterfaceType({
141147 * We define our human type, which implements the character interface.
142148 *
143149 * 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+ * ```
151159 */
152160const humanType = new GraphQLObjectType ( {
153161 name : 'Human' ,
@@ -190,14 +198,16 @@ const humanType = new GraphQLObjectType({
190198 * The other type of character in Star Wars is a droid.
191199 *
192200 * 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+ * ```
201211 */
202212const droidType = new GraphQLObjectType ( {
203213 name : 'Droid' ,
@@ -243,12 +253,13 @@ const droidType = new GraphQLObjectType({
243253 * of the Star Wars trilogy, R2-D2, directly.
244254 *
245255 * 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+ * ```
252263 */
253264const queryType = new GraphQLObjectType ( {
254265 name : 'Query' ,
0 commit comments