class GraphQL::StaticValidation::LiteralValidator
Test whether ast_value is a valid input for type
Public Class Methods
Source
# File lib/graphql/static_validation/literal_validator.rb, line 7 def initialize(context:) @context = context @types = context.types @invalid_response = GraphQL::Query::InputValidationResult.new(valid: false, problems: []) @valid_response = GraphQL::Query::InputValidationResult.new(valid: true, problems: []) end
Public Instance Methods
Source
# File lib/graphql/static_validation/literal_validator.rb, line 14 def validate(ast_value, type) catch(:invalid) do recursively_validate(ast_value, type) end end