fix: resolve Apollo cache warning for TeamStats embedded objects

Add merge: true policy for Team.stats so InMemoryCache merges partial
TeamStats selections (e.g. search page) with fuller ones (team/stats pages)
instead of replacing and losing fields. Also align stats page query to
include goalDiff for consistency.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-14 21:12:13 +02:00
parent 6e6e819718
commit a6111d7beb
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -7,7 +7,11 @@ let client: InstanceType<typeof ApolloClient> | null = null
function createClient() {
return new ApolloClient({
link: new HttpLink({ uri: '/api/graphql' }),
cache: new InMemoryCache(),
cache: new InMemoryCache({
typePolicies: {
Team: { fields: { stats: { merge: true } } },
},
}),
defaultOptions: { watchQuery: { fetchPolicy: 'cache-and-network' } },
})
}