class GraphQL::Language::Nodes::InlineFragment
An unnamed fragment, defined directly in the query with ... { }
Attributes
directives
[R]
Array[Directive]
selections
[R]
Array[Field | FragmentSpread | InlineFragment]
Public Class Methods
# File lib/graphql/language/nodes.rb, line 806 def self.from_a(filename, line, col, type, directives, selections, comment: nil) self.new(filename: filename, line: line, col: col, type: type, directives: directives, selections: selections) end
(?type: untyped, ?directives: Array[Directive], ?selections: Array[Field | FragmentSpread | InlineFragment], ?line: Integer?, ?col: Integer?, ?pos: Integer?, ?filename: String?, ?source: untyped) → void
Source
# File lib/graphql/language/nodes.rb, line 795 def initialize(type: nil, directives: NO_CHILDREN, selections: NO_CHILDREN, line: nil, col: nil, pos: nil, filename: nil, source: nil) @line = line @col = col @pos = pos @filename = filename @source = source @type = type @directives = directives.freeze @selections = selections.freeze end
Public Instance Methods
Source
# File lib/graphql/language/nodes.rb, line 780 def children @children ||= begin if !@directives.empty? || !@selections.empty? new_children = [] new_children.concat(@directives) new_children.concat(@selections) new_children.freeze new_children else NO_CHILDREN end end end
Source
# File lib/graphql/language/nodes.rb, line 810 def marshal_dump [ line, col, # use methods here to force them to be calculated @filename, @type, @directives, @selections, ] end
Source
# File lib/graphql/language/nodes.rb, line 820 def marshal_load(values) @line, @col, @filename, @type, @directives, @selections = values end
# File lib/graphql/language/nodes.rb, line 772 def merge_directive(**node_opts) merge(directives: directives + [GraphQL::Language::Nodes::Directive.new(**node_opts)]) end
# File lib/graphql/language/nodes.rb, line 776 def merge_selection(**node_opts) merge(selections: selections + [GraphQL::Language::Nodes::Field.new(**node_opts)]) end
Source
# File lib/graphql/language/nodes.rb, line 763 def scalars @scalars ||= [@type].freeze end
Source
# File lib/graphql/language/nodes.rb, line 753 def visit_method :on_inline_fragment end