class GraphQL::Language::Nodes::ObjectTypeDefinition
Attributes
directives
[R]
Array[Directive]
fields
[R]
Array[FieldDefinition]
interfaces
[R]
Array[TypeName]
Public Class Methods
Source
# File lib/graphql/language/nodes.rb, line 1683 def self.from_a(filename, line, col, name, interfaces, description, directives, fields, comment: nil) # rubocop:disable Metrics/ParameterLists self.new(filename: filename, line: line, col: col, name: name, interfaces: interfaces, description: description, comment: comment, directives: directives, fields: fields) end
(?name: untyped, ?interfaces: untyped, ?description: untyped, ?comment: untyped, ?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 1668 def initialize(name: nil, interfaces: nil, description: nil, comment: nil, 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 @interfaces = interfaces @description = description && -description @comment = comment @directives = directives.freeze @fields = fields.freeze @definition_pos = definition_pos end
Public Instance Methods
Source
# File lib/graphql/language/nodes.rb, line 1653 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 1687 def marshal_dump [ line, col, # use methods here to force them to be calculated @filename, @name, @interfaces, @description, @directives, @fields, ] end
Source
# File lib/graphql/language/nodes.rb, line 1699 def marshal_load(values) @line, @col, @filename, @name, @interfaces, @description, @directives, @fields = values end
# File lib/graphql/language/nodes.rb, line 1645 def merge_directive(**node_opts) merge(directives: directives + [GraphQL::Language::Nodes::Directive.new(**node_opts)]) end
Source
# File lib/graphql/language/nodes.rb, line 1649 def merge_field(**node_opts) merge(fields: fields + [GraphQL::Language::Nodes::FieldDefinition.new(**node_opts)]) end
Source
# File lib/graphql/language/nodes.rb, line 1636 def scalars @scalars ||= [@name, @interfaces].freeze end
Source
# File lib/graphql/language/nodes.rb, line 1623 def visit_method :on_object_type_definition end