...
1 package ast
2
3 type SelectionSet []Selection
4
5 type Selection interface {
6 isSelection()
7 GetPosition() *Position
8 }
9
10 func (*Field) isSelection() {}
11 func (*FragmentSpread) isSelection() {}
12 func (*InlineFragment) isSelection() {}
13
14 func (s *Field) GetPosition() *Position { return s.Position }
15 func (s *FragmentSpread) GetPosition() *Position { return s.Position }
16 func (s *InlineFragment) GetPosition() *Position { return s.Position }
17
18 type Field struct {
19 Alias string
20 Name string
21 Arguments ArgumentList
22 Directives DirectiveList
23 SelectionSet SelectionSet
24 Position *Position `dump:"-"`
25
26
27 Definition *FieldDefinition
28 ObjectDefinition *Definition
29 }
30
31 type Argument struct {
32 Name string
33 Value *Value
34 Position *Position `dump:"-"`
35 }
36
37 func (f *Field) ArgumentMap(vars map[string]interface{}) map[string]interface{} {
38 return arg2map(f.Definition.Arguments, f.Arguments, vars)
39 }
40
View as plain text