Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make GraphQL execution strategies configurable by an 'ExecutionStrate…
…gyProvider' singleton (#47) * .Make GraphQL execution strategies configurable by an `ExecutionStrategyProvider` singleton * Removed repeated checks for executionStrategyProvider being null.
- Loading branch information
1 parent
8b7c2db
commit a86e2cb
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
graphql-router/src/main/java/com/networknt/graphql/router/ExecutionStrategyProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.networknt.graphql.router; | ||
|
||
import graphql.execution.ExecutionStrategy; | ||
|
||
/** | ||
* ExecutionStrategyProvider interface that is used to inject execution strategy | ||
* implementations into the framework. The service module will pass these on to | ||
* the graphql-java framework. | ||
* | ||
* @author Logi Ragnarsson | ||
*/ | ||
public interface ExecutionStrategyProvider { | ||
|
||
/** | ||
* Return an execution strategy to use for queries or null to use the default. | ||
*/ | ||
ExecutionStrategy getQueryExecutionStrategy(); | ||
|
||
/** | ||
* Return an execution strategy to use for mutations or null to use the default. | ||
*/ | ||
ExecutionStrategy getMutationExecutionStrategy(); | ||
|
||
/** | ||
* Return an execution strategy to use for subscriptions or null to use the default. | ||
*/ | ||
ExecutionStrategy getSubscriptionExecutionStrategy(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters