Class: GraphQL::Language::Nodes::OperationDefinition

Inherits:
AbstractNode
  • Object
show all
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

Attributes inherited from AbstractNode

#col, #line

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

#directivesObject

Returns the value of attribute directives


284
285
286
# File 'lib/graphql/language/nodes.rb', line 284

def directives
  @directives
end

#nameString?


300
301
302
# File 'lib/graphql/language/nodes.rb', line 300

def name
  @name
end

#operation_typeString?


294
295
296
# File 'lib/graphql/language/nodes.rb', line 294

def operation_type
  @operation_type
end

#selectionsArray<Field>


291
292
293
# File 'lib/graphql/language/nodes.rb', line 291

def selections
  @selections
end

#variablesArray<VariableDefinition>


288
289
290
# File 'lib/graphql/language/nodes.rb', line 288

def variables
  @variables
end

Instance Method Details

#initialize_node(operation_type: nil, name: nil, variables: [], directives: [], selections: []) ⇒ Object


300
301
302
303
304
305
306
# File 'lib/graphql/language/nodes.rb', line 300

def initialize_node(operation_type: nil, name: nil, variables: [], directives: [], selections: [])
  @operation_type = operation_type
  @name = name
  @variables = variables
  @directives = directives
  @selections = selections
end