October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

Why Apollo Client Can Show the Previous Tenant’s Data After an Account Switch

Apollo Client may retain query results from a previous account. Learn how resetStore() and clearStore() differ when switching tenants.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Apollo Client can keep query results in its local cache, so a screen may briefly—or persistently—show data fetched under the previous account after a tenant switch. For permission-sensitive data, Apollo’s guidance is to clear cached results when login state changes: use client.resetStore() to clear the cache and refetch active queries, or client.clearStore() to clear it without refetching.

This is a documented failure mode, not a verified report of a particular company incident. The client cache can explain stale rendering; it is not itself proof of a server-side authorization failure.

As an Amazon Associate I earn from qualifying purchases.

Why can Apollo Client show the previous tenant’s data?

Apollo Client stores query results in a local normalized cache. When a query can be satisfied from that cache, the client may return the cached result without making a network request. That improves repeat reads, but it also means cached data can outlive the identity under which it was fetched.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If an application keeps the same Apollo Client instance while switching accounts or tenants, components may still be able to read results associated with the previous identity. They can render those results before new identity-specific requests replace them—or continue to show them if the application does not refetch. This follows from Apollo’s documented cache behavior and its guidance for authentication changes; it is not evidence of a tenant-isolation defect in Apollo itself.

Apollo’s Authentication documentation explicitly advises clearing cached results when login state changes because cached query results may reflect different permissions.

Should you call resetStore() or clearStore() after login?

Both methods clear Apollo Client’s store. The key difference is whether active queries are immediately run again.

Method What it does When it fits
client.resetStore() Clears the store and refetches active queries. Use when mounted components should load data again under the current identity after the authentication transition.
client.clearStore() Clears the store without refetching active queries. Use when queries should not run immediately; the application must decide when they can resume under the new identity.

Apollo documents resetStore() as the straightforward choice after login or logout when cached results may reflect different permissions. Its API reference describes the corresponding behavior of resetStore() and clearStore().

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to handle a tenant or account switch

  1. Complete the identity transition. Update the application’s authentication state and ensure subsequent requests will use the new identity’s credentials.
  2. Clear identity-sensitive cached results. Call client.resetStore() if active queries should refetch under the new identity. If you call client.clearStore() instead, arrange for the relevant queries to run later, once the new identity is in place.
  3. Check what the UI renders during the transition. A cleared cache and refetch do not by themselves define how loading or error states appear. The application should avoid presenting prior-tenant data as if it belonged to the new tenant while fresh results are pending.

Apollo documents the clear-and-refetch behavior, but the exact order for changing credentials, handling outstanding requests, and resuming queries depends on the application. The guidance does not prescribe a universal tenant-switch sequence beyond clearing cached results when login state changes.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Does clearing the client cache enforce tenant security?

No. Cache management controls what the client can reuse and render locally; authorization must still be enforced by the server. Apollo Server’s authentication and authorization guide describes identifying the authenticated user for each request and making authorization decisions using request context. Clearing a browser cache does not replace those checks.

Cache configuration can affect how records are identified and how fields are read or merged. Apollo’s cache configuration documentation covers identifiers and field policies. Those settings are relevant to cache behavior, but they do not remove the need to clear permission-sensitive results when identity changes.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.