class GraphQL::Language::Nodes::VariableDefinition
An operation-level query variable
Attributes
children
[R]
Array[Directive]
default_value
[R]
untyped
Returns
-
String, Integer, Float, Boolean, Array, NullValue— A Ruby value to use if no other value is provided
directives
[R]
Array[Directive]
Returns
-
TypeName, NonNullType, ListType— The expected type of this value
Public Class Methods
# File lib/graphql/language/nodes.rb, line 981 def self.from_a(filename, line, col, name, type, default_value, directives, comment: nil) # rubocop:disable Metrics/ParameterLists self.new(filename: filename, line: line, col: col, name: name, type: type, default_value: default_value, directives: directives) end
(?name: untyped, ?type: untyped, ?default_value: untyped, ?directives: Array[Directive], ?line: Integer?, ?col: Integer?, ?pos: Integer?, ?filename: String?, ?source: untyped, ?definition_pos: Integer?) → void
Source
# File lib/graphql/language/nodes.rb, line 968 def initialize(name: nil, type: nil, default_value: nil, directives: 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 @type = type @default_value = default_value @directives = directives.freeze @definition_pos = definition_pos end
Public Instance Methods
Source
# File lib/graphql/language/nodes.rb, line 985 def marshal_dump [ line, col, # use methods here to force them to be calculated @filename, @name, @type, @default_value, @directives, ] end
Source
# File lib/graphql/language/nodes.rb, line 996 def marshal_load(values) @line, @col, @filename, @name, @type, @default_value, @directives = values end
# File lib/graphql/language/nodes.rb, line 961 def merge_directive(**node_opts) merge(directives: directives + [GraphQL::Language::Nodes::Directive.new(**node_opts)]) end
Source
# File lib/graphql/language/nodes.rb, line 954 def scalars @scalars ||= [@name, @type, @default_value].freeze end
Source
# File lib/graphql/language/nodes.rb, line 932 def visit_method :on_variable_definition end