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

Package detail

@graphql-tools/executor-common

graphql-hive951.2kMIT0.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-common

0.0.1

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);