Skip to content

Commit 165a3d1

Browse files
committed
Improve error message
1 parent 79bd619 commit 165a3d1

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/graphql/schema/validator/required_validator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def validate(_object, context, value)
6666
raise GraphQL::Error, <<~ERR
6767
#{@validated.path} validates `required: ...` but all required arguments were hidden.
6868
69-
Update your schema definition to allow the client to see some fields or add `required: { ..., allow_all_hidden: true }`
69+
Update your schema definition to allow the client to see some fields or skip validation by adding `required: { ..., allow_all_hidden: true }`
7070
ERR
7171
end
7272
end

spec/graphql/schema/validator/required_validator_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class Query < GraphQL::Schema::Object
153153
RequiredHiddenSchema.execute("{ twoArgumentsError }")
154154
end
155155

156-
expected_message = "Query.twoArgumentsError validates `required: ...` but all required arguments were hidden.\n\nUpdate your schema definition to allow the client to see some fields or add `required: { ..., allow_all_hidden: true }`\n"
156+
expected_message = "Query.twoArgumentsError validates `required: ...` but all required arguments were hidden.\n\nUpdate your schema definition to allow the client to see some fields or skip validation by adding `required: { ..., allow_all_hidden: true }`\n"
157157
assert_equal expected_message, err.message
158158

159159
result = RequiredHiddenSchema.execute("{ oneArgument }")

0 commit comments

Comments
 (0)