Class TimeoutWebGraphQlInterceptor

java.lang.Object
org.springframework.graphql.server.TimeoutWebGraphQlInterceptor
All Implemented Interfaces:
WebGraphQlInterceptor

public class TimeoutWebGraphQlInterceptor extends Object implements WebGraphQlInterceptor
Web interceptor that enforces a request timeout for GraphQL requests. By default, timeouts will result in HttpStatus.REQUEST_TIMEOUT responses.

For streaming responses (like subscriptions), this timeout is only enforced until the response stream is established. Transport-specific timeouts are configurable on the transport handlers directly.

Since:
1.4
Author:
Brian Clozel
  • Constructor Details

    • TimeoutWebGraphQlInterceptor

      public TimeoutWebGraphQlInterceptor(Duration timeout)
      Create a new interceptor for the given timeout duration.
      Parameters:
      timeout - the request timeout to enforce
    • TimeoutWebGraphQlInterceptor

      public TimeoutWebGraphQlInterceptor(Duration timeout, HttpStatus timeoutStatus)
      Create a new interceptor for the given timeout duration and response status.
      Parameters:
      timeout - the request timeout to enforce
      timeoutStatus - the HTTP response status to use in case of timeouts
  • Method Details