function persistedQueryHash
persistedQueryHash(
query: string,
subtle: SubtleCrypto
): Promise<string>

Compute a SHA-256 hash of the query string and return lowercase hex.

Takes a SubtleCrypto instance (from runtime.subtle), never uses a global or runtime-specific API.

Parameters

query: string

The query string to hash

The SubtleCrypto instance

Return Type

Promise<string>

The lowercase hex hash

Usage

import { persistedQueryHash } from "graphql-plugin/src/index.ts";