-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
Description
graphql-ruby version is v1.8.3.
rescue_from doesn't work when there is a query or mutation definition before rescue_from.
Implement
NG
class TestSchema < GraphQL::Schema
〜
query Types::Query
mutation Types::Mutation
rescue_from(Exception) do |error|
# doesn't call
end
〜
OK
class TestSchema < GraphQL::Schema
〜
rescue_from(Exception) do |error|
# call
end
query Types::Query
mutation Types::Mutation
〜
Reason
rescue_from is following code.
def rescue_from(err_class, &handler_block)
@rescues ||= {}
@rescues[err_class] = handler_block
end
And, query and mutation are affected by @rescues. (maybe)
Please check 🙏
mcdave029