fix: suppress Apollo cache warnings for Match.team1 / Match.team2

Different queries fetch Team with different field sets (some include slug,
others don't). merge: true tells InMemoryCache to combine fields rather
than replace, avoiding the "cache data may be lost" warning.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-14 22:18:47 +02:00
parent 11a89204af
commit de03dfeadb
+1
View File
@@ -10,6 +10,7 @@ function createClient() {
cache: new InMemoryCache({ cache: new InMemoryCache({
typePolicies: { typePolicies: {
Team: { fields: { stats: { merge: true } } }, Team: { fields: { stats: { merge: true } } },
Match: { fields: { team1: { merge: true }, team2: { merge: true } } },
}, },
}), }),
defaultOptions: { watchQuery: { fetchPolicy: 'cache-and-network' } }, defaultOptions: { watchQuery: { fetchPolicy: 'cache-and-network' } },