Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis PR introduces auth-aware cache key generation for the cache package, extending the onQuery handler to include authenticated user IDs in cache hashes when auth is present. It adds development tooling support, updates package metadata, and generates type definitions for test schemas. Changes
Sequence DiagramsequenceDiagram
participant Client
participant Plugin as Cache Plugin
participant AuthModel as Auth Model Info
participant Cache
Client->>Plugin: onQuery({ args, model, operation, proceed, client })
alt client.$auth is present
Plugin->>AuthModel: Extract auth type and ID fields
Plugin->>Plugin: Compute userId from client.$auth
Plugin->>Plugin: Construct hash: { args, model, operation, userId }
else client.$auth is absent
Plugin->>Plugin: Construct hash: { args, model, operation }
end
Plugin->>Cache: Lookup with computed hash
alt Cache hit
Cache-->>Plugin: Return cached result
else Cache miss
Plugin->>Client: proceed() to fetch fresh data
Client-->>Plugin: Return result
Plugin->>Cache: Store result with hash
end
Plugin-->>Client: Return result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes ✨ Finishing touches
🧪 Generate unit tests (beta)
Important Action Needed: IP Allowlist UpdateIf your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:
Failure to add the new IP will result in interrupted reviews. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #10
Summary by CodeRabbit
Release Notes
New Features
Tests
Chores