Class: GraphQL::Language::Nodes::FragmentDefinition

Inherits:
AbstractNode
  • Object
show all
Defined in:
lib/graphql/language/nodes.rb

Overview

A reusable fragment, defined at document-level.

Constant Summary

Constants inherited from AbstractNode

AbstractNode::NO_CHILDREN

Instance Attribute Summary collapse

Attributes inherited from AbstractNode

#col, #filename, #line

Instance Method Summary collapse

Methods inherited from AbstractNode

#==, #children, #children_method_name, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

Constructor Details

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

Instance Attribute Details

#nameString

Returns the identifier for this fragment, which may be applied with ...#{name}.

Returns:

  • (String)

    the identifier for this fragment, which may be applied with ...#{name}



# File 'lib/graphql/language/nodes.rb', line 385

#typeString

Returns the type condition for this fragment (name of type which it may apply to).

Returns:

  • (String)

    the type condition for this fragment (name of type which it may apply to)



390
391
392
393
394
395
# File 'lib/graphql/language/nodes.rb', line 390

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

Instance Method Details

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



390
391
392
393
394
395
# File 'lib/graphql/language/nodes.rb', line 390

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