sourcegraph/client/http-client
Valery Bugakov 218338f1cd
storm: make Apollo Cache persistor use preloaded data (#48706)
Addresses [the
issue](https://github.com/sourcegraph/sourcegraph/pull/48463#issuecomment-1454894102)
spotted by @vovakulikov in
https://github.com/sourcegraph/sourcegraph/pull/48463.

- The Apollo Client cache persistor is updated to use the preloaded data
on reads instead of only data available in `localStorage`.
- The `temporarySettings` query is no longer persisted to the
`localStorage`.

## Test plan

Use repro instructions shared by @vovakulikov:

1. Read a temporary settings field,
2. See one value of this field (let's say we have a boolean flag, and
its value is `true`).
3. Change this flag value from a different browser or via the API
console (editTemporalSettings mutation).
4. Refresh the page and see that `window.context.temporarySettings` has
a correct new value.
5. But `useTemporarySettings` returns the old value because it's using a
cached value from the local storage that persistMapper provided for the
Apollo cache.
2023-03-07 05:00:25 +00:00
..
src storm: make Apollo Cache persistor use preloaded data (#48706) 2023-03-07 05:00:25 +00:00
.eslintignore [SG-28893] refactor: extract graphql folder into a new http-client package. (#29346) 2022-01-13 18:40:35 +01:00
.eslintrc.js [SG-28893] refactor: extract graphql folder into a new http-client package. (#29346) 2022-01-13 18:40:35 +01:00
babel.config.js [SG-28893] refactor: extract graphql folder into a new http-client package. (#29346) 2022-01-13 18:40:35 +01:00
BUILD.bazel bazel: add bazel build,tests for client/* (#46193) 2023-02-28 20:46:03 -08:00
jest.config.js [SG-28893] refactor: extract graphql folder into a new http-client package. (#29346) 2022-01-13 18:40:35 +01:00
OWNERS Update FPT code owners ping (#44545) 2022-11-17 07:21:49 -05:00
package.json web: sync TS project refenreces (#46407) 2023-01-16 18:55:10 -08:00
README.md web: deprecate requestGraphQL and update http-client README (#47597) 2023-02-14 18:51:01 -08:00
tsconfig.json web: fix pnpm-lock issue (#47478) 2023-02-09 22:04:31 -08:00

Http Client

Generic logic for sending and handling HTTP requests from our client applications.

Use the getGraphQLClient client utility to create an app-specific instance of the Apollo Client, which is the recommended way to interact with Sourcegraph API from web applications.