Sha256: a8f8099808c04107f9ec3a1d5814cc636e960b69aa250f3d884862f5d42f1c59
Contents?: true
Size: 592 Bytes
Versions: 110
Compression:
Stored size: 592 Bytes
Contents
# frozen_string_literal: true module GraphQL class Query class InputValidationResult attr_accessor :problems def valid? @problems.nil? end def add_problem(explanation, path = nil) @problems ||= [] @problems.push({ "path" => path || [], "explanation" => explanation }) end 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 end end end
Version data entries
110 entries across 110 versions & 1 rubygems