Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@graphql-tools/executor-http

graphql-hive14.9mMIT2.0.1TypeScript support: included

A set of utils for faster development of GraphQL tools

readme

Hive GraphQL Platform

Hive Gateway

A fully open-source MIT-licensed GraphQL API gateway that can act as a GraphQL federation Gateway or a Proxy Gateway for any GraphQL services.

It can be run as a standalone binary, a Docker Image, or as a JavaScript package (e.g. within Node.js, Bun, Deno, Google Cloud Functions, Azure Functions or Cloudflare Workers)

changelog

@graphql-tools/executor-http

2.0.1

Patch Changes

2.0.0

Major Changes

  • #997 4cf75cb Thanks @ardatan! - - BREAKING: HTTP Executor no longer takes serviceName as an option.

    • Both HTTP executor and @graphql-mesh/transport-http-callback no longer handle DOWNSTREAM_SERVICE_ERROR error code with serviceName.
    • Gateway runtime handles subgraph errors on its own with DOWNSTREAM_SERVICE_ERROR error code and serviceName as a property. This behavior can be configured with subgraphErrors option of the createGatewayRuntime function or CLI config.
    subgraphError: {
       errorCode: 'DOWNSTREAM_SERVICE_ERROR', // or `false` to remove this code completely
       subgraphNameProp: 'serviceName' // or `false` to remove this prop completely
    }

Patch Changes

1.3.3

Patch Changes

  • #950 c7ea2c5 Thanks @kroupacz! - Errors should not be swallowed when it is thrown from the shared root

1.3.2

Patch Changes

1.3.1

Patch Changes

1.3.0

Minor Changes

  • #792 9c2f323 Thanks @ardatan! - Ensure subgraph name is present in the upstream error extensions when HTTP Executor throws

Patch Changes

1.2.8

Patch Changes

1.2.7

Patch Changes

1.2.6

Patch Changes

1.2.5

Patch Changes

  • #420 14152f7 Thanks @ardatan! - - In case of schema reload, throw SCHEMA_RELOAD error while recreating the transports and executors

    • In case of shut down, throw SHUTTING_DOWN error while cleaning the transports and executors up

    Previously, these errors are only thrown for subscriptions not it is thrown in other type of operations as well. And previously the thrown errors during these two cleanup and restart process were cryptic, now the mentioned two errors above are thrown with more clear messages

1.2.4

Patch Changes

1.2.3

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]:

1.2.2

Patch Changes

1.2.1

Patch Changes

1.2.0

Minor Changes

  • #313 367b359 Thanks @ardatan! - Automatic Persisted Queries support for upstream requests

    For HTTP Executor;

    buildHTTPExecutor({
      // ...
      apq: true,
    });

    For Gateway Configuration;

    export const gatewayConfig = defineConfig({
      transportEntries: {
        '*': {
          options: {
            apq: true,
          },
        },
      },
    });

1.1.14

Patch Changes

1.1.13

Patch Changes

1.1.12

Patch Changes

1.1.11

Patch Changes

1.1.10

Patch Changes

1.1.9

Patch Changes

1.1.8

Patch Changes

1.1.7

Patch Changes

1.1.6

Patch Changes

  • f9dd3d6 Thanks @ardatan! - Details in the extensions when an unexpected error occurs;

    {
      "request": {
        "url": "https://api.example.com/graphql",
        "method": "POST",
        "body": {
          "query": "query { hello }"
        }
      },
      "response": {
        "status": 500,
        "statusText": "Internal Server Error",
        "headers": {
          "content-type": "application/json"
        },
        "body": {
          "errors": [
            {
              "message": "Internal Server Error"
            }
          ]
        }
      }
    }

1.1.5

Patch Changes

1.1.4

Patch Changes

1.1.3

Patch Changes

1.1.2

Patch Changes

1.1.1

Patch Changes

  • #6299 b0ffac8 Thanks @EmrysMyrddin! - When proxying the requests to the HTTP executor, it should return `GraphQLError` instances in `errors` array

  • 46eab79 Thanks @ardatan! - Fixed potential leak on executor disposal

1.1.0

Minor Changes

  • #6323 cacf20f Thanks @ardatan! - Implement Symbol.dispose or Symbol.asyncDispose to make `Executor`s `Disposable`

Patch Changes

1.0.9

Patch Changes

1.0.8

Patch Changes

1.0.7

Patch Changes

1.0.6

Patch Changes

  • b798b3b Thanks @ardatan! - Memoize the print result automatically, and able to accept a custom print function

1.0.5

Patch Changes

  • a4463d3 Thanks @ardatan! - Remove headers from extensions in the GraphQL request

1.0.4

Patch Changes

1.0.3

Patch Changes

1.0.2

Patch Changes

  • 5c174cc9 Thanks @ardatan! - Avoid object spread for better performance in Node

1.0.1

Patch Changes

1.0.0

Major Changes

Patch Changes

0.1.10

Patch Changes

0.1.9

Patch Changes

0.1.8

Patch Changes

0.1.7

Patch Changes

0.1.6

Patch Changes

0.1.5

Patch Changes

0.1.4

Patch Changes

0.1.3

Patch Changes

0.1.2

Patch Changes

0.1.1

Patch Changes

0.1.0

Minor Changes

Patch Changes

0.0.9

Patch Changes

0.0.8

Patch Changes

0.0.7

Patch Changes

0.0.6

Patch Changes

0.0.5

Patch Changes

0.0.4

Patch Changes

0.0.3

Patch Changes

0.0.2

Patch Changes

0.0.1

Patch Changes