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 🐛

    version-cache-bug

    1. Select 2 versions > makes request > show 2 dependencies
    2. Select 1 versions > make request > show 1 dependency
    3. Section 2 versions again > no request, cache result is incorrect > show 1 dependency 🐛

    Solution

    Use network-only to force Apollo GraphQL client to bypass the cache and always fetch fresh data from the server.

    solution-not-cache

    1. Select 2 versions > makes request > show 2 dependencies
    2. Select 1 versions > make request > show 1 dependency
    3. Section 2 versions again - make request > show 2 dependencies
Edited by 🤖 GitLab Bot 🤖