@apollo/utils.operationregistrysignature
v3.0.0
Published
Generate a signature for the operation registry
Downloads
6,234
Readme
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 },
);