diff --git a/apps/trading/components/app-loader/app-loader.tsx b/apps/trading/components/app-loader/app-loader.tsx index 1a9a82094..dc08f4895 100644 --- a/apps/trading/components/app-loader/app-loader.tsx +++ b/apps/trading/components/app-loader/app-loader.tsx @@ -49,6 +49,9 @@ export const AppLoader = ({ children }: { children: ReactNode }) => { const cacheConfig: InMemoryCacheConfig = { typePolicies: { + Statistics: { + merge: true, + }, Account: { keyFields: false, fields: { @@ -80,12 +83,6 @@ const cacheConfig: InMemoryCacheConfig = { ERC20: { keyFields: ['contractAddress'], }, - PositionUpdate: { - keyFields: false, - }, - AccountUpdate: { - keyFields: false, - }, Party: { keyFields: false, }, @@ -95,8 +92,16 @@ const cacheConfig: InMemoryCacheConfig = { Fees: { keyFields: false, }, - // Don't cache order update as this subscription result gets merged into the main order cache - // We don't need to write these to the cache at all + // The folling types are cached by the data provider and not by apollo + PositionUpdate: { + keyFields: false, + }, + TradeUpdate: { + keyFields: false, + }, + AccountUpdate: { + keyFields: false, + }, OrderUpdate: { keyFields: false, }, diff --git a/libs/accounts/src/lib/accounts-data-provider.ts b/libs/accounts/src/lib/accounts-data-provider.ts index 3b6d1068e..2ccdd3e07 100644 --- a/libs/accounts/src/lib/accounts-data-provider.ts +++ b/libs/accounts/src/lib/accounts-data-provider.ts @@ -94,6 +94,7 @@ export const accountsOnlyDataProvider = makeDataProvider< update, getData, getDelta, + fetchPolicy: 'no-cache', }); export interface AccountFields extends Account { diff --git a/libs/positions/src/lib/positions-data-providers.ts b/libs/positions/src/lib/positions-data-providers.ts index c13ba32d7..98be1aa4f 100644 --- a/libs/positions/src/lib/positions-data-providers.ts +++ b/libs/positions/src/lib/positions-data-providers.ts @@ -197,6 +197,7 @@ const positionsDataProvider = makeDataProvider< getDelta: (subscriptionData: PositionsSubscriptionSubscription) => subscriptionData.positions, getSubscriptionVariables, + fetchPolicy: 'no-cache', }); const positionDataProvider = makeDerivedDataProvider< diff --git a/libs/trades/src/lib/trades-data-provider.ts b/libs/trades/src/lib/trades-data-provider.ts index 720813b29..a448bce77 100644 --- a/libs/trades/src/lib/trades-data-provider.ts +++ b/libs/trades/src/lib/trades-data-provider.ts @@ -99,6 +99,7 @@ export const tradesProvider = makeDataProvider< append, first: MAX_TRADES, }, + fetchPolicy: 'no-cache', getSubscriptionVariables: ({ marketId }) => ({ marketId }), });