Class: GraphQL::DSL::FragmentSpread

Inherits:
Node
  • Object
show all
Defined in:
lib/graphql/dsl/nodes/fragment_spread.rb

Overview

Fragment spread GraphQL node

Instance Attribute Summary collapse

Attributes inherited from Node

#__name, #__nodes

Instance Method Summary collapse

Methods inherited from Node

#to_gql

Constructor Details

#initialize(name, directives = []) ⇒ FragmentSpread

Create fragment spread

Parameters:

  • name (String, Symbol)

    fragment name

  • directives (Array<Hash, Array, Directive>) (defaults to: [])

    list of directives



17
18
19
20
21
# File 'lib/graphql/dsl/nodes/fragment_spread.rb', line 17

def initialize(name, directives = [])
  @__directives = directives.map { |directive| Directive.from(directive) }

  super(name)
end

Instance Attribute Details

#__directivesArray<Directive> (readonly)

Returns list of directives.

Returns:



10
11
12
# File 'lib/graphql/dsl/nodes/fragment_spread.rb', line 10

def __directives
  @__directives
end