class GraphQL::Language::Nodes::InterfaceTypeExtension
Attributes
directives
[R]
Array[Directive]
fields
[R]
Array[FieldDefinition]
interfaces
[R]
Array[TypeName]
Public Class Methods
# File lib/graphql/language/nodes.rb, line 1943 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: Array[TypeName], ?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 1931 def initialize(name: nil, interfaces: NO_CHILDREN, 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.freeze @directives = directives.freeze @fields = fields.freeze end
Public Instance Methods
Source
# File lib/graphql/language/nodes.rb, line 1915 def children @children ||= begin if !@interfaces.empty? || !@directives.empty? || !@fields.empty? new_children = [] new_children.concat(@interfaces) 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 1947 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 1958 def marshal_load(values) @line, @col, @filename, @name, @interfaces, @directives, @fields = values end
# File lib/graphql/language/nodes.rb, line 1907 def merge_directive(**node_opts) merge(directives: directives + [GraphQL::Language::Nodes::Directive.new(**node_opts)]) end
Source
# File lib/graphql/language/nodes.rb, line 1911 def merge_field(**node_opts) merge(fields: fields + [GraphQL::Language::Nodes::FieldDefinition.new(**node_opts)]) end
# File lib/graphql/language/nodes.rb, line 1903 def merge_interface(**node_opts) merge(interfaces: interfaces + [GraphQL::Language::Nodes::TypeName.new(**node_opts)]) end
Source
# File lib/graphql/language/nodes.rb, line 1892 def scalars @scalars ||= [@name].freeze end
Source
# File lib/graphql/language/nodes.rb, line 1885 def visit_method :on_interface_type_extension end