test(codegen): add snapshot tests for query keys factory pattern #610
+2,044
−0
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.
Summary
Adds comprehensive snapshot tests for the new query keys factory pattern generators introduced in PR #609. The tests cover three code generators:
generateQueryKeysFile) - centralized query keys following the lukemorales patterngenerateMutationKeysFile) - mutation keys for tracking in-flight mutationsgenerateInvalidationFile) - type-safe invalidation with cascade supportThe test suite includes 16 test cases covering single tables, multiple tables, parent-child relationships, deep hierarchical relationships (org → db → table → field), custom queries/mutations, and configuration options like
generateScopedKeysandgenerateCascadeHelpers.Review & Testing Checklist for Human
invalidate.organization.withChildrenshould properly cascade to database, table, and field entities)cd graphql/codegen && pnpm test -- --testPathPattern="query-keys-factory"should pass with 16/16 testsNotes
This PR targets the
fix/improve-codegen-rq-modebranch (PR #609) as requested. If that base PR changes significantly, the snapshots may need to be regenerated.Requested by: @pyramation
Devin session: https://app.devin.ai/sessions/4d5df52ad251452da815b8cb06618596