Course lesson
Create a New Cache on Every GraphQL Request Using Apollo Context
If a cache persists between requests, a logged-in user could cache some sensitive data that guest users could access by mistake
- Duration
- 1 min
- Access
- Included
- Transcript
- Retained from source evidence
If a cache persists between requests, a logged-in user could cache some sensitive data that guest users could access by mistake
An easy way to prevent this is to make new DataLoaders on every request using Apollo's context method, which also makes it easy to inject the DataLoader into any resolver