Skip to content

Conversation

@spawnia
Copy link
Collaborator

@spawnia spawnia commented Dec 29, 2025

Summary

  • Implements the ValidationCache interface from Cache result of validation webonyx/graphql-php#1730 to improve validation result caching
  • Adds automatic cache invalidation when upgrading webonyx/graphql-php or nuwave/lighthouse (library versions are now part of the cache key)
  • Adds automatic cache invalidation when security config changes (max_query_depth, disable_introspection)
  • Updates documentation to reflect that manual cache clearing is no longer needed on library upgrades

Cache key components

The validation cache key now includes:

  1. Library versions (webonyx/graphql-php and nuwave/lighthouse) - auto-invalidates on upgrades
  2. Schema hash - invalidates when the schema changes
  3. Query hash - each unique query has its own entry
  4. Rule configuration hash - invalidates when max_query_depth or disable_introspection settings change

Dependencies

This PR depends on webonyx/graphql-php#1730 being merged and released. The implementation battle-tests that PR's ValidationCache interface.

Test plan

  • Existing validation caching tests pass
  • New tests verify cache key changes when max_query_depth config changes
  • New tests verify cache key changes when disable_introspection config changes

🤖 Generated with Claude Code

Implement the ValidationCache interface from webonyx/graphql-php#1730
to improve validation result caching with automatic cache invalidation.

Cache key now includes:
- Library versions (webonyx/graphql-php and nuwave/lighthouse)
- Schema hash
- Query hash
- Rule configuration hash (max_query_depth, disable_introspection)

This eliminates the need for manual cache clearing when upgrading
graphql-php or lighthouse, as the cache auto-invalidates on version
changes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@spawnia spawnia marked this pull request as draft December 29, 2025 16:14
Temporarily depend on the validation-cache branch from webonyx/graphql-php
to test the ValidationCache interface integration.

This will be updated to a proper version constraint once
webonyx/graphql-php#1730 is merged and released.

Note: This will require a major version bump for Lighthouse.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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