diff --git a/packages/app-graphql-playground/src/features/queryHistory/feature.ts b/packages/app-graphql-playground/src/features/queryHistory/feature.ts index 23cd7808418..aaeef129e62 100644 --- a/packages/app-graphql-playground/src/features/queryHistory/feature.ts +++ b/packages/app-graphql-playground/src/features/queryHistory/feature.ts @@ -5,7 +5,8 @@ import { DefaultQueryHistoryRepository } from "./QueryHistoryRepository.js"; export const QueryHistoryRepositoryFeature = createFeature({ name: "QueryHistoryRepository", register(container) { - container.register(DefaultQueryHistoryRepository).inSingletonScope(); + // One per container, so query history is stored per tenant. See PlaygroundRepositoryFeature. + container.register(DefaultQueryHistoryRepository).inContainerScope(); }, resolve(container) { return { diff --git a/packages/app-graphql-playground/src/features/repository/feature.ts b/packages/app-graphql-playground/src/features/repository/feature.ts index da1094c84e2..18851c5fc85 100644 --- a/packages/app-graphql-playground/src/features/repository/feature.ts +++ b/packages/app-graphql-playground/src/features/repository/feature.ts @@ -5,7 +5,9 @@ import { DefaultPlaygroundRepository } from "./PlaygroundRepository.js"; export const PlaygroundRepositoryFeature = createFeature({ name: "PlaygroundRepository", register(container) { - container.register(DefaultPlaygroundRepository).inSingletonScope(); + // One per container, so it reads the tenant-prefixed LocalStorage of the container that resolves + // it. A root singleton would see only the root LocalStorage and share tabs across tenants. + container.register(DefaultPlaygroundRepository).inContainerScope(); }, resolve(container) { return { diff --git a/packages/app-graphql-playground/src/presentation/Playground/feature.ts b/packages/app-graphql-playground/src/presentation/Playground/feature.ts index 8913477c6de..0365c50212f 100644 --- a/packages/app-graphql-playground/src/presentation/Playground/feature.ts +++ b/packages/app-graphql-playground/src/presentation/Playground/feature.ts @@ -5,7 +5,8 @@ import { DefaultPlaygroundPresenter } from "./PlaygroundPresenter.js"; export const PlaygroundPresenterFeature = createFeature({ name: "PlaygroundPresenter", register(container) { - container.register(DefaultPlaygroundPresenter).inSingletonScope(); + // One per container: the presenter reads the per-tenant playground repositories. + container.register(DefaultPlaygroundPresenter).inContainerScope(); }, resolve(container) { return { diff --git a/packages/app-graphql-playground/src/presentation/QueryHistory/feature.ts b/packages/app-graphql-playground/src/presentation/QueryHistory/feature.ts index 83d669a3a2e..e009f102e01 100644 --- a/packages/app-graphql-playground/src/presentation/QueryHistory/feature.ts +++ b/packages/app-graphql-playground/src/presentation/QueryHistory/feature.ts @@ -5,7 +5,8 @@ import { DefaultQueryHistoryPresenter } from "./QueryHistoryPresenter.js"; export const QueryHistoryFeature = createFeature({ name: "QueryHistoryPresenter", register(container) { - container.register(DefaultQueryHistoryPresenter).inSingletonScope(); + // One per container: the presenter reads the per-tenant query history repository. + container.register(DefaultQueryHistoryPresenter).inContainerScope(); }, resolve(container) { return {