Skip to content

Commit e498ddc

Browse files
committed
oops, update tests for improved error message
1 parent 29058d4 commit e498ddc

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

spec/graphql/query/serial_execution/value_resolution_spec.rb

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,7 @@
8686

8787
it "raises an error" do
8888
err = assert_raises(GraphQL::UnresolvedTypeError) { result }
89-
expected_message = "The value from \"resolvesToNilInterface\" on \"Query\" could not be resolved to \"SomeInterface\". " \
90-
"(Received: `nil`, Expected: [SomeObject]) " \
91-
"Make sure you have defined a `resolve_type` proc on your schema and that value `1337` " \
92-
"gets resolved to a valid type."
89+
expected_message = "The value from \"resolvesToNilInterface\" on \"Query\" could not be resolved to \"SomeInterface\". (Received: `nil`, Expected: [SomeObject]) Make sure you have defined a `resolve_type` proc on your schema and that value `1337` gets resolved to a valid type. You may need to add your type to `orphan_types` if it implements an interface but isn't a return type of any other field."
9390
assert_equal expected_message, err.message
9491
end
9592
end
@@ -103,10 +100,7 @@
103100

104101
it "raises an error" do
105102
err = assert_raises(GraphQL::UnresolvedTypeError) { result }
106-
expected_message = "The value from \"resolvesToWrongTypeInterface\" on \"Query\" could not be resolved to \"SomeInterface\". " \
107-
"(Received: `OtherObject`, Expected: [SomeObject]) " \
108-
"Make sure you have defined a `resolve_type` proc on your schema and that value `:something` " \
109-
"gets resolved to a valid type."
103+
expected_message = "The value from \"resolvesToWrongTypeInterface\" on \"Query\" could not be resolved to \"SomeInterface\". (Received: `OtherObject`, Expected: [SomeObject]) Make sure you have defined a `resolve_type` proc on your schema and that value `:something` gets resolved to a valid type. You may need to add your type to `orphan_types` if it implements an interface but isn't a return type of any other field."
110104
assert_equal expected_message, err.message
111105
end
112106
end

0 commit comments

Comments
 (0)