class GraphQL::Execution::VariableValues
Validates and coerces a query’s provided variables in a single pass.
Reading methods (#[], #fetch, #to_h, …) return the values as provided by the client (or the default value from the query string), so that existing callers keep working. Coerced values are available from #coerced_value for the runtime.
Constants
- INVALID_OBJECT_MESSAGE
- UNEXPECTED_NULL_MESSAGE
Attributes
Returns
-
Array<GraphQL::Query::VariableValidationError>— Any errors encountered when coercing the provided variables
Public Class Methods
# File lib/graphql/execution/variable_values.rb, line 20 def initialize(query, ast_variables, provided_variables) @query = query @context = query.context @types = query.types @schema = query.schema @provided_variables = deep_stringify(provided_variables) @errors = [] @storage = {} @coerced_values = {} build_values(ast_variables) end