diff --git a/app/stats/page.tsx b/app/stats/page.tsx index 07dd88e..065c2ee 100644 --- a/app/stats/page.tsx +++ b/app/stats/page.tsx @@ -13,7 +13,7 @@ const STATS_QUERY = gql` } teams { id name iso2 slug - stats { appearances titles wins draws losses goalsFor goalsAgainst winPct } + stats { appearances titles wins draws losses goalsFor goalsAgainst goalDiff winPct } } goalsByMinute { bucket count } confederationStats { confederation appearances titles totalGoals } diff --git a/lib/graphql/client.ts b/lib/graphql/client.ts index 463251f..eda090d 100644 --- a/lib/graphql/client.ts +++ b/lib/graphql/client.ts @@ -7,7 +7,11 @@ let client: InstanceType | 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' } }, }) }