Skip to content

Code Insights: Adopt Apollo cache for backend code insights fetching

Administrator requested to merge vk/adopt-apollo-for-code-insights-fetching into main

Created by: vovakulikov

Closes part of https://github.com/sourcegraph/sourcegraph/issues/24236 Closes https://github.com/sourcegraph/sourcegraph/issues/25170 Closes https://github.com/sourcegraph/sourcegraph/issues/24788

Context

In this PR https://github.com/sourcegraph/sourcegraph/pull/25236, we have introduced a custom Apollo link that allows to us preserve parallel insights loading.

This PR adopts this Apollo link and changes our UI in order to support Apollo optimistic cache (cache-and-network loading strategy).

Note that our FE aka Built-in insights still work with our custom solution for concurrent requests run - useParallelRequest It's because these insights require 2 search API calls per insight. Our first implementation of apollo link concurrency works only with 1 request per consumer and doesn't support a sequence of requests per consumer. We will get there either by moving these insights and request sequence to our BE or implementation additional logic in Apollo link in a separate PR.

Work in progress

Merge request reports

Loading