Skip to content

Allow resolving exceptions from a subscription #397

Closed
@Munoon

Description

@Munoon

As a user, I want to be able to create a custom exception mapper in GraphQLError inside subscriptions. It is currently impossible to modify the error response, if you throw an exception inside the method, annotated with @SubscriptionMapping or inside publisher, that returning method with @SubscriptionMapping annotation.

Here is an example use case: when the user creates a subscription, I want to verify if he can subscribe. If not, I want to return an error, with details inside the extensions field.

Currently, each exception is mapping to the following error response:

{
    "message": "Exception error",
    "locations": [],
    "extensions": { "classification": "DataFetchingException" }
}

I also create a small application, that represents this problem: example.zip

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions