Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix async when graphql not enabled #3246

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

justin-tay
Copy link
Collaborator

Resolves #3245

Description

This adds a AsyncProviderService that is injected into the AsyncExecutorService to decouple the AsyncExecutorService implementation from the JsonApi and QueryRunners implementations. These are now registered into the AsyncProviderService.

The AsyncQueryOperation implementations then get the providers that they need in the following manner.

JsonApi jsonApi = getService().getProviders().getProvider(JsonApi.class);
QueryRunners queryRunners = getService().getProviders().getProvider(QueryRunners.class);

Motivation and Context

This fixes the bug where an exception is thrown when elide.async.enabled is true and elide.graphql.enabled is false.

This also allows the elide-graphql dependency to be excluded without errors if GraphQL is not required.

How Has This Been Tested?

A asyncEnabledJsonApiEnabledGraphqlNotEnabled test was added to ElideAutoConfigurationTest.

This was also tested manually with the elide-spring-boot-example by manually excluding the elide-graphql dependency and exercising the asyncQuery and tableExport functionality.

License

I confirm that this contribution is made under an Apache 2.0 license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NullPointerException for Async enabled with GraphQL defaults (disabled)
1 participant