Skip to content

[upstream #3775] feat(core): Add Apollo server cache configuration option - #53

Draft
ayim wants to merge 5 commits into
masterfrom
mirror/upstream-3775
Draft

[upstream #3775] feat(core): Add Apollo server cache configuration option#53
ayim wants to merge 5 commits into
masterfrom
mirror/upstream-3775

Conversation

@ayim

@ayim ayim commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Mirrored from vendurehq#3775 for the Overwatch review demo.

Original author: @dlhck


Description

Adds a new API configuration option cache that allows passing a custom cache backend to Apollo Server for server-side GraphQL response caching. This enables integration with CDNs, Redis, and other caching solutions for improved performance.

The option accepts:

  • 'bounded' - Apollo's built-in bounded cache
  • KeyValueCache<string> - Custom cache implementation (Redis, CDN, etc.)

This feature enables better scalability and performance optimization for GraphQL APIs by allowing custom caching strategies.

Breaking changes

No

Screenshots

You can add screenshots here if applicable.

Checklist

📌 Always:

  • I have set a clear title
  • My PR is small and contains a single feature
  • I have checked my own PR

👍 Most of the time:

  • I have added or updated test cases
  • I have updated the README if needed

Summary by CodeRabbit

  • New Features

    • Server-side GraphQL caching with a configurable cache option (supports built-in bounded cache or custom cache instances).
    • Default configuration now enables bounded caching for improved performance.
  • Tests

    • Added end-to-end tests validating custom cache behavior, repeated queries across Shop and Admin APIs, and cross-API response consistency.

dlhck and others added 5 commits August 23, 2025 21:50
Addressed PR review feedback:
- Replaced custom MockCache implementation with vitest spy functionality
- Removed redundant test suites (bounded cache and without cache)
- Simplified test assertions to focus on successful query execution
- Tests verify custom cache is configured without asserting internal
  Apollo cache usage patterns

🤖 Generated with [Claude Code](https://claude.ai/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