Class: GraphQL::Language::Nodes::OperationDefinition
- Inherits:
-
AbstractNode
- Object
- AbstractNode
- GraphQL::Language::Nodes::OperationDefinition
- Defined in:
- lib/graphql/language/nodes.rb
Overview
A query, mutation or subscription. May be anonymous or named. May be explicitly typed (eg ‘mutation { … }`) or implicitly a query (eg `{ … }`).
Instance Attribute Summary collapse
-
#directives ⇒ Object
Returns the value of attribute directives.
-
#name ⇒ String?
The name for this operation, or ‘nil` if unnamed.
-
#operation_type ⇒ String?
The root type for this operation, or ‘nil` for implicit `“query”`.
-
#selections ⇒ Array<Field>
Root-level fields on this operation.
-
#variables ⇒ Array<VariableDefinition>
Variable definitions for this operation.
Attributes inherited from AbstractNode
Instance Method Summary collapse
Methods inherited from AbstractNode
child_attributes, #children, #eql?, inherited, #initialize, #position, scalar_attributes, #scalars, #to_query_string
Constructor Details
This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode
Instance Attribute Details
#directives ⇒ Object
Returns the value of attribute directives.
274 275 276 |
# File 'lib/graphql/language/nodes.rb', line 274 def directives @directives end |
#name ⇒ String?
Returns The name for this operation, or ‘nil` if unnamed.
290 291 292 |
# File 'lib/graphql/language/nodes.rb', line 290 def name @name end |
#operation_type ⇒ String?
Returns The root type for this operation, or ‘nil` for implicit `“query”`.
284 285 286 |
# File 'lib/graphql/language/nodes.rb', line 284 def operation_type @operation_type end |
#selections ⇒ Array<Field>
Returns Root-level fields on this operation.
281 282 283 |
# File 'lib/graphql/language/nodes.rb', line 281 def selections @selections end |
#variables ⇒ Array<VariableDefinition>
Returns Variable definitions for this operation.
278 279 280 |
# File 'lib/graphql/language/nodes.rb', line 278 def variables @variables end |
Instance Method Details
#initialize_node(operation_type: nil, name: nil, variables: [], directives: [], selections: []) ⇒ Object
290 291 292 293 294 295 296 |
# File 'lib/graphql/language/nodes.rb', line 290 def initialize_node(operation_type: nil, name: nil, variables: [], directives: [], selections: []) @operation_type = operation_type @name = name @variables = variables @directives = directives @selections = selections end |