Skip to content

fix: key persisted queries by the hash the client actually sends - #1749

Merged
AlecAivazis merged 1 commit into
HoudiniGraphql:mainfrom
knd775:t3code/fix-persisted-query-fragment-keys
Sep 12, 2026
Merged

AlecAivazis merged 1 commit into
HoudiniGraphql:mainfrom
knd775:t3code/fix-persisted-query-fragment-keys

Conversation

@knd775

@knd775 knd775 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Documents containing fragments were keyed by documents.hash, which only covers the operation text, while the client artifact hashes the operation together with its fragments. The two also ordered the fragment definitions differently, so hashes would always miss.

Separately, operations were corrupted if they contained a % inside a string literal.

To help everyone out, please make sure your PR does the following:

  • Update the first line to point to the ticket that this PR fixes
  • Add a message that clearly describes the fix
  • If applicable, add a test that would fail without this fix
  • Make sure the unit and integration tests pass locally with pnpm run tests and cd integration && pnpm run tests
  • Includes a changeset if your fix affects the user with pnpm changeset

Documents that embed fragment definitions were keyed by documents.hash, which
only covers the operation text, while the artifact hashes the operation together
with its fragments. The two also ordered the definitions differently, so a
server looking up an incoming document id missed every one of those operations.

Both now build the document through one shared helper.
@changeset-bot

changeset-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 40c3593

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
houdini Patch
houdini-core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@AlecAivazis
AlecAivazis merged commit 3db8be0 into HoudiniGraphql:main Sep 12, 2026
14 checks passed
@knd775
knd775 deleted the t3code/fix-persisted-query-fragment-keys branch September 17, 2026 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants