| 375 | func (introDirective) typeName() string { return "__Directive" } |
| 376 | |
| 377 | func (x introDirective) resolve(s *gqlScaffolder, field string, args map[string]any) any { |
| 378 | switch field { |
| 379 | case "name": |
| 380 | return x.d.Name |
| 381 | case "description": |
| 382 | return optional(x.d.Description) |
| 383 | case "isRepeatable": |
| 384 | return x.d.IsRepeatable |
| 385 | case "locations": |
| 386 | locations := make([]any, len(x.d.Locations)) |
| 387 | for i, l := range x.d.Locations { |
| 388 | locations[i] = string(l) |
| 389 | } |
| 390 | return locations |
| 391 | case "args": |
| 392 | return introArgs(x.d.Arguments, args) |
| 393 | } |
| 394 | return nil |
| 395 | } |
| 396 | |
| 397 | func deprecationReason(dirs ast.DirectiveList) any { |
| 398 | d := dirs.ForName("deprecated") |