Skip to content

feat(apollo): SJIP-1576 memoize apollo client to avoid recreating it on each render#1020

Open
AltefrohneGaelle wants to merge 2 commits into
devfrom
feat/sjip-1576
Open

feat(apollo): SJIP-1576 memoize apollo client to avoid recreating it on each render#1020
AltefrohneGaelle wants to merge 2 commits into
devfrom
feat/sjip-1576

Conversation

@AltefrohneGaelle

@AltefrohneGaelle AltefrohneGaelle commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

feat(apollo): memoize apollo client to avoid recreating it on each render

SJIP-1576

Description

The ApolloClient was being recreated on every render of the Provider, which also
reset the InMemoryCache each time. This PR memoizes the client creation with useMemo,
so it is only recreated when the backend changes.

Changes

  • Wrapped the ApolloClient instantiation in a useMemo
  • The client (and its cache) is now preserved across renders

Acceptance Criterias

  • Verify data loads correctly (FHIR / Arranger)
  • Verify no regression on pages using Apollo

Screenshot or Video

Before

After

lflangis
lflangis previously approved these changes Jun 10, 2026
@netlify

netlify Bot commented Jun 10, 2026

Copy link
Copy Markdown

Deploy Preview for include-qa ready!

Name Link
🔨 Latest commit a98e9ae
🔍 Latest deploy log https://app.netlify.com/projects/include-qa/deploys/6a2b2f41cc20be0008fcfaf7
😎 Deploy Preview https://deploy-preview-1020--include-qa.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants