Skip to content
qt

Advanced

Scope Isolation

Two panels share the same data layer but use different tag namespaces. Adding to Tenant A only glows Tenant A's panel — Tenant B remains unaffected and vice versa.

What to watch for

  • Add a todo in Tenant A — only the left panel glows green
  • Add a note in Tenant B — only the right panel glows green
  • Both panels use the same server functions but different query keys and tags
  • Scope isolation ensures one tenant's mutations never pollute another's cache
View Source
A

Tenant A

todos.list
  • No items yet.
B

Tenant B

notes.list
  • No items yet.

Tag namespace isolation

Tenant A scope

Tag: todos.list
Query key: ["scopes", "tenant-a"]
Data: Todos store

Tenant B scope

Tag: notes.list
Query key: ["scopes", "tenant-b"]
Data: Notes store

Because each tenant uses a distinct tag, the server can invalidate only the affected tenant's queries. In a real multi-tenant app you would use a scope parameter (e.g. tenantId) when calling invalidateTags.