@urql/exchange-graphcache#
8.1.0#
Minor Changes#
- Add possibleTypes config for deterministic fragment matching Submitted by @xuanduc987 (See #3805)
8.0.0#
Patch Changes#
7.2.4#
Patch Changes#
- ⚠️ Fix compatibility with Typescript >5.5 (See: https://github.com/0no-co/graphql.web/pull/49) Submitted by @andreisergiu98 (See #3730)
- Updated dependencies (See #3773, #3767, #3730, and #3770)
- @urql/core@5.1.2
7.2.3#
Patch Changes#
- Omit minified files and sourcemaps'
sourcesContentin published packages Submitted by @kitten (See #3755) - Updated dependencies (See #3755)
- @urql/core@5.1.1
7.2.2#
Patch Changes#
- Remove addMetadata transform where we'd strip out metadata for production environments, this particularly affects OperationResult.context.metadata.cacheOutcome Submitted by @JoviDeCroock (See #3744)
7.2.1#
Patch Changes#
7.2.0#
Minor Changes#
- Allow @_required directive to be used in combination with configured schemas Submitted by @AndrewIngram (See #3685)
7.1.3#
Patch Changes#
- ⚠️ fix bug that mutation would cause dependent operations and reexecuting operations to become the same set Submitted by @xuanduc987 (See #3665)
7.1.2#
Patch Changes#
- Disregard write-only operation when fragment-matching with schema awareness Submitted by @JoviDeCroock (See #3621)
7.1.1#
Patch Changes#
- ⚠️ Fix where we would incorrectly match all fragment concrete types because they belong to the abstract type Submitted by @JoviDeCroock (See #3603)
7.1.0#
Minor Changes#
- Mark
@urql/coreas a peer dependency as well as a regular dependency Submitted by @kitten (See #3579)
7.0.2#
Patch Changes#
- Only record dependencies that are changing data, this will reduce the amount of operations we re-invoke due to network-only/cache-and-network queries and mutations Submitted by @JoviDeCroock (See #3564)
7.0.1#
Patch Changes#
- When invoking the automatic creation updater ignore the entity we are currently on in the mutation Submitted by @JoviDeCroock (See #3560)
7.0.0#
Major Changes#
- Add a default updater for mutation fields who are lacking an updater and where the returned entity is not present in the cache Submitted by @JoviDeCroock (See #3518)
- Remove deprecated
resolveFieldByKey, usecache.resolveinstead Submitted by @JoviDeCroock (See #3520)
Minor Changes#
- Track abstract types being written so that we have a more reliable way of matching abstract fragments Submitted by @JoviDeCroock (See #3548)
Patch Changes#
- ⚠️ Fix
invalidatenot applying when using a string to invalidate an entity Submitted by @JoviDeCroock (See #3545) - Upgrade
@0no-co/graphql.webto1.0.5Submitted by @kitten (See #3553) - Updated dependencies (See #3520, #3553, and #3520)
- @urql/core@5.0.0
6.5.0#
Minor Changes#
- Allow
@_optionaland@_requiredto be placed on fragment definitions and inline fragments Submitted by @JoviDeCroock (See #3502) - Track list of entity keys for a given type name. This enables enumerating and invalidating all entities of a given type within the normalized cache Submitted by @JoviDeCroock (See #3501)
Patch Changes#
- Prevent
@deferfrom being applied in child field selections. Previously, a child field (i.e. a nested field) under a@defer-ed fragment would also become optional, which was based on a prior version of the DeferStream spec which didn't require deferred fields to be delivered as a group Submitted by @kitten (See #3517) - ⚠️ Fix
store.resolve()returning the exact link array that’s used by the cache. This can lead to subtle bugs when a user mutates the result returned bycache.resolve(), since this directly mutates what’s in the cache at that layer Submitted by @kitten (See #3516) - Updated dependencies (See #3514, #3505, #3499, and #3515)
- @urql/core@4.3.0
6.4.1#
Patch Changes#
- Set
stale: trueon cache results, even if a reexecution has been blocked by the loop protection, if the operation is already pending and in-flight Submitted by @kitten (See #3493) - ⚠️ Fix
@deferstate leaking into following operations Submitted by @kitten (See #3497)
6.4.0#
Minor Changes#
- Allow the user to debug cache-misses by means of the new
loggerinterface on thecacheExchange. A field miss will dispatch adebuglog when it's not marked with@_optionalor when it's non-nullable in theschemaSubmitted by @JoviDeCroock (See #3446) - Add
onCacheHydratedas an option for theStorageAdapterSubmitted by @JoviDeCroock (See #3428) - Add optional
loggerto the options, this allows you to filter out warnings or disable them all together Submitted by @JoviDeCroock (See #3444)
6.3.3#
Patch Changes#
- ⚠️ Fix a typo that caused an inverted condition, for checking owned data, to cause incorrect results when handling
nullvalues and encountering them first Submitted by @kitten (See #3371)
6.3.2#
Patch Changes#
- ⚠️ Fix extra variables in mutation results regressing by a change made in #3317. The original operation wasn't being preserved anymore Submitted by @kitten (See #3356)
6.3.1#
Patch Changes#
- Reset
partialresult marker when reading from selections when a child value sees a cache miss. This only affects resolvers on child values enablinginfo.partialwhile a parent may abort early instead Submitted by @kitten (See #3340) - ⚠️ Fix
@_optionaldirective not settinginfo.partial = trueon cache miss and fix usage ofinfo.parentKeyandinfo.parentFieldKeyusage in default directives Submitted by @kitten (See #3338) - Replace implementation for
@_optionaland@_requiredwith built-in handling inside cache reads to allow@_optionalto work for nested selection sets Submitted by @kitten (See #3341)
6.3.0#
Minor Changes#
- Allow scalar values on the parent to be accessed from
parent[info.fieldName]consistently. Prior to this changeparent[fieldAlias]would get populated, which wouldn’t always result in a field that’s consistently accessible Submitted by @kitten (See #3336) - Allow
cache.resolveto returnundefinedwhen a value is not cached to make it easier to cause a cache miss in resolvers. Reminder: Returningundefinedfrom a resolver means a field is uncached, while returningnullmeans that a field’s value isnullwithout causing a cache miss Submitted by @kitten (See #3333)
Patch Changes#
- Record a dependency when
__typenamefield is read. This removes a prior, outdated exception to avoid confusion when usingcache.resolve(entity, '__typename')which doesn't cause the cache to record a dependency Submitted by @kitten (See #3335) - ⚠️ Fix cases where
ResolveInfo’sparentFieldKeywas incorrectly populated with a key that isn’t a field key (allowing forcache.resolve(info.parentKey, info.parentFieldKey)to be possible) but was instead set toinfo.parentKeycombined with the field key Submitted by @kitten (See #3336)
6.2.0#
Minor Changes#
- Implement local directives. It’s now possible to add client-only directives to queries by adding them to the
cacheExchange’s newdirectivesoption. Directives accept an object of their arguments and return a resolver. When a field is annotated with a resolver, e.g.@_optionalor@_required, their resolvers from thedirectivesconfig are executed. This means it’s now possible to use@_relayPaginationfor example, by passing adding therelayPaginationhelper to the config. Due to the change in #3317, any directive in queries that’s prefixed with an underscore (_) is only visible to Graphcache and not the API. Submitted by undefined (See https://github.com/urql-graphql/urql/pull/3306)
Patch Changes#
- Use new
FormattedNode/formatDocumentfunctionality added to@urql/coreto slightly speed up directive processing by using the client-side_directivesdictionary thatformatDocumentadds Submitted by @kitten (See #3317) - Allow
offlineExchangeto once again issue all request policies, instead of mapping them tocache-first. When replaying operations after rehydrating it will now prioritise network policies, and before rehydrating receiving a network result will prevent a network request from being issued again Submitted by @kitten (See #3308) - Add
OperationContext.optimisticflag as an internal indication on whether a mutation triggered an optimistic update in@urql/exchange-graphcache'scacheExchangeSubmitted by @kitten (See #3308) - Updated dependencies (See #3317 and #3308)
- @urql/core@4.1.0
6.1.4#
Patch Changes#
- ⚠️ Fix untranspiled class property initializer syntax being leftover in build output. (Regression in #3053) Submitted by @kitten (See #3275)
6.1.3#
Patch Changes#
- ⚠️ Fix
info.parentKeynot being correctly set for updaters or optimistic updaters Submitted by @kitten (See #3267)
6.1.2#
Patch Changes#
- Make "Invalid undefined" warning heuristic smarter and allow for partial optimistic results. Previously, when a partial optimistic result would be passed, a warning would be issued, and in production, fields would be deleted from the cache. Instead, we now only issue a warning if these fields aren't cached already Submitted by @kitten (See #3264)
- Optimistic mutation results should never result in dependent operations being blocked Submitted by @kitten (See #3265)
6.1.1#
Patch Changes#
- ⚠️ Fix torn down queries not being removed from
offlineExchange’s failed queue on rehydration Submitted by @kitten (See #3236)
6.1.0#
Minor Changes#
Patch Changes#
- Update build process to generate correct source maps Submitted by @kitten (See #3201)
- Prevent
offlineExchangefrom issuing duplicate operations Submitted by @kitten (See #3200) - ⚠️ Fix reference equality not being preserved. This is a fix on top of #3165, and was previously not addressed to avoid having to test for corner cases that are hard to cover. If you experience issues with this fix, please let us know Submitted by @kitten (See #3228)
- Retry operations against offline cache and stabilize timing of flushing failed operations queue after rehydrating the storage data Submitted by @kitten (See #3196)
6.0.4#
Patch Changes#
- ⚠️ Fix missing cache updates, when a query that was previously torn down restarts and retrieves results from the cache. In this case a regression caused cache updates to not be correctly applied to the queried results, since the operation wouldn’t be recognised properly Submitted by @kitten (See #3193)
6.0.3#
Patch Changes#
6.0.2#
Patch Changes#
- Prevent reusal of incoming API data in Graphcache’s produced (“owned”) data. This prevents us from copying the
__typenameand other superfluous fields Submitted by @kitten (See #3165) - ⚠️ Fix regression which caused
@deferdirectives from becoming “sticky” and causing every subsequent cache read to be treated as if the field was deferred Submitted by @kitten (See #3167) - Apply
hasNext: trueand fallthrough logic to cached queries that contain deferred, uncached fields. Deferred query results will now be fetched against the API correctly, even if prior requests have been incomplete Submitted by @kitten (See #3163) - ⚠️ Fix
offlineExchangeduplicating offline mutations in failed queue Submitted by @kitten (See #3158)
6.0.1#
Patch Changes#
6.0.0#
Major Changes#
- Remove dependence on
graphqlpackage and replace it with@0no-co/graphql.web, which reduces the default bundlesize impact ofurqlpackages to a minimum. All types should remain compatible, even if you usegraphqlelsewhere in your app, and if other dependencies are usinggraphqlyou may alias it tographql-web-liteSubmitted by @kitten (See #3097) - Update
OperationResult.hasNextandOperationResult.staleto be required fields. If you have a custom exchange creating results, you'll have to add these fields or use themakeResult,mergeResultPatch, ormakeErrorResulthelpers Submitted by @kitten (See #3061)
Minor Changes#
- Update exchanges to drop redundant
sharecalls, since@urql/core’scomposeExchangesutility now automatically does so for us Submitted by @kitten (See #3082)
Patch Changes#
- ⚠️ Fix source maps included with recently published packages, which lost their
sourcesContent, including additional source files, and had incorrect paths in some of them Submitted by @kitten (See #3053) - Upgrade to
wonka@^6.3.0Submitted by @kitten (See #3104) - Restore variables correctly on mutations Submitted by @JoviDeCroock (See #3046)
- Use
stringifyDocumentinofflineExchangerather thanprintand serializeoperation.extensionsas needed Submitted by @kitten (See #3094) - Add missing
hasNextandstalepassthroughs on caching exchanges Submitted by @kitten (See #3059) - Add TSDocs for all exchanges, documenting API internals Submitted by @kitten (See #3072)
- Updated dependencies (See #3101, #3033, #3054, #3053, #3060, #3081, #3039, #3104, #3082, #3097, #3061, #3055, #3085, #3079, #3087, #3059, #3055, #3057, #3050, #3062, #3051, #3043, #3063, #3054, #3102, #3097, #3106, #3058, and #3062)
- @urql/core@4.0.0
5.2.0#
Minor Changes#
- Add
isOfflineErroroption to theofflineExchangeto allow it to be customized to different conditions to determine whether an operation has failed because of a network error Submitted by @robertherber (See #3020) - Allow
updatesconfig to react to arbitrary type updates other than justMutationandSubscriptionfields. You’ll now be able to write updaters that react to any entity field being written to the cache, which allows for more granular invalidations. Note: If you’ve previously usedupdates.Mutationandupdated.Subscriptionwith a custom schema with custom root names, you‘ll get a warning since you’ll have to update yourupdatesconfig to reflect this. This was a prior implementation mistake! Submitted by @kitten (See #2979)
Patch Changes#
- ⚠️ Fix regression which caused partial results, whose refetches were blocked by the looping protection, to not have a
stale: trueflag added to them. This is a regression from https://github.com/urql-graphql/urql/pull/2831 and only applies tocacheExchanges that had theschemaoption set Submitted by @kitten (See #2999) - Add
invariantto data layer that prevents cache writes during cache query operations. This preventscache.writeFragment,cache.updateQuery, andcache.linkfrom being called inresolversfor instance Submitted by @kitten (See #2978) - Updated dependencies (See #3007, #2962, #3007, #3015, and #3022)
- @urql/core@3.2.0
5.0.9#
Patch Changes#
- ⚠️ Fix potential data loss in
offlineExchangethat's caused whenonOnlinetriggers and flushes mutation queue before the mutation queue is used, by @trcoffman (See #2945) - Patch message for
(16) Heuristic Fragment Matching, by @inokawa (See #2923) - Patch message for (19) Can't generate a key for invalidate(...) error, by @inokawa (See #2918)
5.0.8#
Patch Changes#
- ⚠️ Fix operation being blocked for looping due to it not cancelling the looping protection when a
teardownis received. This bug could be triggered when a shared query operation triggers again and causes a cache miss (e.g. due to an error). The re-execution of the operation would then be blocked as Graphcache considered it a "reexecution loop" rather than a legitimate execution triggered by the UI. (See https://github.com/urql-graphql/urql/pull/2737 for more information), by @kitten (See #2876)
5.0.7#
Patch Changes#
- ⚠️ Fix type-generation, with a change in TS/Rollup the type generation took the paths as src and resolved them into the types dir, by @JoviDeCroock (See #2870)
- Updated dependencies (See #2872, #2870, and #2871)
- @urql/core@3.1.1
5.0.6#
Patch Changes#
- Solve issue where partial data could cause loops between related queries, by @JoviDeCroock (See #2831)
- Add skipping of garbage collection runs when the cache is waiting for optimistic, deferred or other results in layers. This means that we only take an opportunity to run garbage collection after results have settled and are hence decreasing the chance of hogging the event loop when a run isn't needed, by @kitten (See #2862)
- ⚠️ Fix a deadlock condition in Graphcache's layers, which is caused by subscriptions (or other deferred layers) starting before one-off mutation layers. This causes the mutation to not be completed, which keeps its data preferred above the deferred layer. That in turn means that layers stop squashing, which causes new results to be missing indefinitely, when they overlap, by @kitten (See #2861)
- Updated dependencies (See #2843, #2847, #2850, and #2846)
- @urql/core@3.1.0
5.0.5#
Patch Changes#
- Set operations when updating the cache with a result, by @JoviDeCroock (See #2782)
5.0.4#
Patch Changes#
- Ensure we aren't eagerly removing layers that are caused by subscriptions, by @JoviDeCroock (See #2771)
5.0.3#
Patch Changes#
- ⚠️ Fix case where a mutation would also be counted in the loop-protection, this prevented partial queries from initiating refetches, by @JoviDeCroock (See #2761)
- Updated dependencies (See #2758 and #2762)
- @urql/core@3.0.5
5.0.2#
Patch Changes#
- Preserve the original
DocumentNodeAST when updating the cache, to prevent results after a network request from differing and breaking referential equality due to added__typenamefields, by @kitten (See #2736) - ⚠️ Fix optimistic mutations containing partial results (
undefinedfields), which previously actually caused a hidden cache miss, which may then affect a subsequent non-optimistic mutation result, by @kitten (See #2740) - Prevent cache misses from causing infinite network requests from being issued, when two operations manipulate each other while experiencing cache misses or are partially uncacheable, by @kitten (See #2737)
- ⚠️ Fix operation identities preventing users from deeply cloning operation contexts. Instead, we now use a client-wide counter (rolling over as needed).
While this changes an internal data structure in
@urql/coreonly, this change also affects theofflineExchangein@urql/exchange-graphcachedue to it relying on the identity being previously an object rather than an integer, by @kitten (See #2732) - ⚠️ Fix referential equality preservation in Graphcache failing after API results, due to a typo writing the API result rather than the updated cache result, by @kitten (See #2741)
- Updated dependencies (See #2691, #2692, and #2732)
- @urql/core@3.0.4
5.0.1#
Patch Changes#
- Adjust timing of when an introspected schema will be processed into field maps, interface maps, and union type maps. By making this lazy we can avoid excessive work when these maps aren't actually ever used, by @kitten (See #2640)
5.0.0#
Major Changes#
- Goodbye IE11! 👋 This major release removes support for IE11. All code that is shipped will be transpiled much less and will not be ES5-compatible anymore, by @kitten (See #2504)
- Prevent cache-hydration from buffering operations, by @JoviDeCroock (See #2612)
- Implement stricter variables types, which require variables to always be passed and match TypeScript types when the generic is set or inferred. This is a breaking change for TypeScript users potentially, unless all types are adhered to, by @kitten (See #2607)
- Upgrade to Wonka v6 (
wonka@^6.0.0), which has no breaking changes but is built to target ES2015 and comes with other minor improvements. The library has fully been migrated to TypeScript which will hopefully help with making contributions easier!, by @kitten (See #2504)
Minor Changes#
- Remove the
babel-plugin-modular-graphqlhelper, this because the graphql package hasn't converted to ESM yet which gives issues in node environments, by @JoviDeCroock (See #2551) - Allow passing in
fragmentNameforwriteandreadoperations, by @JoviDeCroock (See #2609)
Patch Changes#
- Graphcache's
optimisticoption now accepts optimistic mutation resolvers that return fields by name rather than alias. Previously, depending on which mutation was run, the optimistic resolvers would read your optimistic data by field alias (i.e. "alias" foralias: idrather than "id"). Instead, optimistic updates now correctly use field names and allow you to also pass resolvers as values on your optimistic config, by @JoviDeCroock (See #2616) - Updated dependencies (See #2551, #2504, #2619, #2607, and #2504)
- @urql/core@3.0.0
4.4.3#
Patch Changes#
- Correctly reorder optimistic layers when we see repeated keys coming in, by @JoviDeCroock (See #2489)
4.4.2#
Patch Changes#
- Keep track of mutations in the offline exchange so we can accurately recreate the original variables, there could be more variables for use in updater functions which we strip away in graphCache before sending to the API, by @JoviDeCroock (See #2472)
4.4.1#
Patch Changes#
- Switch
isFragmentHeuristicallyMatching()to always returntruefor writes, so that we give every fragment a chance to be applied and to write to the cache, by @kitten (See #2455) - ⚠️ Fix default storage persisting data after
clear()was called on it, by @JoviDeCroock (See #2458) - Updated dependencies (See #2446, #2456, and #2457)
- @urql/core@2.5.0
4.4.0#
Minor Changes#
- Fix issues with continuously updating operations (i.e. subscriptions and
hasNext: truequeries) by shifting their layers in Graphcache behind those that are still awaiting a result. This causes continuous updates to not overwrite one-off query results while still keeping continuously updating operations at the highest possible layer, by @kitten (See #2419)
Patch Changes#
- ⚠️ Fix ignore empty relay edges when using the
relayPaginationresolver, by @tgriesser (See #2431) - Prevent creating unnecessary layers, which should improve performance slightly, by @kitten (See #2419)
4.3.6#
Patch Changes#
- Extend peer dependency range of
graphqlto include^16.0.0. As always when upgrading across many packages ofurql, especially including@urql/corewe recommend you to deduplicate dependencies after upgrading, usingnpm dedupeornpx yarn-deduplicate, by @kitten (See #2133) - Updated dependencies (See #2133)
- @urql/core@2.3.6
4.3.5#
Patch Changes#
- ⚠️ Fix regression from #1869 that caused nullable lists to always cause a cache miss, if schema awareness is enabled, by @kitten (See #1983)
- Updated dependencies (See #1985)
- @urql/core@2.3.3
4.3.4#
Patch Changes#
- Improve perf by using String.indexOf in getField, by @JoviDeCroock (See #1957)
- Updated dependencies (See #1944)
- @urql/core@2.3.2
4.3.3#
Patch Changes#
- Remove
hasNext: trueflag from stale responses. This was erroneously added in debugging, but leads to stale responses being marked withhasNext, which means thededupExchangewill keep waiting for further network responses, by @kitten (See #1911)
4.3.2#
Patch Changes#
- Cleanup the previous
onOnlineevent-listener when called again, by @JoviDeCroock (See #1896)
4.3.1#
Patch Changes#
- ⚠️ Fix previous results'
nullvalues spilling into the next result that Graphcache issues, which may prevent updates from being issued until the query is reexecuted. This was affecting anynulllinks on data, and any queries that were issued before non-optimistic mutations, by @kitten (See #1885) - Updated dependencies (See #1870 and #1880)
- @urql/core@2.3.1
4.3.0#
Minor Changes#
- Improve referential equality of deeply queried objects from the normalised cache for queries. Each query operation will now reuse the last known result and only incrementally change references as necessary, scanning over the previous result to identify whether anything has changed.
This should help improve the performance of processing updates in UI frameworks (e.g. in React with
useMemoorReact.memo). (See #1859) - Add experimental support for
@deferand@streamresponses for GraphQL. This implements the "GraphQL Defer and Stream Directives" and "Incremental Delivery over HTTP" specifications. If a GraphQL API supportsmultipart/mixedresponses for deferred and streamed delivery of GraphQL results,@urql/core(and all its derived fetch implementations) will attempt to stream results. This is only supported on browsers supporting streamed fetch responses, which excludes IE11. The implementation of streamed multipart responses is derived frommerosby@maraisr, and is subject to change if the RFCs end up changing, by @kitten (See #1854)
Patch Changes#
- ⚠️ Fix missing values cascading into lists causing a
nullitem without the query being marked as stale and fetched from the API. This would happen in schema awareness when a required field, which isn't cached, cascades into a nullable list, by @kitten (See #1869) - Updated dependencies (See #1854)
- @urql/core@2.3.0
4.2.1#
Patch Changes#
- ⚠️ Fix issue where operations that get dispatched synchronously after the cache restoration completes get forgotten, by @JoviDeCroock (See #1789)
4.2.0#
Minor Changes#
Patch Changes#
- Type the
relayPaginationandsimplePaginationhelpers return value asResolver<any, any, any>as there's no way to match them consistently to either generated or non-generated resolver types anymore, by @kitten (See #1778) - Updated dependencies (See #1776 and #1755)
- @urql/core@2.1.5
4.1.4#
Patch Changes#
- Apply
bivarianceHackin thegraphcachetypes to better support code-generated configs, by @JoviDeCroock (See #1687) - Updated dependencies (See #1709)
- @urql/core@2.1.4
4.1.3#
Patch Changes#
- ⚠️ Fix: add the
ENTRIES_STORE_NAMEto the clear transaction, by @JoviDeCroock (See #1685) - Updated dependencies (See #1695)
- @urql/core@2.1.3
4.1.2#
Patch Changes#
- Loosen type constraint on
ScalarObjectto account for custom scalar deserialization likeDateforDateTimes, by @kitten (See #1648) - Loosen the typing constraint on the cacheExchange generic, by @JoviDeCroock (See #1675)
4.1.1#
Patch Changes#
- ⚠️ Fix an edge-case for which an introspection query during runtime could fail when schema-awareness was enabled in Graphcache, since built-in types weren't recognised as existent, by @kitten (See #1631)
4.1.0#
Minor Changes#
- Add
cache.link(...)method to Graphcache. This method may be used in updaters to update links in the cache. It is hence the writing-equivalent ofcache.resolve(), which previously didn't have any equivalent as such, which meant that onlycache.updateQueryorcache.writeFragmentcould be used, even to update simple relations, by @JoviDeCroock (See #1551) - Add on a generic to
cacheExchangeandofflineExchangefor future, experimental type-generation support, by @JoviDeCroock (See #1562)
Patch Changes#
- ⚠️ Fix up internal types in Graphcache to improve their accuracy for catching more edge cases in its implementation. This only affects you if you previously imported any type related to
ScalarObjectfrom Graphcache which now is a more opaque type. We've also adjusted theNullArraytypes to be potentially nested, since lists in GraphQL can be nested arbitarily, which we were covering but didn't reflect in our types, by @kitten (See #1591) - Remove closure-compiler from the build step (See #1570)
- ⚠️ Fix list items being returned as
nulleven for non-nullable lists, when the entities are missing in the cache. This could happen when a resolver was added returning entities or their keys. This behaviour is now (correctly) only applied to partial results with schema awareness, by @JoviDeCroock (See #1566) - Allow for the schema subscription and mutationType to be null, by @JoviDeCroock (See #1530)
- Updated dependencies (See #1570, #1509, #1600, and #1515)
- @urql/core@2.1.0
4.0.0#
Major Changes#
- Add improved error awareness to Graphcache. When Graphcache now receives a
GraphQLError(via aCombinedError) it checks whether theGraphQLError'spathmatches up withnullvalues in thedata. Anynullvalues that the write operation now sees in the data will be replaced with a "cache miss" value (i.e.undefined) when it has an associated error. This means that errored fields from your GraphQL API will be marked as uncached and won't be cached. Instead the client will now attempt a refetch of the data so that errors aren't preventing future refetches or with schema awareness it will attempt a refetch automatically. Additionally, theupdatesfunctions will now be able to check whether the current field has any errors associated with it withinfo.error, by @kitten (See #1356)
Minor Changes#
- Allow
schemaoption to be passed with a partial introspection result that only containsqueryType,mutationType, andsubscriptionTypewith their respective names. This allows you to pass{ __schema: { queryType: { name: 'Query' } } }and the likes to Graphcache'scacheExchangeto alter the default root names without enabling full schema awareness, by @kitten (See #1379)
Patch Changes#
3.4.0#
Minor Changes#
- Warn when using an interface or union field in the graphCache resolvers config, by @JoviDeCroock (See #1304)
Patch Changes#
- ⚠️ Fix edge-case where query results would pick up invalidated fields from mutation results as they're written to the cache. This would cause invalid cache misses although the result was expected to just be passed through from the API result, by @kitten (See #1300)
- ⚠️ Fix a Relay Pagination edge case where overlapping ends of pages queried using the
lastargument would be in reverse order, by @JoviDeCroock (See #1311)
3.3.4#
Patch Changes#
- ⚠️ Fix, add null as a possible type for the variables argument in
cache.invalidate, by @JoviDeCroock (See #1269)
3.3.3#
Patch Changes#
- Update
cache.resolve(parent, ...)case to enable even more cases, for instance whereparent.__typenameisn't set yet. This was intended to be enabled in the previous patch but has been forgotten, by @kitten (See #1219) - Deprecate
cache.resolveFieldByKeyin favour ofcache.resolve, which functionally was already able to do the same, by @kitten (See #1219) - Updated dependencies (See #1225)
- @urql/core@1.16.1
3.3.2#
Patch Changes#
- Update
cachemethods, for instancecache.resolve, to consistently accept theparentargument fromresolversandupdatesand alias it to the parent's key (which is usually found oninfo.parentKey). This usage ofcache.resolve(parent, ...)was intuitive and is now supported as expected, by @kitten (See #1208)
3.3.1#
Patch Changes#
- ⚠️ Fix reusing original query data from APIs accidentally, which can lead to subtle mismatches in results when the API's incoming
queryresults are being updated by thecacheExchange, to apply resolvers. Specifically this may lead to relations from being set back tonullwhen the resolver returns a different list of links than the result, since somenullrelations may unintentionally exist but aren't related. If you're usingrelayPaginationthen this fix is critical, by @kitten (See #1196)
3.3.0#
Minor Changes#
- Increase the consistency of when and how the
__typenamefield is added to results. Instead of adding it by default and automatically first, the__typenamefield will now be added along with the usual selection set. Thewriteoperation now automatically issues a warning if__typenameisn't present where it's expected more often, which helps in debugging. Also the__typenamefield may now not proactively be added to root results, e.g."Query", by @kitten (See #1185)
Patch Changes#
- Replace
graphql/utilities/buildClientSchema.mjswith a custom-tailored, lighter implementation built into@urql/exchange-graphcache. This will appear to increase its size by about0.2kB gzipbut will actually save around8.5kB gzipto9.4kB gzipin any production bundle by using less ofgraphql's code, by @kitten (See #1189) - Updated dependencies (See #1187, #1186, and #1186)
- @urql/core@1.16.0
3.2.0#
Minor Changes#
- Add a
mergeMode: 'before' | 'after'option to thesimplePaginationhelper to define whether pages are merged before or after preceding ones when pagination, similar torelayPagination's option, by @hoangvvo (See #1174)
Patch Changes#
- Updated dependencies (See #1168)
- @urql/core@1.15.2
3.1.11#
Patch Changes#
- Add support for
TypedDocumentNodeto infer the type of theOperationResultandOperationfor all methods, functions, and hooks that either directly or indirectly accept aDocumentNode. Seegraphql-typed-document-nodeand the corresponding blog post for more information., by @kitten (See #1113) - Updated dependencies (See #1119, #1113, #1104, and #1123)
- @urql/core@1.15.0
3.1.10#
Patch Changes#
- ⚠️ Fix a stray
operationNamedeprecation warning in@urql/exchange-graphcache's exchange logic, which adds themeta.cacheOutcomefield to the operation's context, by @kitten (See #1103)
3.1.9#
Patch Changes#
- ⚠️ Fix the production build overwriting the development build. Specifically in the previous release we mistakenly replaced all development bundles with production bundles. This doesn't have any direct influence on how these packages work, but prevented development warnings from being logged or full errors from being thrown, by @kitten (See #1097)
- Updated dependencies (See #1097)
- @urql/core@1.14.1
3.1.8#
Patch Changes#
- Add missing
.mjsextension to all imports fromgraphqlto fix Webpack 5 builds, which require extension-specific import paths for ESM bundles and packages. This change allows you to safely upgrade to Webpack 5., by @kitten (See #1094) - Deprecate the
Operation.operationNameproperty in favor ofOperation.kind. This name was previously confusing asoperationNamewas effectively referring to two different things. You can safely upgrade to this new version, however to mute all deprecation warnings you will have to upgrade allurqlpackages you use. If you have custom exchanges that spread operations, please use the newmakeOperationhelper function instead, by @bkonkle (See #1045) - Updated dependencies (See #1094 and #1045)
- @urql/core@1.14.0
3.1.7#
Patch Changes#
- Enforce atomic optimistic updates so that optimistic layers are cleared before they're reapplied. This is important for instance when an optimistic update is performed while offline and then reapplied while online, which would previously repeat the optimistic update on top of its past data changes, by @kitten (See #1080)
3.1.6#
Patch Changes#
- ⚠️ Fix optimistic updates not being allowed to be cumulative and apply on top of each other. Previously in #866 we explicitly deemed this as unsafe which isn't correct anymore given that concrete, non-optimistic updates are now never applied on top of optimistic layers, by @kitten (See #1074)
3.1.5#
Patch Changes#
- Changes some internals of how selections are iterated over and remove some private exports. This will have no effect or fixes on how Graphcache functions, but may improve some minor performance characteristics of large queries, by @kitten (See #1060)
3.1.4#
Patch Changes#
- ⚠️ Fix inline fragments being skipped when they were missing a full type condition as per the GraphQL spec (e.g
{ ... { field } }), by @kitten (See #1040)
3.1.3#
Patch Changes#
- ⚠️ Fix a case where the
offlineExchangewould not start processing operations after hydrating persisted data when no operations arrived in time by the time the persisted data was restored. This would be more evident in Preact and Svelte due to their internal short timings, by @kitten (See #1019)
3.1.2#
Patch Changes#
- ⚠️ Fix small pieces of code where polyfill-less ES5 usage was compromised. This was unlikely to have affected anyone in production as
Array.prototype.find(the only usage of an ES6 method) is commonly used and polyfilled, by @kitten (See #991) - ⚠️ Fix queries that have erroed with a
NetworkError(isOfflineError) not flowing back completely through thecacheExchange. These queries should also now be reexecuted when the client comes back online, by @kitten (See #1011) - Updated dependencies (See #1011)
- @urql/core@1.13.1
3.1.1#
Patch Changes#
- ⚠️ Fix updaters config not working when Mutation/Subscription root names were altered.
For instance, a Mutation named
mutation_rootcould causestore.updatesto be misread and cause a runtime error, by @kitten (See #984) - ⚠️ Fix operation results being obstructed by the
offlineExchangewhen the network request has failed due to being offline and no cache result has been issued. Instead theofflineExchangewill now retry withcache-onlypolicy, by @kitten (See #985)
3.1.0#
Minor Changes#
- Add support for
nodesfields to therelayPaginationhelper, instead of only supporting the standardedges. (See #897)
Patch Changes#
3.0.2#
Patch Changes#
- Add special-case for fetching an introspection result in our schema-checking, this avoids an error when urql-devtools fetches the backend graphql schema, by @JoviDeCroock (See #893)
- Mute warning when using built-in GraphQL fields, like
__type, by @kitten (See #919) - ⚠️ Fix return type for resolvers to allow data objects to be returned with
__typenameas expected, by @JoviDeCroock (See #927) - Updated dependencies (See #911 and #908)
- @urql/core@1.12.3
3.0.1#
Patch Changes#
- Add warning for queries that traverse an Operation Root Type (Mutation / Subscription types occuring in a query result), by @kitten (See #859)
- ⚠️ Fix storage implementation not preserving deleted values correctly or erroneously checking optimistically written entries for changes. This is fixed by adding a new default serializer to the
@urql/exchange-graphcache/default-storageimplementation, which will be incompatible with the old one, by @kitten (See #866) - Replace unnecessary
scheduleTaskpolyfill with inlinePromise.resolve().then(fn)calls, by @kitten (See #861) - Updated dependencies (See #860 and #861)
- @urql/core@1.12.1
3.0.0#
This major release comes with a couple of fixes and new experimental offline support, which we're very excited for! Please give it a try if your application is targeting Offline First!
To migrate to this new major version, check the major breaking changes below. Mainly you will have
to watch out for cache.invalidateQuery which has been removed. Instead you should now invalidate
individual entities and fields using cache.invalidate. Learn more about this method on our
docs.
Major Changes#
- Remove the deprecated
populateExchangeexport from@urql/exchange-graphcache. If you're using thepopulateExchange, please install the separate@urql/exchange-populatepackage and import it from there, by @kitten (See #840) - The deprecated
cache.invalidateQuery()method has been removed. Please migrate over tocache.invalidate()instead, which operates on individual fields instead of queries, by @kitten (See #840)
Minor Changes#
- Implement experimental Offline Support in Graphcache. Read more about how to use the Offline Support in our docs., by @kitten (See #793)
- Issue warnings when an unknown type or field has been included in Graphcache's
optsconfiguration to help spot typos. Checksopts.keys,opts.updates,opts.resolversandopts.optimistic. (See #820 and #826)
Patch Changes#
- ⚠️ Fix resolvers being executed for data even when data is currently written. This behaviour could lead to interference with custom updaters that update fragments or queries, e.g. an updater that was receiving paginated data due to a pagination resolver. We've determined that generally it is undesirable to have any resolvers run during the cache update (writing) process, since it may lead to resolver data being accidentally written to the cache or for resolvers to interfere with custom user updates, by @olistic (See #812)
- Upgrade to a minimum version of wonka@^4.0.14 to work around issues with React Native's minification builds, which use uglify-es and could lead to broken bundles, by @kitten (See #842)
- Updated dependencies (See #838 and #842)
- @urql/core@1.12.0
2.4.2#
Patch Changes#
- Add
sourcedebug name to alldispatchDebugcalls during build time to identify events by which exchange dispatched them, by @JoviDeCroock (See #780) - ⚠️ Fix Introspection Queries (or internal types in general) triggering lots of warnings for unkeyed entities, by @kitten (See #779)
- Updated dependencies (See #780)
- @urql/core@1.11.7
2.4.1#
Patch Changes#
- Add a
"./package.json"entry to thepackage.json's"exports"field for Node 14. This seems to be required by packages likerollup-plugin-svelteto function properly, by @JoviDeCroock (See #771) - ⚠️ Fix traversal issue, where when a prior selection set has set a nested result field to
null, a subsequent traversal of this field attempts to accessprevDataonnull, by @kitten (See #772) - Updated dependencies (See #771 and #771)
- @urql/exchange-populate@0.1.7
- @urql/core@1.11.6
2.4.0#
This release heavily improves on the intuitiveness of how Optimistic Updates work. It ensures that optimistic updates aren't accidentally discarded, by temporarily blocking some refetches when necessary. It also prevents optimistic mutation updates from becoming permanent, which could previously happen if an updater read optimistic data and rewrote it again. This isn't possible anymore as mutation results are applied as a batch.
Minor Changes#
- Implement refetch blocking for queries that are affected by optimistic update. When a query would normally be refetched, either because it was partial or a cache-and-network operation, we now wait if it touched optimistic data for that optimistic mutation to complete. This prevents optimistic update data from unexpectedly disappearing, by @kitten (See #750)
- Implement optimistic mutation result flushing. Mutation results for mutation that have had optimistic updates will now wait for all optimistic mutations to complete at the same time before being applied to the cache. This sometimes does delay cache updates to until after multiple mutations have completed, but it does prevent optimistic data from being accidentally committed permanently, which is more intuitive, by @kitten (See #750)
Patch Changes#
- Adjust mutation results priority to always override query results as they arrive, similarly to subscriptions. This will prevent race conditions when mutations are slow to execute at the cost of some consistency, by @kitten (See #745)
- Improve warning and error console output in development by cleaning up the GraphQL trace stack, by @JoviDeCroock (See #751)
2.3.8#
Patch Changes#
Sorry for the many updates; Please only upgrade to >=2.3.8 and don't use the deprecated 2.3.7
and 2.3.6 release.
- ⚠️ Fix nested package path for @urql/core/internal and @urql/exchange-graphcache/extras, by @kitten (See #734)
- Updated dependencies (See #734)
- @urql/core@1.11.4
2.3.7#
Patch Changes#
- Make the extension of the main export unknown, which fixes a Webpack issue where the resolver won't pick
modulefields inpackage.jsonfiles once it's importing from another.mjsfile, by @JoviDeCroock (See #733) - Updated dependencies (See #733)
- @urql/core@1.11.2
2.3.5#
Patch Changes#
2.3.4#
Patch Changes#
- Add debugging events to exchanges that add more detailed information on what is happening internally, which will be displayed by devtools like the urql Chrome / Firefox extension, by @andyrichardson (See #608)
- ⚠️ Fix persistence using special tab character in serialized keys and add sanitization to persistence key serializer, by @kitten (See #715)
- Updated dependencies (See #608, #718, and #722)
- @urql/core@1.11.0
2.3.3#
Patch Changes#
- ⚠️ Fix @urql/exchange-populate visitWithTypeInfo import by bumping babel-plugin-modular-graphql, by @kitten (See #709)
- Updated dependencies (See #709)
- @urql/exchange-populate@0.1.6
2.3.2#
Patch Changes#
- Pick modules from graphql package, instead of importing from graphql/index.mjs, by @kitten (See #700)
- Change invalidation to check for undefined links since null is a valid value in graphql, by @JoviDeCroock (See #694)
- Updated dependencies (See #700)
- @urql/exchange-populate@0.1.5
- @urql/core@1.10.9
2.3.1#
Patch Changes#
- Add graphql@^15.0.0 to peer dependency range, by @kitten (See #688)
- Forcefully bump @urql/core package in all bindings and in @urql/exchange-graphcache.
We're aware that in some cases users may not have upgraded to @urql/core, even though that's within
the typical patch range. Since the latest @urql/core version contains a patch that is required for
cache-and-networkto work, we're pushing another patch that now forcefully bumps everyone to the new version that includes this fix, by @kitten (See #684) - Reimplement persistence support to take commutative layers into account, by @kitten (See #674)
- Updated dependencies (See #688 and #678)
- @urql/exchange-populate@0.1.4
- @urql/core@1.10.8
2.3.0#
Minor Changes#
- Support optimistic values for mutations without a selectionset, by @JoviDeCroock (See #657)
Patch Changes#
- Refactor to replace dictionary-based (
Object.create(null)) results with regular objects, by @kitten (See #651) - ⚠️ Fix case where a mutation-rootfield would cause an empty call to the cache.updates[mutationRootField], by @JoviDeCroock (See #654)
- Updated dependencies (See #658 and #650)
- @urql/core@1.10.5
2.2.8#
Patch Changes#
- ⚠️ Fix node resolution when using Webpack, which experiences a bug where it only resolves
package.json:maininstead ofmodulewhen an.mjsfile imports a package, by @JoviDeCroock (See #642) - Updated dependencies (See #642)
- @urql/exchange-populate@0.1.3
- @urql/core@1.10.4
2.2.7#
Patch Changes#
- ⚠️ Fix critical ordering bug in commutative queries and mutations. Subscriptions and queries would ad-hoc be receiving an empty optimistic layer accidentally. This leads to subscription results potentially being cleared, queries from being erased on a second write, and layers from sticking around on every second write or indefinitely. This affects versions
> 2.2.2so please upgrade!, by @kitten (See #638) - ⚠️ Fix multipart conversion, in the
extract-filesdependency (used by multipart-fetch) there is an explicit check for the constructor property of an object. This made the files unretrievable, by @JoviDeCroock (See #639) - ⚠️ Fix Node.js Module support for v13 (experimental-modules) and v14. If your bundler doesn't support
.mjsfiles and fails to resolve the new version, please double check your configuration for Webpack, or similar tools, by @JoviDeCroock (See #637) - Updated dependencies (See #637)
- @urql/exchange-populate@0.1.2
- @urql/core@1.10.3
2.2.6#
Patch Changes#
- ⚠️ Fix cache.inspectFields causing an undefined error for uninitialised or cleared commutative layers, by @kitten (See #626)
- Improve Store constructor to accept an options object instead of separate arguments, identical to the cacheExchange options. (This is a patch, not a minor, since we consider Store part of the private API), by @kitten (See #622)
- Allow a single field to be invalidated using cache.invalidate using two additional arguments, similar to store.resolve; This is a very small addition, so it's marked as a patch, by @kitten (See #627)
- Prevent variables from being filtered and queries from being altered before they're forwarded, which prevented additional untyped variables from being used inside updater functions, by @kitten (See #629)
- Expose generated result data on writeOptimistic and passthrough data on write operations, by @kitten (See #613)
- Updated dependencies (See #621)
- @urql/core@1.10.2
2.2.5#
Patch Changes#
- Refactor parts of Graphcache for a minor performance boost and bundlesize reductions, by @kitten (See #611)
2.2.4#
Patch Changes#
- ⚠️ Fix Rollup bundle output being written to .es.js instead of .esm.js, by @kitten (See #609)
- Updated dependencies (See #609)
- @urql/core@1.10.1
2.2.3#
Patch Changes#
- Apply commutative layers to all operations, so now including mutations and subscriptions, to ensure that unordered data is written in the correct order, by @kitten (See #593)
- Updated dependencies (See #607 and #601)
- @urql/core@1.10.0
2.2.2#
Patch Changes#
- ⚠️ Fix commutative layer edge case when lowest-priority layer comes back earlier than others, by @kitten (See #587)
- Externalise @urql/exchange-populate from bundle, by @kitten (See #590)
- ⚠️ Fix teardown events leading to broken commutativity, by @kitten (See #588)
2.2.1#
Patch Changes#
- Remove the shared package, this will fix the types file generation for graphcache, by @JoviDeCroock (See #579)
- Updated dependencies (See #577)
- @urql/core@1.9.2
2.2.0#
Minor Changes#
- Add
cache.invalidateto invalidate an entity directly to remove it from the cache and all subsequent cache results, e.g.cache.invalidate({ __typename: 'Todo', id: 1 }), by @JoviDeCroock (See #566)
Patch Changes#
- ⚠️ Fix
cache-onlyoperations being forwarded and triggering fetch requests, by @JoviDeCroock (See #551) - Apply Query results in-order and commutatively even when results arrive out-of-order, by @kitten (See #565)
- Updated dependencies (See #551, #542, and #544)
- @urql/core@1.9.1
2.1.1#
Patch Changes#
- Update the
updaterfunction type ofcache.updateQueryto have a return type ofDataFieldsso that__typenamedoes not need to be defined, by @JoviDeCroock (See #538) - ⚠️ Fix updates not being triggered when optimistic updates diverge from the actual result. (See #160)
- Refactor away SchemaPredicates helper to reduce bundlesize. (See #161)
- Ensure that pagination helpers don't confuse pages that have less params with a query that has more params. (See #156)
- Updated dependencies (See #533, #519, #515, #512, and #518)
- @urql/core@1.9.0
2.1.0#
This release adds support for cache persistence which is bringing us one step closer to full offline-support, which we hope to bring you soon.
It also allows wonka@^4.0.0 as a dependency to be compatible with urql@1.8.0. It also fixes a couple of issues in our
new populateExchange.
- Refactor internal store code and simplify
Store(see #134) - ✨ Implement store persistence support (see #137)
- ✨ Apply GC to store persistence (see #138)
- Remove unused case where scalars are written from an API when links are expected (see #142)
- ⚠️ Add support for resolvers causing cache misses (see #143)
- ⚠️ Fix nested types (e.g.
[Item!]!) inpopulateExchange(see #150) - Fix duplicate fragments in
populateExchangeoutput (see #151) - Allow
wonka@^3.2.1||^4.0.0to be used (see #153)
2.0.0#
Note: The minimum required version of
urqlfor this release is now1.7.0!
Christmas came early! This version improves performance again by about 25% over 1.2.2. It also
now ships with two new features: The populateExchange and automatic garbage collection.
Including the populateExchange is optional. It records all fragments in any active queries, and
populates mutation selection sets when the @populate directive is used based on typenames. If your
schema includes viewer fields on mutations, which resolve back to your Query type, you can use
this to automatically update your app's data when a mutation is made. (More documentation on this
is coming soon!)
The garbage collection works by utilising an automatic reference counting algorithm rather than a mark & sweep algorithm. We feel this is the best tradeoff to maintain good performance during runtime while minimising the data that is unnecessarily retained in-memory. You don't have to do anything! Graphcache will do its newly added magic in the background.
There are some breaking changes, if you're using cache.resolveConnections or resolveValueOrLink
then you now need to use inspectFields and resolveFieldByKey instead. You may also now make
use of cache.keyOfField. (More info on #128)
- ✨ Implement
populateExchange(see #120) - Improve type safety of
invariantandwarning(see #121) - Reduce size of
populateExchange(see #122) - Move more code to KVMap (see #125)
- Move deletion to setting
undefinedinstead (see #126) - Fix multiple edge cases in the
relayPaginationhelper, by @rafeca (see #127) - ✨⚠️ Reimplement data structure and add garbage collection (see #128)
- Use Closure Compiler (see #131)
- Switch to using
urql/coreon1.7.0(see #132)
1.2.2#
This patch replaces pessimism (our former underlying data structure) with a smaller implementation
that just uses Maps, since we weren't relying on any immutability internally. This cuts down
on bundlesize and massively on GC-pressure, which provides a large speedup on low-end devices.
- Replace Pessimism with mutable store to prevent excessive GC work (see #117)
1.2.1#
- Fix viewer fields (which return
Querytypes) not being written or read correctly (see #116)
1.2.0#
- ⚠️ Fix unions not being checked supported by schema predicates, by @StevenLangbroek (see #113)
- ✨ Add
simplePaginationhelper for resolving simple, paginated lists (see #115)
1.1.2#
1.1.1#
This is a minor release since it increases the peer dependency of urql to >= 1.6.0, due to the addition
of the stale flag to partial responses and cache-and-network responses. This flag is useful to check
whether more requests are being made in the background by @urql/exchange-graphcache.
Additionally, this release adds a small stack to every error and warning that indicates where an error has occured. It lists out the query and all subsequent fragments it has been traversing so that errors and warnings can be traced more easily.
- Add a query/fragment stack to all errors and warnings (see #107)
- Add
stale: trueto allcache-and-networkand partial responses (see #108)
1.0.3#
- Fix
relayPaginationhelper merging pages with different field arguments (see #104)
1.0.2#
- Deduplicate connections in
Store.writeConnectionwhen possible (see #103) - Fix early bail-out in
relayPaginationhelper (see #103)
1.0.1#
- Trims down the size by 100 bytes (see #96)
- Include the
/extrasbuild in the published version (see #97) - Invariant and warnings will now have an error code associated with a more elaborate explanation (see #99)
- Invariant errors will now be included in your production bundle (see #100)
- Fixes the relayPagination helper to correctly return partial results (see #101)
- Add special case to relayPagination for first and last during inwards merge (see #102)
1.0.0#
Note: The minimum required version of
urqlfor this release is now1.5.1!
Hooray it's v1.0.0 time! This doesn't mean that we won't be changing little things anymore, but we're so far happy with our API and trust Graphcache to work correctly. We will further iterate on this version with some planned features, like "fragment invalidation", garbage collection, and more.
This version refactors the cache resolvers and adds some new special powers to them! You can now return almost anything from cache resolvers and trust that it'll do the right thing:
- You can return entity keys, which will resolve the cached entities
- You can return keyable entities, which will also be resolved from cache
- You may also return unkeyable entities, which will be partially resolved from cache, with your resolved values taking precedence
This can also be nested, so that unkeyable entities can eventually lead back to normal, cached entities!
This has enabled us to expose the relayPagination() helper! This is a resolver that you can just drop into the cacheExchange's resolvers config. It automatically does Relay-style pagination, which is now possible due to our more powerful resolvers! You can import it from @urql/exchange-graphcache/extras.
- ✨ Add full cache resolver traversal (see #91)
- ✨ Add a new
relayPaginationhelper (see #91) - Add a
Cacheinterface with all methods (that are safe for userland) having documentation (see #91) - ⚠ Fix non-default root keys (that aren't just
Query) not being respected (see #87)
1.0.0-rc.11#
- Fix
updatesnot being called foroptimisticresults (see #83) - Add optional
variablesargument toreadFragmentandwriteFragment(see #84) - ⚠ Fix field arguments not normalising optional
nullvalues (see #85)
1.0.0-rc.10#
- ⚠ Fix removing cache entries by upgrading to Pessimism
1.1.4(see ae72d3)
1.0.0-rc.9#
- ⚠ Fix optimistic updates by upgrading to Pessimism
1.1.3(see #81)
1.0.0-rc.8#
- Fix warnings being shown for Relay
ConnectionandEdgeembedded types (see #79) - Implement
readFragmentmethod onStore(see #73) - Implement
readQuerymethod onStore(see #73) - Improve
writeFragmentmethod onStore(see #73)
1.0.0-rc.7#
- ⚠ Fix reexecuted operations due to dependencies not using
cache-first(see 0bd58f6)
1.0.0-rc.6#
- ⚠ Fix concurrency issue where a single operation is reexecuted multiple times (see #70)
- Skip writing
undefinedto the cache and log a warning in development (see #71) - Allow
queryto be passed as a string tostore.updateQuery(see #72)
1.0.0-rc.5#
- ⚠ Fix user-provided
keysconfig not being able to returnnull(see #68)
1.0.0-rc.4#
- ⚠ Fix development warnings throwing an error for root fields (see #65)
1.0.0-rc.3#
Note: This is release contains a bug that v1.0.0-rc.4 fixes
- Fix warning condition for missing entity keys (see 98287ae)
1.0.0-rc.2#
Note: This is release contains a bug that v1.0.0-rc.3 fixes
- Add warnings for unknown fields based on the schema and deduplicate warnings (see #63)
1.0.0-rc.1#
This is the first release that adds schema awareness. Passing a schema to Graphcache allows it to make deterministic
assumptions about the cached results it generates from its data. It can deterministically match fragments to interfaces,
instead of resorting to a heuristic, and it can provide partial results for queries. With a schema passed to Graphcache,
as long as only nullable fields are uncached and missing, it will still provide an initial cached result.
- ✨ Add schema awareness using the
schemaoption (see #58) - ✨ Allow for partial results to cascade missing values upwards (see #59)
- Fix
store.keyOfEntitynot using root names from the schema (see #62)
1.0.0-rc.0#
This is where this CHANGELOG starts.
For a log on what happened in beta and alpha releases, please read the commit history.