Utilize cache for component filter
Solution:
looking into configuring https://www.apollographql.com/docs/react/caching/cache-field-behavior#specifying-key-arguments might make sense here.
The following discussion from !202657 (merged) should be addressed:
-
@sming-gitlab started a discussion: (+3 comments) Problem
GraphQL caches by query structure + type/ID, not by variables. So changing filters/pagination can return stale cached results instead of fresh data matching the new parameters.
Causing this
🐛 - Select 2 versions > makes request > show 2 dependencies
- Select 1 versions > make request > show 1 dependency
- Section 2 versions again > no request, cache result is incorrect > show 1 dependency
🐛
Solution
Use
network-onlyto force Apollo GraphQL client to bypass the cache and always fetch fresh data from the server.- Select 2 versions > makes request > show 2 dependencies
- Select 1 versions > make request > show 1 dependency
- Section 2 versions again - make request > show 2 dependencies
✅
Edited by 🤖 GitLab Bot 🤖