Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix updateQuery updater function type (#538)

* fix updateQuery updater function type

* add changeset

* remove fallback

* Update .changeset/famous-ducks-smash.md

Co-Authored-By: Phil Plückthun <phil@kitten.sh>

Co-authored-by: Phil Plückthun <phil@kitten.sh>

authored by

Jovi De Croock
Phil Plückthun
and committed by
GitHub
bcc2ef23 c7d6b459

+8 -2
+5
.changeset/famous-ducks-smash.md
··· 1 + --- 2 + '@urql/exchange-graphcache': patch 3 + --- 4 + 5 + Update the `updater` function type of `cache.updateQuery` to have a return type of `DataFields` so that `__typename` does not need to be defined.
+3 -2
exchanges/graphcache/src/store/store.ts
··· 18 18 UpdatesConfig, 19 19 OptimisticMutationConfig, 20 20 KeyingConfig, 21 + DataFields, 21 22 } from '../types'; 22 23 23 24 import { read, readFragment } from '../operations/query'; ··· 163 164 164 165 updateQuery( 165 166 input: QueryInput, 166 - updater: (data: Data | null) => Data | null 167 + updater: (data: Data | null) => DataFields | null 167 168 ): void { 168 169 const request = createRequest(input.query, input.variables); 169 170 const output = updater(this.readQuery(request as QueryInput)); 170 171 if (output !== null) { 171 - startWrite(this, request, output); 172 + startWrite(this, request, output as Data); 172 173 } 173 174 } 174 175