Skip to content

December 13, 2024

Compare
Choose a tag to compare
@theguild-bot theguild-bot released this 13 Dec 14:00
· 19 commits to main since this release
c417be8

@graphql-hive/[email protected]

Patch Changes

@graphql-tools/[email protected]

Patch Changes

@graphql-tools/[email protected]

Patch Changes

@graphql-tools/[email protected]

Patch Changes

@graphql-tools/[email protected]

Patch Changes

@graphql-mesh/[email protected]

Patch Changes

@graphql-hive/[email protected]

Minor Changes

  • #322 23b8987 Thanks @ardatan! - New Retry and Timeout plugins;

    • Retry plugin: Retry a request if it fails

    It respects the Retry-After HTTP header, See more about this HTTP

    export const gatewayConfig = defineConfig({
        upstreamRetry: {
            // The maximum number of retries to attempt.
            maxRetries: 3, // required
            // The delay between retries in milliseconds.
            retryDelay: 1000, // default
            /**
             * A function that determines whether a response should be retried.
             * If the upstream returns `Retry-After` header, the request will be retried.
             */
            shouldRetry: ({ response }) => response?.status >= 500 || response?.status === 429
        }
        // or you can configure it by subgraph name
        upstreamRetry({ subgraphName }) {
            if (subgraphName === 'my-rate-limited-subgraph') {
                return {
                    maxRetries: 3,
                }
            }
            return { maxRetries: 10 }
        }
    })
    • Timeout plugin: Timeout a request if it takes too long
    export const gatewayConfig = defineConfig({
      // The maximum time in milliseconds to wait for a response from the upstream.
      upstreamTimeout: 1000, // required
      // or you can configure it by subgraph name
      upstreamTimeout({ subgraphName }) {
        if (subgraphName === 'my-slow-subgraph') {
          return 1000;
        }
      },
    });

Patch Changes

@graphql-mesh/[email protected]

Patch Changes

@graphql-mesh/[email protected]

Patch Changes

@graphql-mesh/[email protected]

Patch Changes

@graphql-hive/[email protected]

Minor Changes

  • #322 23b8987 Thanks @ardatan! - New Retry and Timeout plugins;

    • Retry plugin: Retry a request if it fails

    It respects the Retry-After HTTP header, See more about this HTTP

    export const gatewayConfig = defineConfig({
        upstreamRetry: {
            // The maximum number of retries to attempt.
            maxRetries: 3, // required
            // The delay between retries in milliseconds.
            retryDelay: 1000, // default
            /**
             * A function that determines whether a response should be retried.
             * If the upstream returns `Retry-After` header, the request will be retried.
             */
            shouldRetry: ({ response }) => response?.status >= 500 || response?.status === 429
        }
        // or you can configure it by subgraph name
        upstreamRetry({ subgraphName }) {
            if (subgraphName === 'my-rate-limited-subgraph') {
                return {
                    maxRetries: 3,
                }
            }
            return { maxRetries: 10 }
        }
    })
    • Timeout plugin: Timeout a request if it takes too long
    export const gatewayConfig = defineConfig({
      // The maximum time in milliseconds to wait for a response from the upstream.
      upstreamTimeout: 1000, // required
      // or you can configure it by subgraph name
      upstreamTimeout({ subgraphName }) {
        if (subgraphName === 'my-slow-subgraph') {
          return 1000;
        }
      },
    });

Patch Changes

@graphql-tools/[email protected]

Patch Changes

@graphql-tools/[email protected]

Patch Changes

@graphql-mesh/[email protected]

Patch Changes

@graphql-mesh/[email protected]

Patch Changes

@graphql-mesh/[email protected]

Patch Changes

@graphql-mesh/[email protected]

Patch Changes

@graphql-tools/[email protected]

Patch Changes