class GraphQL::Language::Nodes::InputObjectTypeDefinition
Attributes
directives
[R]
Array[Directive]
fields
[R]
Array[InputValueDefinition]
Public Class Methods
# File lib/graphql/language/nodes.rb, line 2377 def self.from_a(filename, line, col, name, description, directives, fields, comment: nil) # rubocop:disable Metrics/ParameterLists self.new(filename: filename, line: line, col: col, name: name, description: description, comment: comment, directives: directives, fields: fields) end
(?name: untyped, ?description: untyped, ?comment: untyped, ?directives: Array[Directive], ?fields: Array[InputValueDefinition], ?line: Integer?, ?col: Integer?, ?pos: Integer?, ?filename: String?, ?source: untyped, ?definition_pos: Integer?) → void
Source
# File lib/graphql/language/nodes.rb, line 2363 def initialize(name: 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 @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 2348 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 2381 def marshal_dump [ line, col, # use methods here to force them to be calculated @filename, @name, @description, @directives, @fields, ] end
Source
# File lib/graphql/language/nodes.rb, line 2392 def marshal_load(values) @line, @col, @filename, @name, @description, @directives, @fields = values end
# File lib/graphql/language/nodes.rb, line 2340 def merge_directive(**node_opts) merge(directives: directives + [GraphQL::Language::Nodes::Directive.new(**node_opts)]) end
Source
# File lib/graphql/language/nodes.rb, line 2344 def merge_field(**node_opts) merge(fields: fields + [GraphQL::Language::Nodes::InputValueDefinition.new(**node_opts)]) end
Source
# File lib/graphql/language/nodes.rb, line 2331 def scalars @scalars ||= [@name].freeze end
Source
# File lib/graphql/language/nodes.rb, line 2320 def visit_method :on_input_object_type_definition end