You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{
"errors": [
{
"message": "RuntimeError: Failed to implement User.email, tried:\n\n - `Types::Output::User#email`, which did not exist\n - `Array#email`, which did not exist\n - Looking up hash key `:email` or `\"email\"` on `[#<GraphQL::ExecutionError: Error!>]`, but it wasn't a Hash\n\n To implement this field, define one of the methods above (and check for typos)\n",
"type": "runtime"
}
]
}
THIS IS THE ISSUE ^^^
It seems that the GraphQL error results are being treated by the gem as if they're a valid result.
However, using the old pre 1.8 DSL for the output type above:
It's not entirely clear to me what instrumentation is and why the above doesn't affect types and fields defined using the pre 1.8 DSL, but I'll link a PR with a fix that seems to address this.
The text was updated successfully, but these errors were encountered:
I don't plan to work on it anymore because it doesn't seem required by the spec. In fact, the spec seems to assume that a field with either return a value or raise an error; there's no mention of fields returning multiple errors.
However, if you want to implement it, I'll accept your PR!
Given the following mutation:
and the following output type defined using the new class based DSL (post 1.8):
and running the following query
Produces the following error:
THIS IS THE ISSUE ^^^
It seems that the GraphQL error results are being treated by the gem as if they're a valid result.
However, using the old pre 1.8 DSL for the output type above:
Produces the expected result:
This seems to be related to what's happening in this line in the ProxiedResolve class in member/instrumentation.rb:
graphql-ruby/lib/graphql/schema/member/instrumentation.rb
Line 81 in 85ecd80
It's not entirely clear to me what instrumentation is and why the above doesn't affect types and fields defined using the pre 1.8 DSL, but I'll link a PR with a fix that seems to address this.
The text was updated successfully, but these errors were encountered: