{"id":50720520,"url":"https://github.com/mstuart/graphql-hash","last_synced_at":"2026-06-09T23:30:50.321Z","repository":{"id":362404450,"uuid":"1158820093","full_name":"mstuart/graphql-hash","owner":"mstuart","description":"Generate a deterministic hash of a GraphQL query for caching and persisted queries","archived":false,"fork":false,"pushed_at":"2026-06-04T04:44:50.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-04T05:13:38.415Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mstuart.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-16T00:28:31.000Z","updated_at":"2026-06-04T04:44:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mstuart/graphql-hash","commit_stats":null,"previous_names":["mstuart/graphql-hash"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/mstuart/graphql-hash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstuart%2Fgraphql-hash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstuart%2Fgraphql-hash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstuart%2Fgraphql-hash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstuart%2Fgraphql-hash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mstuart","download_url":"https://codeload.github.com/mstuart/graphql-hash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstuart%2Fgraphql-hash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34130641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-09T23:30:49.224Z","updated_at":"2026-06-09T23:30:50.316Z","avatar_url":"https://github.com/mstuart.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# graphql-hash\n\n\u003e Generate a deterministic hash of a GraphQL query for caching and persisted queries\n\n## Install\n\n```sh\nnpm install graphql-hash\n```\n\n## Usage\n\n```js\nimport graphqlHash from 'graphql-hash';\n\ngraphqlHash('{ user { name } }');\n//=\u003e 'e3b0c44298fc1c14...'\n\n// Whitespace and comments don't affect the hash\ngraphqlHash(`\n\t# Fetch user\n\t{\n\t\tuser {\n\t\t\tname\n\t\t}\n\t}\n`);\n//=\u003e 'e3b0c44298fc1c14...' (same hash)\n```\n\n## API\n\n### graphqlHash(query, options?)\n\nReturns a hex-encoded hash `string`.\n\n#### query\n\nType: `string`\n\nThe GraphQL query string.\n\n#### options\n\nType: `object`\n\n##### algorithm\n\nType: `string`\\\nDefault: `'sha256'`\n\nThe hash algorithm to use. Any algorithm supported by `node:crypto` can be used.\n\n### normalizeQuery(query)\n\nReturns a normalized `string` with comments stripped, whitespace collapsed, and spaces removed around structural characters.\n\n#### query\n\nType: `string`\n\nThe GraphQL query string to normalize.\n\n## Related\n\n- [error-serialize](https://github.com/mstuart/error-serialize) - Serialize and deserialize Error objects\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmstuart%2Fgraphql-hash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmstuart%2Fgraphql-hash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmstuart%2Fgraphql-hash/lists"}