
Security News
White House Authorizes Private Companies to Conduct Offensive Cyber Operations
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.
graphql-hash
Advanced tools
Generate a deterministic hash of a GraphQL query for caching and persisted queries
Generate a deterministic hash of a GraphQL query for caching and persisted queries
npm install graphql-hash
import graphqlHash from 'graphql-hash';
graphqlHash('{ user { name } }');
//=> 'e3b0c44298fc1c14...'
// Whitespace and comments don't affect the hash
graphqlHash(`
# Fetch user
{
user {
name
}
}
`);
//=> 'e3b0c44298fc1c14...' (same hash)
Returns a hex-encoded hash string.
Type: string
The GraphQL query string.
Type: object
Type: string
Default: 'sha256'
The hash algorithm to use. Any algorithm supported by node:crypto can be used.
Returns a normalized string with comments stripped, whitespace collapsed, and spaces removed around structural characters.
Type: string
The GraphQL query string to normalize.
MIT
FAQs
Generate a deterministic hash of a GraphQL query for caching and persisted queries
The npm package graphql-hash receives a total of 73 weekly downloads. As such, graphql-hash popularity was classified as not popular.
We found that graphql-hash demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.