Skip to content

SubscriptionExceptionResolver.resolveException should accept DataFetchingEnvironment #1087

@yassenb

Description

@yassenb

Currently the method in DataFetcherExceptionResolver is Mono<List<GraphQLError>> resolveException(Throwable exception, DataFetchingEnvironment environment) while the method in SubscriptionExceptionResolver is Mono<List<GraphQLError>> resolveException(Throwable exception). It would be nice to have DataFetchingEnvironment passed in as well to include more information in our error logs.

As a side note in DataFetcherExceptionResolver.resolveException I've noticed that for some reason SecurityContextHolder.getContext().getAuthentication() returns an instance of AnonymousAuthentication when I know the user is authenticated (and the same piece of code works correctly elsewhere) and as a work-around I'm force to use environment.getGraphQlContext().get<SecurityContextImpl>(SecurityContext::class.name).getAuthentication() to get the proper authentication instance. Same applies in SubscriptionExceptionResolver

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions