class GraphQL::Language::Nodes::ObjectTypeExtension
Attributes
directives
[R]
Array[Directive]
fields
[R]
Array[FieldDefinition]
interfaces
[R]
Array[TypeName]
Public Class Methods
# File lib/graphql/language/nodes.rb, line 1764 def self.from_a(filename, line, col, name, interfaces, directives, fields, comment: nil) # rubocop:disable Metrics/ParameterLists self.new(filename: filename, line: line, col: col, name: name, interfaces: interfaces, directives: directives, fields: fields) end
(?name: untyped, ?interfaces: untyped, ?directives: Array[Directive], ?fields: Array[FieldDefinition], ?line: Integer?, ?col: Integer?, ?pos: Integer?, ?filename: String?, ?source: untyped) → void
Source
# File lib/graphql/language/nodes.rb, line 1752 def initialize(name: nil, interfaces: nil, directives: NO_CHILDREN, fields: NO_CHILDREN, line: nil, col: nil, pos: nil, filename: nil, source: nil) @line = line @col = col @pos = pos @filename = filename @source = source @name = name @interfaces = interfaces @directives = directives.freeze @fields = fields.freeze end
Public Instance Methods
Source
# File lib/graphql/language/nodes.rb, line 1737 def children @children ||= begin if !@directives.empty? || !@fields.empty? new_children = [] new_children.concat(@directives) new_children.concat(@fields) new_children.freeze new_children else NO_CHILDREN end end end
Source
# File lib/graphql/language/nodes.rb, line 1768 def marshal_dump [ line, col, # use methods here to force them to be calculated @filename, @name, @interfaces, @directives, @fields, ] end
Source
# File lib/graphql/language/nodes.rb, line 1779 def marshal_load(values) @line, @col, @filename, @name, @interfaces, @directives, @fields = values end
# File lib/graphql/language/nodes.rb, line 1729 def merge_directive(**node_opts) merge(directives: directives + [GraphQL::Language::Nodes::Directive.new(**node_opts)]) end
Source
# File lib/graphql/language/nodes.rb, line 1733 def merge_field(**node_opts) merge(fields: fields + [GraphQL::Language::Nodes::FieldDefinition.new(**node_opts)]) end
Source
# File lib/graphql/language/nodes.rb, line 1720 def scalars @scalars ||= [@name, @interfaces].freeze end
Source
# File lib/graphql/language/nodes.rb, line 1711 def visit_method :on_object_type_extension end