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:
@@ -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' } },
|
||||||
|
|||||||
Reference in New Issue
Block a user