class GraphQL::Language::Nodes::InterfaceTypeDefinition
Attributes
directives
[R]
Array[Directive]
fields
[R]
Array[FieldDefinition]
interfaces
[R]
Array[TypeName]
Public Class Methods
Source
# File lib/graphql/language/nodes.rb, line 1856 def self.from_a(filename, line, col, name, description, interfaces, directives, fields, comment: nil) # rubocop:disable Metrics/ParameterLists self.new(filename: filename, line: line, col: col, name: name, description: description, comment: comment, interfaces: interfaces, directives: directives, fields: fields) end
(?name: untyped, ?description: untyped, ?comment: untyped, ?interfaces: Array[TypeName], ?directives: Array[Directive], ?fields: Array[FieldDefinition], ?line: Integer?, ?col: Integer?, ?pos: Integer?, ?filename: String?, ?source: untyped, ?definition_pos: Integer?) → void
Source
# File lib/graphql/language/nodes.rb, line 1841 def initialize(name: nil, description: nil, comment: nil, interfaces: NO_CHILDREN, directives: NO_CHILDREN, fields: NO_CHILDREN, line: nil, col: nil, pos: nil, filename: nil, source: nil, definition_pos: nil) @line = line @col = col @pos = pos @filename = filename @source = source @name = name @description = description && -description @comment = comment @interfaces = interfaces.freeze @directives = directives.freeze @fields = fields.freeze @definition_pos = definition_pos end
Public Instance Methods
Source
# File lib/graphql/language/nodes.rb, line 1825 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 1860 def marshal_dump [ line, col, # use methods here to force them to be calculated @filename, @name, @description, @interfaces, @directives, @fields, ] end
Source
# File lib/graphql/language/nodes.rb, line 1872 def marshal_load(values) @line, @col, @filename, @name, @description, @interfaces, @directives, @fields = values end
# File lib/graphql/language/nodes.rb, line 1817 def merge_directive(**node_opts) merge(directives: directives + [GraphQL::Language::Nodes::Directive.new(**node_opts)]) end
Source
# File lib/graphql/language/nodes.rb, line 1821 def merge_field(**node_opts) merge(fields: fields + [GraphQL::Language::Nodes::FieldDefinition.new(**node_opts)]) end
# File lib/graphql/language/nodes.rb, line 1813 def merge_interface(**node_opts) merge(interfaces: interfaces + [GraphQL::Language::Nodes::TypeName.new(**node_opts)]) end
Source
# File lib/graphql/language/nodes.rb, line 1802 def scalars @scalars ||= [@name].freeze end
Source
# File lib/graphql/language/nodes.rb, line 1791 def visit_method :on_interface_type_definition end