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(graphcache): Fix info.parentKey for updaters and optimistic updaters (#3267)

authored by

Phil Pluckthun and committed by
GitHub
f52fa908 50a190ab

+14 -2
+5
.changeset/wild-hotels-kick.md
··· 1 + --- 2 + '@urql/exchange-graphcache': patch 3 + --- 4 + 5 + Fix `info.parentKey` not being correctly set for updaters or optimistic updaters.
+9 -2
exchanges/graphcache/src/operations/write.ts
··· 278 278 // Execute the field-level resolver to retrieve its data 279 279 if (resolver) { 280 280 // We have to update the context to reflect up-to-date ResolveInfo 281 - updateContext(ctx, data, typename, typename, fieldKey, fieldName); 281 + updateContext( 282 + ctx, 283 + data, 284 + typename, 285 + entityKey || typename, 286 + fieldKey, 287 + fieldName 288 + ); 282 289 fieldValue = ensureData(resolver(fieldArgs || {}, ctx.store, ctx)); 283 290 } 284 291 ··· 345 352 ctx, 346 353 data, 347 354 typename, 348 - typename, 355 + entityKey || typename, 349 356 joinKeys(typename, fieldKey), 350 357 fieldName 351 358 );