@@ -100,19 +100,21 @@ func (def *OperationTypeDefinition) GetLoc() *Location {
100
100
101
101
// ScalarDefinition implements Node, Definition
102
102
type ScalarDefinition struct {
103
- Kind string
104
- Loc * Location
105
- Name * Name
103
+ Kind string
104
+ Loc * Location
105
+ Name * Name
106
+ Directives []* Directive
106
107
}
107
108
108
109
func NewScalarDefinition (def * ScalarDefinition ) * ScalarDefinition {
109
110
if def == nil {
110
111
def = & ScalarDefinition {}
111
112
}
112
113
return & ScalarDefinition {
113
- Kind : kinds .ScalarDefinition ,
114
- Loc : def .Loc ,
115
- Name : def .Name ,
114
+ Kind : kinds .ScalarDefinition ,
115
+ Loc : def .Loc ,
116
+ Name : def .Name ,
117
+ Directives : def .Directives ,
116
118
}
117
119
}
118
120
@@ -146,6 +148,7 @@ type ObjectDefinition struct {
146
148
Loc * Location
147
149
Name * Name
148
150
Interfaces []* Named
151
+ Directives []* Directive
149
152
Fields []* FieldDefinition
150
153
}
151
154
@@ -158,6 +161,7 @@ func NewObjectDefinition(def *ObjectDefinition) *ObjectDefinition {
158
161
Loc : def .Loc ,
159
162
Name : def .Name ,
160
163
Interfaces : def .Interfaces ,
164
+ Directives : def .Directives ,
161
165
Fields : def .Fields ,
162
166
}
163
167
}
@@ -188,23 +192,25 @@ func (def *ObjectDefinition) GetOperation() string {
188
192
189
193
// FieldDefinition implements Node
190
194
type FieldDefinition struct {
191
- Kind string
192
- Loc * Location
193
- Name * Name
194
- Arguments []* InputValueDefinition
195
- Type Type
195
+ Kind string
196
+ Loc * Location
197
+ Name * Name
198
+ Arguments []* InputValueDefinition
199
+ Type Type
200
+ Directives []* Directive
196
201
}
197
202
198
203
func NewFieldDefinition (def * FieldDefinition ) * FieldDefinition {
199
204
if def == nil {
200
205
def = & FieldDefinition {}
201
206
}
202
207
return & FieldDefinition {
203
- Kind : kinds .FieldDefinition ,
204
- Loc : def .Loc ,
205
- Name : def .Name ,
206
- Arguments : def .Arguments ,
207
- Type : def .Type ,
208
+ Kind : kinds .FieldDefinition ,
209
+ Loc : def .Loc ,
210
+ Name : def .Name ,
211
+ Arguments : def .Arguments ,
212
+ Type : def .Type ,
213
+ Directives : def .Directives ,
208
214
}
209
215
}
210
216
@@ -223,6 +229,7 @@ type InputValueDefinition struct {
223
229
Name * Name
224
230
Type Type
225
231
DefaultValue Value
232
+ Directives []* Directive
226
233
}
227
234
228
235
func NewInputValueDefinition (def * InputValueDefinition ) * InputValueDefinition {
@@ -235,6 +242,7 @@ func NewInputValueDefinition(def *InputValueDefinition) *InputValueDefinition {
235
242
Name : def .Name ,
236
243
Type : def .Type ,
237
244
DefaultValue : def .DefaultValue ,
245
+ Directives : def .Directives ,
238
246
}
239
247
}
240
248
@@ -248,21 +256,23 @@ func (def *InputValueDefinition) GetLoc() *Location {
248
256
249
257
// InterfaceDefinition implements Node, Definition
250
258
type InterfaceDefinition struct {
251
- Kind string
252
- Loc * Location
253
- Name * Name
254
- Fields []* FieldDefinition
259
+ Kind string
260
+ Loc * Location
261
+ Name * Name
262
+ Directives []* Directive
263
+ Fields []* FieldDefinition
255
264
}
256
265
257
266
func NewInterfaceDefinition (def * InterfaceDefinition ) * InterfaceDefinition {
258
267
if def == nil {
259
268
def = & InterfaceDefinition {}
260
269
}
261
270
return & InterfaceDefinition {
262
- Kind : kinds .InterfaceDefinition ,
263
- Loc : def .Loc ,
264
- Name : def .Name ,
265
- Fields : def .Fields ,
271
+ Kind : kinds .InterfaceDefinition ,
272
+ Loc : def .Loc ,
273
+ Name : def .Name ,
274
+ Directives : def .Directives ,
275
+ Fields : def .Fields ,
266
276
}
267
277
}
268
278
@@ -292,21 +302,23 @@ func (def *InterfaceDefinition) GetOperation() string {
292
302
293
303
// UnionDefinition implements Node, Definition
294
304
type UnionDefinition struct {
295
- Kind string
296
- Loc * Location
297
- Name * Name
298
- Types []* Named
305
+ Kind string
306
+ Loc * Location
307
+ Name * Name
308
+ Directives []* Directive
309
+ Types []* Named
299
310
}
300
311
301
312
func NewUnionDefinition (def * UnionDefinition ) * UnionDefinition {
302
313
if def == nil {
303
314
def = & UnionDefinition {}
304
315
}
305
316
return & UnionDefinition {
306
- Kind : kinds .UnionDefinition ,
307
- Loc : def .Loc ,
308
- Name : def .Name ,
309
- Types : def .Types ,
317
+ Kind : kinds .UnionDefinition ,
318
+ Loc : def .Loc ,
319
+ Name : def .Name ,
320
+ Directives : def .Directives ,
321
+ Types : def .Types ,
310
322
}
311
323
}
312
324
@@ -336,21 +348,23 @@ func (def *UnionDefinition) GetOperation() string {
336
348
337
349
// EnumDefinition implements Node, Definition
338
350
type EnumDefinition struct {
339
- Kind string
340
- Loc * Location
341
- Name * Name
342
- Values []* EnumValueDefinition
351
+ Kind string
352
+ Loc * Location
353
+ Name * Name
354
+ Directives []* Directive
355
+ Values []* EnumValueDefinition
343
356
}
344
357
345
358
func NewEnumDefinition (def * EnumDefinition ) * EnumDefinition {
346
359
if def == nil {
347
360
def = & EnumDefinition {}
348
361
}
349
362
return & EnumDefinition {
350
- Kind : kinds .EnumDefinition ,
351
- Loc : def .Loc ,
352
- Name : def .Name ,
353
- Values : def .Values ,
363
+ Kind : kinds .EnumDefinition ,
364
+ Loc : def .Loc ,
365
+ Name : def .Name ,
366
+ Directives : def .Directives ,
367
+ Values : def .Values ,
354
368
}
355
369
}
356
370
@@ -380,19 +394,21 @@ func (def *EnumDefinition) GetOperation() string {
380
394
381
395
// EnumValueDefinition implements Node, Definition
382
396
type EnumValueDefinition struct {
383
- Kind string
384
- Loc * Location
385
- Name * Name
397
+ Kind string
398
+ Loc * Location
399
+ Name * Name
400
+ Directives []* Directive
386
401
}
387
402
388
403
func NewEnumValueDefinition (def * EnumValueDefinition ) * EnumValueDefinition {
389
404
if def == nil {
390
405
def = & EnumValueDefinition {}
391
406
}
392
407
return & EnumValueDefinition {
393
- Kind : kinds .EnumValueDefinition ,
394
- Loc : def .Loc ,
395
- Name : def .Name ,
408
+ Kind : kinds .EnumValueDefinition ,
409
+ Loc : def .Loc ,
410
+ Name : def .Name ,
411
+ Directives : def .Directives ,
396
412
}
397
413
}
398
414
@@ -406,21 +422,23 @@ func (def *EnumValueDefinition) GetLoc() *Location {
406
422
407
423
// InputObjectDefinition implements Node, Definition
408
424
type InputObjectDefinition struct {
409
- Kind string
410
- Loc * Location
411
- Name * Name
412
- Fields []* InputValueDefinition
425
+ Kind string
426
+ Loc * Location
427
+ Name * Name
428
+ Directives []* Directive
429
+ Fields []* InputValueDefinition
413
430
}
414
431
415
432
func NewInputObjectDefinition (def * InputObjectDefinition ) * InputObjectDefinition {
416
433
if def == nil {
417
434
def = & InputObjectDefinition {}
418
435
}
419
436
return & InputObjectDefinition {
420
- Kind : kinds .InputObjectDefinition ,
421
- Loc : def .Loc ,
422
- Name : def .Name ,
423
- Fields : def .Fields ,
437
+ Kind : kinds .InputObjectDefinition ,
438
+ Loc : def .Loc ,
439
+ Name : def .Name ,
440
+ Directives : def .Directives ,
441
+ Fields : def .Fields ,
424
442
}
425
443
}
426
444
0 commit comments