Class: GraphQL::Language::Nodes::InlineFragment

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

Overview

An unnamed fragment, defined directly in the query with ... { }

Instance Attribute Summary collapse

Attributes inherited from AbstractNode

#col, #filename, #line

Instance Method Summary collapse

Methods inherited from AbstractNode

#eql?, #initialize, #position, #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



256
257
258
# File 'lib/graphql/language/nodes.rb', line 256

def directives
  @directives
end

#selectionsObject

Returns the value of attribute selections



256
257
258
# File 'lib/graphql/language/nodes.rb', line 256

def selections
  @selections
end

#typeString?

Returns Name of the type this fragment applies to, or nil if this fragment applies to any type

Returns:

  • (String, nil)

    Name of the type this fragment applies to, or nil if this fragment applies to any type



261
262
263
# File 'lib/graphql/language/nodes.rb', line 261

def type
  @type
end

Instance Method Details

#childrenObject



267
268
269
# File 'lib/graphql/language/nodes.rb', line 267

def children
  directives + selections
end

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



261
262
263
264
265
# File 'lib/graphql/language/nodes.rb', line 261

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

#scalarsObject



271
272
273
# File 'lib/graphql/language/nodes.rb', line 271

def scalars
  [type]
end