Module: TinyGQL::Visitors::Visitor

Defined in:
lib/tinygql/visitors.rb

Instance Method Summary collapse

Instance Method Details

#handle_argument(obj) ⇒ Object



35
36
37
# File 'lib/tinygql/visitors.rb', line 35

def handle_argument obj
      obj.value.accept self
end

#handle_boolean_value(obj) ⇒ Object



58
59
# File 'lib/tinygql/visitors.rb', line 58

def handle_boolean_value obj
end

#handle_directive(obj) ⇒ Object



69
70
71
# File 'lib/tinygql/visitors.rb', line 69

def handle_directive obj
      obj.arguments.each { _1.accept self }
end

#handle_directive_definition(obj) ⇒ Object



195
196
197
198
199
200
# File 'lib/tinygql/visitors.rb', line 195

def handle_directive_definition obj
  if obj.arguments_definition
      obj.arguments_definition.each { _1.accept self }
  end
      obj.directive_locations.each { _1.accept self }
end

#handle_document(obj) ⇒ Object



4
5
6
# File 'lib/tinygql/visitors.rb', line 4

def handle_document obj
      obj.definitions.each { _1.accept self }
end

#handle_enum_type_definition(obj) ⇒ Object



164
165
166
167
168
169
170
171
# File 'lib/tinygql/visitors.rb', line 164

def handle_enum_type_definition obj
  if obj.directives
      obj.directives.each { _1.accept self }
  end
  if obj.enum_value_definition
      obj.enum_value_definition.each { _1.accept self }
  end
end

#handle_enum_value(obj) ⇒ Object



62
63
# File 'lib/tinygql/visitors.rb', line 62

def handle_enum_value obj
end

#handle_enum_value_definition(obj) ⇒ Object



158
159
160
161
162
163
# File 'lib/tinygql/visitors.rb', line 158

def handle_enum_value_definition obj
      obj.enum_value.accept self
  if obj.directives
      obj.directives.each { _1.accept self }
  end
end

#handle_executable_directive_location(obj) ⇒ Object



191
192
# File 'lib/tinygql/visitors.rb', line 191

def handle_executable_directive_location obj
end

#handle_field(obj) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
# File 'lib/tinygql/visitors.rb', line 38

def handle_field obj
  if obj.arguments
      obj.arguments.each { _1.accept self }
  end
  if obj.directives
      obj.directives.each { _1.accept self }
  end
  if obj.selection_set
      obj.selection_set.each { _1.accept self }
  end
end

#handle_field_definition(obj) ⇒ Object



108
109
110
111
112
113
114
115
116
# File 'lib/tinygql/visitors.rb', line 108

def handle_field_definition obj
  if obj.arguments_definition
      obj.arguments_definition.each { _1.accept self }
  end
      obj.type.accept self
  if obj.directives
      obj.directives.each { _1.accept self }
  end
end

#handle_float_value(obj) ⇒ Object



54
55
# File 'lib/tinygql/visitors.rb', line 54

def handle_float_value obj
end

#handle_fragment_definition(obj) ⇒ Object



90
91
92
93
94
95
96
97
# File 'lib/tinygql/visitors.rb', line 90

def handle_fragment_definition obj
      obj.fragment_name.accept self
      obj.type_condition.accept self
  if obj.directives
      obj.directives.each { _1.accept self }
  end
      obj.selection_set.each { _1.accept self }
end

#handle_fragment_spread(obj) ⇒ Object



84
85
86
87
88
89
# File 'lib/tinygql/visitors.rb', line 84

def handle_fragment_spread obj
      obj.fragment_name.accept self
  if obj.directives
      obj.directives.each { _1.accept self }
  end
end

#handle_inline_fragment(obj) ⇒ Object



75
76
77
78
79
80
81
82
83
# File 'lib/tinygql/visitors.rb', line 75

def handle_inline_fragment obj
  if obj.type_condition
      obj.type_condition.accept self
  end
  if obj.directives
      obj.directives.each { _1.accept self }
  end
      obj.selection_set.each { _1.accept self }
end

#handle_input_object_type_definition(obj) ⇒ Object



172
173
174
175
176
177
178
179
# File 'lib/tinygql/visitors.rb', line 172

def handle_input_object_type_definition obj
  if obj.directives
      obj.directives.each { _1.accept self }
  end
  if obj.input_fields_definition
      obj.input_fields_definition.each { _1.accept self }
  end
end

#handle_input_value_definition(obj) ⇒ Object



117
118
119
120
121
122
123
124
125
# File 'lib/tinygql/visitors.rb', line 117

def handle_input_value_definition obj
      obj.type.accept self
  if obj.default_value
      obj.default_value.accept self
  end
  if obj.directives
      obj.directives.each { _1.accept self }
  end
end

#handle_int_value(obj) ⇒ Object



52
53
# File 'lib/tinygql/visitors.rb', line 52

def handle_int_value obj
end

#handle_interface_type_definition(obj) ⇒ Object



137
138
139
140
141
142
143
144
# File 'lib/tinygql/visitors.rb', line 137

def handle_interface_type_definition obj
  if obj.directives
      obj.directives.each { _1.accept self }
  end
  if obj.fields_definition
      obj.fields_definition.each { _1.accept self }
  end
end

#handle_list_type(obj) ⇒ Object



23
24
25
# File 'lib/tinygql/visitors.rb', line 23

def handle_list_type obj
      obj.type.accept self
end

#handle_list_value(obj) ⇒ Object



64
65
# File 'lib/tinygql/visitors.rb', line 64

def handle_list_value obj
end

#handle_named_type(obj) ⇒ Object



18
19
# File 'lib/tinygql/visitors.rb', line 18

def handle_named_type obj
end

#handle_not_null_type(obj) ⇒ Object



20
21
22
# File 'lib/tinygql/visitors.rb', line 20

def handle_not_null_type obj
      obj.type.accept self
end

#handle_null_value(obj) ⇒ Object



60
61
# File 'lib/tinygql/visitors.rb', line 60

def handle_null_value obj
end

#handle_object_field(obj) ⇒ Object



49
50
51
# File 'lib/tinygql/visitors.rb', line 49

def handle_object_field obj
      obj.value.accept self
end

#handle_object_type_definition(obj) ⇒ Object



126
127
128
129
130
131
132
133
134
135
136
# File 'lib/tinygql/visitors.rb', line 126

def handle_object_type_definition obj
  if obj.implements_interfaces
      obj.implements_interfaces.each { _1.accept self }
  end
  if obj.directives
      obj.directives.each { _1.accept self }
  end
  if obj.fields_definition
      obj.fields_definition.each { _1.accept self }
  end
end

#handle_object_type_extension(obj) ⇒ Object



180
181
182
183
184
185
186
187
188
189
190
# File 'lib/tinygql/visitors.rb', line 180

def handle_object_type_extension obj
  if obj.implements_interfaces
      obj.implements_interfaces.each { _1.accept self }
  end
  if obj.directives
      obj.directives.each { _1.accept self }
  end
  if obj.fields_definition
      obj.fields_definition.each { _1.accept self }
  end
end

#handle_object_value(obj) ⇒ Object



66
67
68
# File 'lib/tinygql/visitors.rb', line 66

def handle_object_value obj
      obj.values.each { _1.accept self }
end

#handle_operation_definition(obj) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/tinygql/visitors.rb', line 7

def handle_operation_definition obj
  if obj.variable_definitions
      obj.variable_definitions.each { _1.accept self }
  end
  if obj.directives
      obj.directives.each { _1.accept self }
  end
      obj.selection_set.each { _1.accept self }
end

#handle_root_operation_type_definition(obj) ⇒ Object



98
99
100
101
# File 'lib/tinygql/visitors.rb', line 98

def handle_root_operation_type_definition obj
      obj.operation_type.accept self
      obj.named_type.accept self
end

#handle_scalar_type_definition(obj) ⇒ Object



153
154
155
156
157
# File 'lib/tinygql/visitors.rb', line 153

def handle_scalar_type_definition obj
  if obj.directives
      obj.directives.each { _1.accept self }
  end
end

#handle_schema_definition(obj) ⇒ Object



102
103
104
105
106
107
# File 'lib/tinygql/visitors.rb', line 102

def handle_schema_definition obj
  if obj.directives
      obj.directives.each { _1.accept self }
  end
      obj.root_operation_definitions.each { _1.accept self }
end

#handle_string_value(obj) ⇒ Object



56
57
# File 'lib/tinygql/visitors.rb', line 56

def handle_string_value obj
end

#handle_type_condition(obj) ⇒ Object



72
73
74
# File 'lib/tinygql/visitors.rb', line 72

def handle_type_condition obj
      obj.named_type.accept self
end

#handle_type_system_directive_location(obj) ⇒ Object



193
194
# File 'lib/tinygql/visitors.rb', line 193

def handle_type_system_directive_location obj
end

#handle_union_type_definition(obj) ⇒ Object



145
146
147
148
149
150
151
152
# File 'lib/tinygql/visitors.rb', line 145

def handle_union_type_definition obj
  if obj.directives
      obj.directives.each { _1.accept self }
  end
  if obj.union_member_types
      obj.union_member_types.each { _1.accept self }
  end
end

#handle_value(obj) ⇒ Object



33
34
# File 'lib/tinygql/visitors.rb', line 33

def handle_value obj
end

#handle_variable(obj) ⇒ Object



16
17
# File 'lib/tinygql/visitors.rb', line 16

def handle_variable obj
end

#handle_variable_definition(obj) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/tinygql/visitors.rb', line 26

def handle_variable_definition obj
      obj.variable.accept self
      obj.type.accept self
  if obj.default_value
      obj.default_value.accept self
  end
end