Skip to content

Make documentId deterministic SHA-256 string and keep schemaId as in-memory int cache key - #575

Open
xperiandri with Copilot wants to merge 40 commits into
devfrom
copilot/fix-documentid-issue
Open

Make documentId deterministic SHA-256 string and keep schemaId as in-memory int cache key#575
xperiandri with Copilot wants to merge 40 commits into
devfrom
copilot/fix-documentid-issue

Conversation

CopilotAI commented May 17, 2026

Copy link
Copy Markdown
Contributor
  • Review new actionable comment and related ExecutionTests code path
  • Investigate recent CI workflow failures via GitHub MCP logs
  • Run baseline build/tests before changes
  • Update ExecutionTests to assert/avoid validation-error-only path for escaped-string documentId
  • Format changed files with Fantomas
  • Run targeted build/tests for touched area
  • Run parallel validation
  • Reply to the new comment with commit hash

CopilotAI linked an issue May 17, 2026 that may be closed by this pull request
CopilotAI changed the title [WIP] Fix documentId consistency for the same query contentMake documentId deterministic for identical GraphQL document contentMay 17, 2026
CopilotAI requested a review from xperiandriMay 17, 2026 18:50
Comment threadtests/FSharp.Data.GraphQL.Tests/Literals.fs Outdated
Comment threadsrc/FSharp.Data.GraphQL.Server/Executor.fs Outdated
Comment threadsrc/FSharp.Data.GraphQL.Server/Executor.fs Outdated
CopilotAI changed the title Make documentId deterministic for identical GraphQL document contentMake documentId deterministic as a SHA-256 string for identical GraphQL document contentMay 17, 2026
CopilotAI requested a review from xperiandriMay 17, 2026 20:10

@xperiandrixperiandri left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment threaddocs/execution-pipeline.md Outdated
Comment threadsrc/FSharp.Data.GraphQL.Server/Executor.fs Outdated
Comment threadsrc/FSharp.Data.GraphQL.Shared/Helpers/DocumentId.fs Outdated
Comment threadsrc/FSharp.Data.GraphQL.Shared/FSharp.Data.GraphQL.Shared.fsproj Outdated

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.fromCanonicalQuery hashing helper and uses it in server execution and design-time validation cache key creation.
  • Updates DocumentId-related contract types, tests, docs, and JSON fixtures from int to string.
  • 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
FileDescription
src/FSharp.Data.GraphQL.Shared/Helpers/DocumentId.fsAdds SHA-256 document ID helper.
src/FSharp.Data.GraphQL.Shared/FSharp.Data.GraphQL.Shared.fsprojIncludes the new helper in compilation.
src/FSharp.Data.GraphQL.Shared/ValidationResultCache.fsChanges validation cache key document ID type to string.
src/FSharp.Data.GraphQL.Shared/TypeSystem.fsChanges planning/execution plan document ID types to string.
src/FSharp.Data.GraphQL.Server/Executor.fsComputes document IDs via SHA-256 over ToQueryString().
src/FSharp.Data.GraphQL.Server/IO.fsUpdates response/result document ID contracts to string.
src/FSharp.Data.GraphQL.Client.DesignTime/ProvidedTypesHelper.fsUses deterministic document ID in design-time validation keys.
tests/FSharp.Data.GraphQL.Tests/ExecutionTests.fsUpdates document ID assertions for deterministic string hashes.
tests/FSharp.Data.GraphQL.Tests/Literals.fsReplaces inline JSON literal with file-backed literal provider.
tests/FSharp.Data.GraphQL.Tests/FSharp.Data.GraphQL.Tests.fsprojAdds literal provider package reference.
tests/FSharp.Data.GraphQL.IntegrationTests/introspection.jsonUpdates fixture document ID to string hash.
tests/FSharp.Data.GraphQL.IntegrationTests/integration-introspection.jsonUpdates fixture document ID to string hash.
Packages.propsAdds central package version for literal provider.
README.mdUpdates sample output document ID to string hash.
docs/execution-pipeline.mdDocuments deterministic SHA-256 string document IDs.

Comment threadsrc/FSharp.Data.GraphQL.Shared/ValidationResultCache.fs
Comment threadsrc/FSharp.Data.GraphQL.Shared/Helpers/DocumentId.fs
Comment threadsrc/FSharp.Data.GraphQL.Server/Executor.fs Outdated
Comment threadREADME.md Outdated
CopilotAIand others added 29 commits August 11, 2026 15:16
… object initializer syntax
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Data.GraphQL/sessions/ce0fba11-9043-452f-b948-e03c8b644f26
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/50df7657-a96d-4b4f-89a9-b012c920b492
Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Test Results

3 files 3 suites 10m 17s ⏱️
621 tests 616 ✅ 5 💤 0 ❌
1 863 runs 1 848 ✅ 15 💤 0 ❌

Results for commit 5393fd9.

Sign up for freeto 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.

documentId has different values for the same query content

3 participants

@xperiandri