Make documentId deterministic SHA-256 string and keep schemaId as in-memory int cache key#575
Open
Copilot wants to merge 40 commits into
Open
Make documentId deterministic SHA-256 string and keep schemaId as in-memory int cache key#575Copilot wants to merge 40 commits into
documentId deterministic SHA-256 string and keep schemaId as in-memory int cache key#575Copilot wants to merge 40 commits into
Conversation
Copilot
AI
changed the title
[WIP] Fix
Make May 17, 2026
documentId consistency for the same query contentdocumentId deterministic for identical GraphQL document content
xperiandri
requested changes
May 17, 2026
xperiandri
reviewed
May 17, 2026
Copilot
AI
changed the title
Make
Make May 17, 2026
documentId deterministic for identical GraphQL document contentdocumentId deterministic as a SHA-256 string for identical GraphQL document content
xperiandri
requested changes
May 17, 2026
xperiandri
approved these changes
May 17, 2026
There was a problem hiding this comment.
Pull request overview
This PR changes GraphQL execution metadata so documentId is generated as a deterministic SHA-256 lowercase hex string from the printed query document instead of using unstable AST hash codes.
Changes:
- Adds shared
DocumentId.fromCanonicalQueryhashing helper and uses it in server execution and design-time validation cache key creation. - Updates
DocumentId-related contract types, tests, docs, and JSON fixtures frominttostring. - Replaces an inline introspection literal with a file-backed literal provider dependency.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/FSharp.Data.GraphQL.Shared/Helpers/DocumentId.fs |
Adds SHA-256 document ID helper. |
src/FSharp.Data.GraphQL.Shared/FSharp.Data.GraphQL.Shared.fsproj |
Includes the new helper in compilation. |
src/FSharp.Data.GraphQL.Shared/ValidationResultCache.fs |
Changes validation cache key document ID type to string. |
src/FSharp.Data.GraphQL.Shared/TypeSystem.fs |
Changes planning/execution plan document ID types to string. |
src/FSharp.Data.GraphQL.Server/Executor.fs |
Computes document IDs via SHA-256 over ToQueryString(). |
src/FSharp.Data.GraphQL.Server/IO.fs |
Updates response/result document ID contracts to string. |
src/FSharp.Data.GraphQL.Client.DesignTime/ProvidedTypesHelper.fs |
Uses deterministic document ID in design-time validation keys. |
tests/FSharp.Data.GraphQL.Tests/ExecutionTests.fs |
Updates document ID assertions for deterministic string hashes. |
tests/FSharp.Data.GraphQL.Tests/Literals.fs |
Replaces inline JSON literal with file-backed literal provider. |
tests/FSharp.Data.GraphQL.Tests/FSharp.Data.GraphQL.Tests.fsproj |
Adds literal provider package reference. |
tests/FSharp.Data.GraphQL.IntegrationTests/introspection.json |
Updates fixture document ID to string hash. |
tests/FSharp.Data.GraphQL.IntegrationTests/integration-introspection.json |
Updates fixture document ID to string hash. |
Packages.props |
Adds central package version for literal provider. |
README.md |
Updates sample output document ID to string hash. |
docs/execution-pipeline.md |
Documents deterministic SHA-256 string document IDs. |
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Data.GraphQL/sessions/fe5050da-a1a6-43d1-978f-18d01b969c4c Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Data.GraphQL/sessions/95956635-01ea-45da-a2fc-e89c2faafbbd Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
xperiandri
reviewed
May 18, 2026
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Data.GraphQL/sessions/95956635-01ea-45da-a2fc-e89c2faafbbd Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Data.GraphQL/sessions/7ce8c26c-d831-4c14-a520-93ba8f1f1622 Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Data.GraphQL/sessions/1b4b4e4f-e994-4b23-92e4-8f31ed38a207 Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.