Skip to content

Conversation

@pyramation
Copy link
Contributor

Summary

Adds comprehensive snapshot tests for the new query keys factory pattern generators introduced in PR #609. The tests cover three code generators:

  • Query keys factory (generateQueryKeysFile) - centralized query keys following the lukemorales pattern
  • Mutation keys factory (generateMutationKeysFile) - mutation keys for tracking in-flight mutations
  • Cache invalidation helpers (generateInvalidationFile) - type-safe invalidation with cascade support

The 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 generateScopedKeys and generateCascadeHelpers.

Review & Testing Checklist for Human

  • Review snapshot output for correctness: The snapshots capture ~1,670 lines of generated TypeScript. Verify the generated code patterns are correct, especially the hierarchical cascade invalidation logic (e.g., invalidate.organization.withChildren should properly cascade to database, table, and field entities)
  • Verify test fixtures are representative: Check that the table definitions and relationship configurations in the test file match realistic usage patterns
  • Run tests locally: cd graphql/codegen && pnpm test -- --testPathPattern="query-keys-factory" should pass with 16/16 tests

Notes

This PR targets the fix/improve-codegen-rq-mode branch (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

@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Base automatically changed from fix/improve-codegen-rq-mode to main January 14, 2026 12:00
@pyramation pyramation merged commit 61b614e into main Jan 14, 2026
@pyramation pyramation deleted the devin/1768378083-add-codegen-snapshot-test branch January 14, 2026 12:00
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