Skip to content

rescue_from isn't working due to promises #17

@ngouy

Description

@ngouy

Using graphql-ruby 1.8.x, I cannot rescue errors from queries as I do for mutations due to batching and its Promises. How can i Handle that ?

for mutation this is working :

class MySchema < GraphQL::Schema
    enable_preloading

    mutation Mutations::Root
    query Queries::Root

    rescue_from(Pundit::NotAuthorizedError) {
        raise GraphQL::ExecutionError, "You are forbidden to access this field."
    }
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions