@apollo/utils.operationregistrysignature
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

operationRegistrySignature

The operation registry signature function consists of removing extra whitespace, sorting the AST in a deterministic manner, potentially hiding string and numeric literals, and removing unused definitions. This is a less aggressive transform than its usage reporting signature counterpart. This is used to generate a signature used by Apollo's operation registry to identify operations.

Usage

import { operationRegistrySignature } from "@apollo/utils.operationregistrysignature";

const signature = operationRegistrySignature(
  parse(`#graphql
    query Foo {
      bar
    }
  `),
  "Foo",
  { preserveStringAndNumericLiterals: true },
);

Package Sidebar

Install

npm i @apollo/utils.operationregistrysignature

Weekly Downloads

1,888

Version

3.0.0

License

MIT

Unpacked Size

11.4 kB

Total Files

11

Last publish

Collaborators

  • dkuc
  • glasser
  • trevor.scheer
  • apollo-bot