Skip to content

Extensions are not rendered from GraphQLError that originated from CompletableFuture #1018

Closed

Description

@thestarmaker

Hi there,

I have noticed that if a DataFetcher returns a CompletableFuture, and this CompletableFuture completes exceptionally with GraphQLError as an exception, then the extensions on this GraphQLError are nor rendered to the response.

The reason is that ExecutionStrategy.handleFetchingExcetion() just delegates to

parameters.deferredErrorSupport().onFetchingException(parameters, e);

and it is never checked that the supplied Throwable may implement GraphQLError. This means that the async code can not append any custom extensions to the errors.

This happens in graphql-java 8.0

Activity

  1. added this to the 9.0 milestone on May 9, 2018
  2. bbakerman commented on May 9, 2018

    @bbakerman
    Member

    I am not seeing this behaviour for extensions.

    I have written a new test that shows it working (see #1037 )

    Can you expand on this problem more or perhaps do a unit test that demonstrates it happening.

    graphql.ExceptionWhileDataFetching#ExceptionWhileDataFetching is the class in question that transfers exceptions that are GraphqlErrors

  3. bbakerman commented on May 20, 2018

    @bbakerman
    Member

    I am going to close this because I believe its working as expected

  4. jaredculp commented on Jul 29, 2021

    @jaredculp

    The test referenced doesn't use a data fetcher that returns a CompletableFuture.

  5. bbakerman commented on Jul 30, 2021

    @bbakerman
    Member

    Do you have this problem @jaredculp ? This is a very old issue and has artrofied over time.

    I am not sure the code base is close enough any more. But if you can reproduce this problem please let us known?

  6. jaredculp commented on Aug 2, 2021

    @jaredculp

    @bbakerman looks like this issue was fixed in #2371. What does your release cadence look like?

  7. bbakerman commented on Aug 3, 2021

    @bbakerman
    Member

    17.0 is imminent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions