Skip to content

Releases: graphql-hive/gateway

December 31, 2024

31 Dec 11:34
03a648c
Compare
Choose a tag to compare

@graphql-tools/[email protected]

Patch Changes

@graphql-tools/[email protected]

Patch Changes

@graphql-mesh/[email protected]

Patch Changes

@graphql-mesh/[email protected]

Patch Changes

December 26, 2024

26 Dec 15:26
5e18cb1
Compare
Choose a tag to compare

@graphql-tools/[email protected]

Patch Changes

  • #381 55eb1b4 Thanks @ardatan! - This is a bugfix with some internal changes, no user action is needed. This bugfix and improvement is done to improve the stability of some components of the gateway;

    Like HMAC Upstream Signature plugin, different components of the gateway were using different ways of serializing the execution request.
    Some of them were ignoring variables if it is empty, some of not, this was causing the signature generation to be different for the same query.
    For example, it was working as expected in Proxy mode, but not working as expected in Federation Gateway mode.

    With this change, now we have a shared helper to serialize the upstream execution request with a memoized print function for query AST etc to have a consistent serialization so consistent signature generation for HMAC.

    For example instead of using print, you should use defaultPrintFn that memoizes print operation and also used the string version of it parsed before by Envelop/Yoga.

    -import { print } from 'graphql';
    -const query = print(parsedQuery);
    +import { defaultPrintFn } from '@graphql-tools/executor-common';
    +const query = defaultPrintFn(parsedQuery);

    Or instead of creating objects from ExecutionRequest, use serializeExecutionRequest helper.

    -const serializedRequest = {
    -  query: print(executionRequest.document),
    -  variables: executionRequest.variables,
    -  operationName: executionRequest.operationName,
    -  extensions: executionRequest.extensions,
    -};
    +import { serializeExecutionRequest } from '@graphql-tools/executor-common';
    +const serializedRequest = serializeExecutionRequest(executionRequest);

@graphql-tools/[email protected]

Patch Changes

  • #381 55eb1b4 Thanks @ardatan! - dependencies updates:

  • #381 55eb1b4 Thanks @ardatan! - This is a bugfix with some internal changes, no user action is needed. This bugfix and improvement is done to improve the stability of some components of the gateway;

    Like HMAC Upstream Signature plugin, different components of the gateway were using different ways of serializing the execution request.
    Some of them were ignoring variables if it is empty, some of not, this was causing the signature generation to be different for the same query.
    For example, it was working as expected in Proxy mode, but not working as expected in Federation Gateway mode.

    With this change, now we have a shared helper to serialize the upstream execution request with a memoized print function for query AST etc to have a consistent serialization so consistent signature generation for HMAC.

    For example instead of using print, you should use defaultPrintFn that memoizes print operation and also used the string version of it parsed before by Envelop/Yoga.

    -import { print } from 'graphql';
    -const query = print(parsedQuery);
    +import { defaultPrintFn } from '@graphql-tools/executor-common';
    +const query = defaultPrintFn(parsedQuery);

    Or instead of creating objects from ExecutionRequest, use serializeExecutionRequest helper.

    -const serializedRequest = {
    -  query: print(executionRequest.document),
    -  variables: executionRequest.variables,
    -  operationName: executionRequest.operationName,
    -  extensions: executionRequest.extensions,
    -};
    +import { serializeExecutionRequest } from '@graphql-tools/executor-common';
    +const serializedRequest = serializeExecutionRequest(executionRequest);
  • Updated dependencies [55eb1b4]:

@graphql-tools/[email protected]

Patch Changes

  • #381 55eb1b4 Thanks @ardatan! - dependencies updates:

  • #381 55eb1b4 Thanks @ardatan! - This is a bugfix with some internal changes, no user action is needed. This bugfix and improvement is done to improve the stability of some components of the gateway;

    Like HMAC Upstream Signature plugin, different components of the gateway were using different ways of serializing the execution request.
    Some of them were ignoring variables if it is empty, some of not, this was causing the signature generation to be different for the same query.
    For example, it was working as expected in Proxy mode, but not working as expected in Federation Gateway mode.

    With this change, now we have a shared helper to serialize the upstream execution request with a memoized print function for query AST etc to have a consistent serialization so consistent signature generation for HMAC.

    For example instead of using print, you should use defaultPrintFn that memoizes print operation and also used the string version of it parsed before by Envelop/Yoga.

    -import { print } from 'graphql';
    -const query = print(parsedQuery);
    +import { defaultPrintFn } from '@graphql-tools/executor-common';
    +const query = defaultPrintFn(parsedQuery);

    Or instead of creating objects from ExecutionRequest, use serializeExecutionRequest helper.

    -const serializedRequest = {
    -  query: print(executionRequest.document),
    -  variables: executionRequest.variables,
    -  operationName: executionRequest.operationName,
    -  extensions: executionRequest.extensions,
    -};
    +import { serializeExecutionRequest } from '@graphql-tools/executor-common';
    +const serializedRequest = serializeExecutionRequest(executionRequest);
  • Updated dependencies [55eb1b4]:

@graphql-tools/[email protected]

Patch Changes

@graphql-mesh/[email protected]

Patch Changes

@graphql-hive/[email protected]

Patch Changes

@graphql-mesh/[email protected]

Patch Changes

  • #381 55eb1b4 Thanks @ardatan! - dependencies updates:

  • #381 55eb1b4 Thanks @ardatan! - This is a bugfix with some internal changes, no user action is needed. This bugfix and improvement is done to improve the stability of some components of the gateway;

    Like HMAC Upstream Signature plugin, different components of the gateway were using different ways of serializing the execution request.
    Some of them were ignoring variables if it is empty, some of not, this was causing the signature generation to be different for the same query.
    For example, it was working as expected in Proxy mode, but not working as expected in Federation Gateway mode.

    With this chan...

Read more

[email protected]

26 Dec 15:28
5e18cb1
Compare
Choose a tag to compare

Pre-built binaries of the Hive Gateway for the @graphql-hive/[email protected] release.

December 24, 2024

24 Dec 13:05
66f5450
Compare
Choose a tag to compare

@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-tools/[email protected]

Patch Changes

@graphql-tools/[email protected]

Patch Changes

@graphql-mesh/[email protected]

Patch Changes

@graphql-hive/[email protected]

Patch Changes

@graphql-mesh/[email protected]

Patch Changes

Read more

December 24, 2024

24 Dec 09:22
ecd505d
Compare
Choose a tag to compare

@graphql-mesh/[email protected]

Patch Changes

  • #357 8b64103 Thanks @ardatan! - Fix the bug on setting the default polling interval to 10 seconds
    So by default, the gateway will poll the schema every 10 seconds, and update the schema if it has changed.

    This PR also contains improvements on logging about polling

@graphql-hive/[email protected]

Patch Changes

@graphql-mesh/[email protected]

Patch Changes

@graphql-mesh/[email protected]

Patch Changes

@graphql-hive/[email protected]

Patch Changes

  • #357 8b64103 Thanks @ardatan! - Fix the bug on setting the default polling interval to 10 seconds
    So by default, the gateway will poll the schema every 10 seconds, and update the schema if it has changed.

    This PR also contains improvements on logging about polling

  • #356 122c013 Thanks @ardatan! - Better messages on debug logs of readiness check endpoint;

    Before;
    On successful readiness check, the gateway was logging the following message:

    Readiness check passed: Supergraph loaded
    

    Because this makes the users think it was just loaded.
    After;
    On successful readiness check, the gateway will log the following message:

    Readiness check passed because supergraph has been loaded already
    

    On failed readiness check, the gateway was logging the following message:
    Before;

    Readiness check failed: Supergraph not loaded
    

    It should make the users think it was not loaded or there is an issue with the supergraph.

    After;

    Readiness check failed because supergraph has not been loaded yet or failed to load
    
  • #342 2f59fce Thanks @ardatan! - token doesn't need to be required for Hive reporting in the configuration because it can be provided by the arguments

  • Updated dependencies [8b64103]:

[email protected]

24 Dec 13:08
66f5450
Compare
Choose a tag to compare

Pre-built binaries of the Hive Gateway for the @graphql-hive/[email protected] release.

[email protected]

24 Dec 09:25
ecd505d
Compare
Choose a tag to compare

Pre-built binaries of the Hive Gateway for the @graphql-hive/[email protected] release.

December 14, 2024

14 Dec 15:45
3551600
Compare
Choose a tag to compare

@graphql-tools/[email protected]

Patch Changes

@graphql-mesh/[email protected]

Patch Changes

@graphql-hive/[email protected]

Patch Changes

@graphql-mesh/[email protected]

Patch Changes

@graphql-mesh/[email protected]

Patch Changes

@graphql-hive/[email protected]

Patch Changes

[email protected]

14 Dec 15:48
3551600
Compare
Choose a tag to compare

Pre-built binaries of the Hive Gateway for the @graphql-hive/[email protected] release.

December 13, 2024

13 Dec 14:00
c417be8
Compare
Choose a tag to compare

@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

Read more