Sha256: ece3a6a2e8c2ea6dd042163477f8e525bff11431f4e530603f0bc86c4e065f63
Contents?: true
Size: 586 Bytes
Versions: 9
Compression:
Stored size: 586 Bytes
Contents
class GraphQL::StaticValidation::RequiredArgumentsArePresent < GraphQL::StaticValidation::ArgumentsValidator def validate_node(node, defn, context) present_argument_names = node.arguments.map(&:name) required_argument_names = defn.arguments.values .select { |a| a.type.kind.non_null? } .map(&:name) missing_names = required_argument_names - present_argument_names if missing_names.any? context.errors << message("#{node.class.name.split("::").last} '#{node.name}' is missing required arguments: #{missing_names.join(", ")}", node) end end end
Version data entries
9 entries across 9 versions & 1 rubygems