Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit ae645c6

Browse files
authored
Merge pull request #541 from graphql-java-kickstart/async-mode-property
Reinstate the async mode enabled property fix #540
2 parents 8050c08 + 36f2414 commit ae645c6

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -228,16 +228,20 @@ or `application.properties`):
228228

229229
```yaml
230230
graphql:
231-
servlet:
232-
mapping: /graphql
233-
enabled: true
234-
corsEnabled: true
235-
cors:
236-
allowed-origins: http://some.domain.com
237-
allowed-methods: GET, HEAD, POST
238-
# if you want to @ExceptionHandler annotation for custom GraphQLErrors
239-
exception-handlers-enabled: true
240-
contextSetting: PER_REQUEST_WITH_INSTRUMENTATION
231+
servlet:
232+
# Sets if GraphQL servlet should be created and exposed. If not specified defaults to "true".
233+
enabled: true
234+
# Sets the path where GraphQL servlet will be exposed. If not specified defaults to "/graphql"
235+
mapping: /graphql
236+
cors-enabled: true
237+
cors:
238+
allowed-origins: http://some.domain.com
239+
allowed-methods: GET, HEAD, POST
240+
# if you want to @ExceptionHandler annotation for custom GraphQLErrors
241+
exception-handlers-enabled: true
242+
context-setting: PER_REQUEST_WITH_INSTRUMENTATION
243+
# Sets if asynchronous operations are supported for GraphQL requests. If not specified defaults to true.
244+
async-mode-enabled: true
241245
```
242246
243247
By default a global CORS filter is enabled for `/graphql/**` context. The `corsEnabled` can be set

graphql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/spring/web/boot/GraphQLServletProperties.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public class GraphQLServletProperties {
3636
private long subscriptionTimeout = 0;
3737
private ContextSetting contextSetting = ContextSetting.PER_QUERY_WITH_INSTRUMENTATION;
3838
private long asyncTimeout = 30000;
39+
private boolean asyncModeEnabled = true;
3940
private String tracingEnabled = "false";
4041
private boolean actuatorMetrics;
4142
private Integer maxQueryComplexity;

graphql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/spring/web/boot/GraphQLWebAutoConfiguration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ public ServletRegistrationBean<AbstractGraphQLHttpServlet> graphQLServletRegistr
329329
} else {
330330
registration.setMultipartConfig(new MultipartConfigElement(""));
331331
}
332+
registration.setAsyncSupported(graphQLServletProperties.isAsyncModeEnabled());
332333
return registration;
333334
}
334335

0 commit comments

Comments
 (0)