class GraphQL::Query::InputValidationResult

Attributes

problems[RW]

Public Instance Methods

add_problem(explanation, path = nil) click to toggle source
# File lib/graphql/query/input_validation_result.rb, line 10
def add_problem(explanation, path = nil)
  @problems ||= []
  @problems.push({ "path" => path || [], "explanation" => explanation })
end
merge_result!(path, inner_result) click to toggle source
# File lib/graphql/query/input_validation_result.rb, line 15
def merge_result!(path, inner_result)
  return if inner_result.valid?

  inner_result.problems.each do |p|
    item_path = [path, *p["path"]]
    add_problem(p["explanation"], item_path)
  end
end
valid?() click to toggle source
# File lib/graphql/query/input_validation_result.rb, line 6
def valid?
  @problems.nil?
end