chore: entity caching clean/chunk 1#1544
Draft
Noroth wants to merge 4 commits into
Draft
Conversation
Pin github.com/wundergraph/astjson to commit 0d295948 (branch feat/two-pass-parser) in both the v2 and execution modules. This commit provides the StructuralCopy / StructuralCopyWithTransform / Transform / two-pass-parser primitives the entity-caching foundation depends on, and drops the 'changed bool' return from MergeValues / MergeValuesWithPath. Adapt all 9 MergeValues / MergeValuesWithPath call sites to the new (*Value, error) signature. No logic or behavior change. Real packages build (go build ./pkg/...) and vet clean; the pre-existing v2/doc.go package-main quirk is unrelated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Introduce the minimal, declarations-only foundation for entity caching: the router-facing LoaderCache/CacheEntry L2 backend contract, the engine-internal CacheKeyTemplate/CacheKey seam, EntityCacheInvalidationConfig, and the per-fetch FetchCacheConfiguration skeleton (resolve/cache.go). Nothing implements or calls these yet; loader and resolvable are untouched. Also lands the full re-implementation spec package under docs/entity-caching/: the architecture spec and integration seam, the directive inventory, one spec + ADR per directive, the stacked-PR plans for graphql-go-tools and the router, the astjson dependency spec, and the test/benchmark plan. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add the alias-aware metadata the entity cache uses to normalize and denormalize a fetch's field shape: Field.OriginalName (schema name behind an alias), Field.CacheArgs (per-field argument metadata for the cache-key arg hash), Object.HasAliases (fast-path flag), the CacheFieldArg type, and the pure ComputeHasAliases(*Object) tree walk. All new fields are json:",omitempty" and default to zero, so existing JSON snapshots are unchanged; Object.Copy/Field.Copy propagate them. Nothing populates or reads these yet (the planner populates them and the copy helpers consume them in later PRs). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add the four Loader copy helpers that isolate a cached value from the live response tree while renaming the field shape between response aliases and schema names: structuralCopyNormalized / structuralCopyDenormalized (L2, project unlisted fields) and their *Passthrough variants (L1, keep unlisted fields). The buildNormalizeTransform / buildDenormalizeTransform builders turn a ProvidesData *Object into an astjson.Transform, recursing through nested objects and arrays of objects. New file only; nothing calls the helpers yet (the loader wires them in a later PR). Round-trip, projection, passthrough, nested, and array cases are covered with exact full-JSON assertions, race-clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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.
First chunk of changes
branches
00 -> 01 -> 05 -> 02@coderabbitai summary
Checklist
Open Source AI Manifesto
This project follows the principles of the Open Source AI Manifesto. Please ensure your contribution aligns with its principles.