Detalhes do pacote

@graphql-mesh/transport-common

graphql-hive174.7kMIT0.7.35

null

readme (leia-me)

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 (log de mudanças)

@graphql-mesh/transport-common

0.7.35

Patch Changes

0.7.34

Patch Changes

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

0.7.33

Patch Changes

0.7.32

Patch Changes

0.7.31

Patch Changes

0.7.30

Patch Changes

0.7.29

Patch Changes

0.7.28

Patch Changes

0.7.27

Patch Changes

  • #420 14152f7 Thanks @ardatan! - dependencies updates:

  • #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

0.7.26

Patch Changes

  • Updated dependencies [c60a8f4]:
    • @graphql-hive/gateway-abort-signal-any@0.0.3

0.7.25

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/executor-common@0.0.1

0.7.24

Patch Changes

0.7.23

Patch Changes

0.7.22

Patch Changes

0.7.21

Patch Changes

0.7.20

Patch Changes

  • Updated dependencies [9ce705c]:
    • @graphql-tools/delegate@10.2.5

0.7.19

Patch Changes

  • Updated dependencies []:
    • @graphql-tools/delegate@10.2.4

0.7.18

Patch Changes

  • Updated dependencies [7ca0ff3]:
    • @graphql-tools/delegate@10.2.3

0.7.17

Patch Changes

  • Updated dependencies [2e0add3]:
    • @graphql-tools/delegate@10.2.2

0.7.16

Patch Changes

0.7.15

Patch Changes

0.7.14

Patch Changes

0.7.13

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/types@0.102.12

0.7.12

Patch Changes

0.7.11

Patch Changes

0.7.10

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/types@0.102.9

0.7.9

Patch Changes

0.7.8

Patch Changes

0.7.7

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/types@0.102.6

0.7.6

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/types@0.102.5

0.7.5

Patch Changes

0.7.4

Patch Changes

0.7.3

Patch Changes

0.7.2

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/types@0.102.2

0.7.1

Patch Changes

  • #7013 60bfc22 Thanks @ardatan! - Introduce a standard Upstream Error Format for HTTP-based sources;

    So all sources throw an error will have the extensions in the following format;

    {
      "extensions": {
        "request": {
          // The details of the request made to the upstream service
          "endpoint": "https://api.example.com",
          "method": "GET"
        },
        "response": {
          // The details of the HTTP response from the upstream service
          "status": 401,
          "statusText": "Unauthorized",
          "headers": {
            "content-type": "application/json"
          },
          "body": {
            // The raw body returned by the upstream service
            "error-message": "Unauthorized access"
          }
        }
      }
    }
    
  • Updated dependencies []:

    • @graphql-mesh/types@0.102.1

0.7.0

Patch Changes

  • Updated dependencies [db41f96]:
    • @graphql-mesh/types@0.102.0

0.6.1

Patch Changes

0.6.0

Patch Changes

0.5.0

Patch Changes

0.4.7

Patch Changes

  • Updated dependencies [a1bfc49]:
    • @graphql-mesh/types@0.99.7

0.4.6

Patch Changes

0.4.5

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/types@0.99.5

0.4.4

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/types@0.99.4

0.4.3

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/types@0.99.3

0.4.2

Patch Changes

  • #7352 4bc495c Thanks @ardatan! - dependencies updates:

  • #7294 345a814 Thanks @ardatan! - Ability to manipulate transport entry through transportEntries.

    For example, you can add extra headers to a subgraph

    transportEntries: {
      products: {
        // This adds extra headers to the subgraph configuration
        headers: [
          // This forwards `authorization` from the upstream to downstream
          ['authorization', '{context.headers.authorization}'],
          // Or some static value
          ['x-extra', process.env.SOME_THING],
        ];
      }
    }
    
  • Updated dependencies [4bc495c]:

    • @graphql-mesh/types@0.99.2

0.4.1

Patch Changes

0.4.0

Minor Changes

  • #7207 69e6eb5 Thanks @enisdenjo! - Define transports using a default export satisfying the Transport generic

    For example, a custom http transport implementation looks like this:

    // http-transport.ts
    
    import { Transport } from '@graphql-mesh/transport-common';
    
    export interface HTTPTransportOptions {
      cache?: boolean;
    }
    
    export default {
      getSubgraphExecutor(opts) {
        // <the implementation of your executor getter>
      },
    } satisfies Transport<'http', HTTPTransportOptions>;
    

    and is used for Mesh serve like this:

    // mesh.config.ts
    
    import { defineConfig } from '@graphql-mesh/serve-cli';
    
    export const serveConfig = defineConfig({
      transport: {
        http: import('./http-transport'),
      },
    });
    

    or like this:

    // mesh.config.ts
    
    import { defineConfig } from '@graphql-mesh/serve-cli';
    import httpTransport from './http-transport';
    
    export const serveConfig = defineConfig({
      transport: {
        http: httpTransport,
      },
    });
    

Patch Changes

0.3.1

Patch Changes

0.3.0

Minor Changes

  • #7145 7544594 Thanks @ardatan! - POTENTIAL BREAKING CHANGE:

    Now @httpOperation and @transport directive serializes headers as [string, string][] instead of stringified JSON.

    @httpOperation(
    -  operationSpecificHeaders: [["Authorization", "Bearer 123"], ["X-Api-Key", "123"]]
    +  operationSpecificHeaders: "{\"Authorization\": \"Bearer 123\", \"X-Api-Key\": \"123\"}"
    )
    
    @transport(
    -  headers: [["Authorization, "Bearer 123"], ["X-Api-Key", "123"]]
    +  headers: "{\"Authorization, \"Bearer 123\", \"X-Api-Key\": \"123\"}"
    )
    

    Also incorrect placement of @transport has been fixed to SCHEMA

    directive @transport on
    -  FIELD_DEFINITION
    +  SCHEMA
    

    There is still backwards compatibility but this might look like a breaking change for some users during schema validation.

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/types@0.98.9

0.2.8

Patch Changes

0.2.7

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/types@0.98.7

0.2.6

Patch Changes

0.2.5

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/types@0.98.5

0.2.4

Patch Changes

  • fb59244 Thanks @ardatan! - Update GraphQL Tools packages

  • Updated dependencies [fb59244]:

    • @graphql-mesh/types@0.98.4

0.2.3

Patch Changes

  • c47b2aa Thanks @ardatan! - Bump GraphQL Tools versions

  • Updated dependencies [c47b2aa]:

    • @graphql-mesh/types@0.98.3

0.2.2

Patch Changes

  • 96dd11d Thanks @ardatan! - Bump GraphQL Tools versions

  • Updated dependencies [96dd11d]:

    • @graphql-mesh/types@0.98.2

0.2.1

Patch Changes

  • Updated dependencies [6044b7f]:
    • @graphql-mesh/types@0.98.1

0.2.0

Patch Changes

0.1.5

Patch Changes

  • Updated dependencies [52f74e7]:
    • @graphql-mesh/types@0.97.5

0.1.4

Patch Changes

  • Updated dependencies [ff33394]:
    • @graphql-mesh/types@0.97.4

0.1.3

Patch Changes

  • Updated dependencies [57f4a60]:
    • @graphql-mesh/types@0.97.3

0.1.2

Patch Changes

  • Updated dependencies [7a712ab]:
    • @graphql-mesh/types@0.97.2

0.1.1

Patch Changes

  • Updated dependencies [dbaf72c]:
    • @graphql-mesh/types@0.97.1

0.1.0

Patch Changes

  • Updated dependencies [92dce67]:
    • @graphql-mesh/types@0.97.0

0.0.3

Patch Changes

  • Updated dependencies []:
    • @graphql-mesh/types@0.96.6

0.0.2

Patch Changes

  • Updated dependencies [4b3ea1d]:
    • @graphql-mesh/types@0.96.5

0.0.1

Patch Changes