chore(trading): clear apollo warnings (#4120)

This commit is contained in:
Matthew Russell 2023-06-16 01:50:22 -07:00 committed by GitHub
parent 5a90ebe12e
commit 35896a9cf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 8 deletions

View File

@ -49,6 +49,9 @@ export const AppLoader = ({ children }: { children: ReactNode }) => {
const cacheConfig: InMemoryCacheConfig = { const cacheConfig: InMemoryCacheConfig = {
typePolicies: { typePolicies: {
Statistics: {
merge: true,
},
Account: { Account: {
keyFields: false, keyFields: false,
fields: { fields: {
@ -80,12 +83,6 @@ const cacheConfig: InMemoryCacheConfig = {
ERC20: { ERC20: {
keyFields: ['contractAddress'], keyFields: ['contractAddress'],
}, },
PositionUpdate: {
keyFields: false,
},
AccountUpdate: {
keyFields: false,
},
Party: { Party: {
keyFields: false, keyFields: false,
}, },
@ -95,8 +92,16 @@ const cacheConfig: InMemoryCacheConfig = {
Fees: { Fees: {
keyFields: false, keyFields: false,
}, },
// Don't cache order update as this subscription result gets merged into the main order cache // The folling types are cached by the data provider and not by apollo
// We don't need to write these to the cache at all PositionUpdate: {
keyFields: false,
},
TradeUpdate: {
keyFields: false,
},
AccountUpdate: {
keyFields: false,
},
OrderUpdate: { OrderUpdate: {
keyFields: false, keyFields: false,
}, },

View File

@ -94,6 +94,7 @@ export const accountsOnlyDataProvider = makeDataProvider<
update, update,
getData, getData,
getDelta, getDelta,
fetchPolicy: 'no-cache',
}); });
export interface AccountFields extends Account { export interface AccountFields extends Account {

View File

@ -197,6 +197,7 @@ const positionsDataProvider = makeDataProvider<
getDelta: (subscriptionData: PositionsSubscriptionSubscription) => getDelta: (subscriptionData: PositionsSubscriptionSubscription) =>
subscriptionData.positions, subscriptionData.positions,
getSubscriptionVariables, getSubscriptionVariables,
fetchPolicy: 'no-cache',
}); });
const positionDataProvider = makeDerivedDataProvider< const positionDataProvider = makeDerivedDataProvider<

View File

@ -99,6 +99,7 @@ export const tradesProvider = makeDataProvider<
append, append,
first: MAX_TRADES, first: MAX_TRADES,
}, },
fetchPolicy: 'no-cache',
getSubscriptionVariables: ({ marketId }) => ({ marketId }), getSubscriptionVariables: ({ marketId }) => ({ marketId }),
}); });