Class: GraphQL::Language::Nodes::SchemaExtension
- Inherits:
-
AbstractNode
- Object
- AbstractNode
- GraphQL::Language::Nodes::SchemaExtension
- Defined in:
- lib/graphql/language/nodes.rb
Constant Summary
Constants inherited from AbstractNode
Instance Attribute Summary collapse
-
#directives ⇒ Object
(also: #children)
readonly
: Array.
-
#mutation ⇒ Object
readonly
: String?.
-
#query ⇒ Object
readonly
: String?.
-
#subscription ⇒ Object
readonly
: String?.
Attributes inherited from AbstractNode
Class Method Summary collapse
-
.from_a(filename, line, col, query, mutation, subscription, directives, comment: nil) ⇒ Object
rubocop:disable Metrics/ParameterLists.
Instance Method Summary collapse
-
#initialize(query: nil, mutation: nil, subscription: nil, directives: NO_CHILDREN, line: nil, col: nil, pos: nil, filename: nil, source: nil) ⇒ SchemaExtension
constructor
: (?query: untyped, ?mutation: untyped, ?subscription: untyped, ?directives: Array, ?line: Integer?, ?col: Integer?, ?pos: Integer?, ?filename: String?, ?source: untyped) -> void.
- #marshal_dump ⇒ Object
- #marshal_load(values) ⇒ Object
- #merge_directive(**node_opts) ⇒ Object
- #scalars ⇒ Object
- #visit_method ⇒ Object
Methods inherited from AbstractNode
#==, #children_method_name, children_of_type, #col, #definition_line, #delete_child, inherited, #initialize_copy, #line, #merge, #position, #replace_child, #to_query_string
Constructor Details
#initialize(query: nil, mutation: nil, subscription: nil, directives: NO_CHILDREN, line: nil, col: nil, pos: nil, filename: nil, source: nil) ⇒ SchemaExtension
: (?query: untyped, ?mutation: untyped, ?subscription: untyped, ?directives: Array, ?line: Integer?, ?col: Integer?, ?pos: Integer?, ?filename: String?, ?source: untyped) -> void
1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 |
# File 'lib/graphql/language/nodes.rb', line 1299 def initialize(query: nil, mutation: nil, subscription: nil, directives: NO_CHILDREN, line: nil, col: nil, pos: nil, filename: nil, source: nil) @line = line @col = col @pos = pos @filename = filename @source = source @query = query @mutation = mutation @subscription = subscription @directives = directives.freeze end |
Instance Attribute Details
#directives ⇒ Object (readonly) Also known as: children
: Array
1290 1291 1292 |
# File 'lib/graphql/language/nodes.rb', line 1290 def directives @directives end |
#mutation ⇒ Object (readonly)
: String?
1281 1282 1283 |
# File 'lib/graphql/language/nodes.rb', line 1281 def mutation @mutation end |
#query ⇒ Object (readonly)
: String?
1279 1280 1281 |
# File 'lib/graphql/language/nodes.rb', line 1279 def query @query end |
#subscription ⇒ Object (readonly)
: String?
1283 1284 1285 |
# File 'lib/graphql/language/nodes.rb', line 1283 def subscription @subscription end |
Class Method Details
.from_a(filename, line, col, query, mutation, subscription, directives, comment: nil) ⇒ Object
rubocop:disable Metrics/ParameterLists
1311 1312 1313 |
# File 'lib/graphql/language/nodes.rb', line 1311 def self.from_a(filename, line, col, query, mutation, subscription, directives, comment: nil) # rubocop:disable Metrics/ParameterLists self.new(filename: filename, line: line, col: col, query: query, mutation: mutation, subscription: subscription, directives: directives) end |
Instance Method Details
#marshal_dump ⇒ Object
1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 |
# File 'lib/graphql/language/nodes.rb', line 1315 def marshal_dump [ line, col, # use methods here to force them to be calculated @filename, @query, @mutation, @subscription, @directives, ] end |
#marshal_load(values) ⇒ Object
1326 1327 1328 |
# File 'lib/graphql/language/nodes.rb', line 1326 def marshal_load(values) @line, @col, @filename, @query, @mutation, @subscription, @directives = values end |
#merge_directive(**node_opts) ⇒ Object
1292 1293 1294 |
# File 'lib/graphql/language/nodes.rb', line 1292 def merge_directive(**node_opts) merge(directives: directives + [GraphQL::Language::Nodes::Directive.new(**node_opts)]) end |
#scalars ⇒ Object
1285 1286 1287 |
# File 'lib/graphql/language/nodes.rb', line 1285 def scalars @scalars ||= [@query, @mutation, @subscription].freeze end |
#visit_method ⇒ Object
1274 1275 1276 |
# File 'lib/graphql/language/nodes.rb', line 1274 def visit_method :on_schema_extension end |