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

Reinstate the async mode enabled property fix #540 #541

Merged
merged 1 commit into from
Feb 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,16 +228,20 @@ or `application.properties`):

```yaml
graphql:
servlet:
mapping: /graphql
enabled: true
corsEnabled: true
cors:
allowed-origins: http://some.domain.com
allowed-methods: GET, HEAD, POST
# if you want to @ExceptionHandler annotation for custom GraphQLErrors
exception-handlers-enabled: true
contextSetting: PER_REQUEST_WITH_INSTRUMENTATION
servlet:
# Sets if GraphQL servlet should be created and exposed. If not specified defaults to "true".
enabled: true
# Sets the path where GraphQL servlet will be exposed. If not specified defaults to "/graphql"
mapping: /graphql
cors-enabled: true
cors:
allowed-origins: http://some.domain.com
allowed-methods: GET, HEAD, POST
# if you want to @ExceptionHandler annotation for custom GraphQLErrors
exception-handlers-enabled: true
context-setting: PER_REQUEST_WITH_INSTRUMENTATION
# Sets if asynchronous operations are supported for GraphQL requests. If not specified defaults to true.
async-mode-enabled: true
```

By default a global CORS filter is enabled for `/graphql/**` context. The `corsEnabled` can be set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class GraphQLServletProperties {
private long subscriptionTimeout = 0;
private ContextSetting contextSetting = ContextSetting.PER_QUERY_WITH_INSTRUMENTATION;
private long asyncTimeout = 30000;
private boolean asyncModeEnabled = true;
private String tracingEnabled = "false";
private boolean actuatorMetrics;
private Integer maxQueryComplexity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ public ServletRegistrationBean<AbstractGraphQLHttpServlet> graphQLServletRegistr
} else {
registration.setMultipartConfig(new MultipartConfigElement(""));
}
registration.setAsyncSupported(graphQLServletProperties.isAsyncModeEnabled());
return registration;
}

Expand Down