npm @apollo/client 3.1.0

latest releases: 3.10.1, 3.10.0, 0.0.0-pr-11799-20240422143231...
3 years ago

Apollo Client 3.1.0

Bug Fixes

  • Rework interdependencies between @apollo/client/* entry points, so that CommonJS and ESM modules are supported equally well, without any duplication of shared code.
    @benjamn in #6656 and #6657

  • Tolerate !== callback functions (like onCompleted and onError) in useQuery options, since those functions are almost always freshly evaluated each time useQuery is called.
    @hwillson and @benjamn in #6588

  • Respect context.queryDeduplication if provided, and otherwise fall back to client.deduplication (as before).
    @igaloly in #6261 and @Kujawadl in #6526

  • Refactor ObservableQuery#getCurrentResult to reenable immediate delivery of warm cache results. As part of this refactoring, the ApolloCurrentQueryResult type was eliminated in favor of ApolloQueryResult.
    @benjamn in #6710

  • Avoid clobbering defaultOptions with undefined values.
    @benjamn in #6715

Improvements

  • Apollo Client will no longer modify options.fetchPolicy unless you pass options.nextFetchPolicy to request an explicit change in FetchPolicy after the current request. Although this is technically a breaking change, options.nextFieldPolicy makes it easy to restore the old behavior (by passing cache-first).
    @benjamn in #6712, reverting #6353

  • Errors of the form Invariant Violation: 42 thrown in production can now be looked up much more easily, by consulting the auto-generated @apollo/client/invariantErrorCodes.js file specific to your @apollo/client version.
    @benjamn in #6665

  • Make the client field of the MutationResult type non-optional, since it is always provided.
    @glasser in #6617

  • Allow passing an asynchronous options.renderFunction to getMarkupFromTree.
    @richardscarrott in #6576

  • Ergonomic improvements for merge and keyArgs functions in cache field policies.
    @benjamn in #6714

Apollo Client 3.0.2

Bug Fixes

  • Avoid duplicating graphql/execution/execute dependency in CommonJS bundle for @apollo/client/link/schema, fixing instanceof errors reported in #6621 and #6614.
    @benjamn in #6624

Apollo Client 3.0.1

Bug Fixes

  • Make sure useQuery onCompleted is not fired when skip is true.
    @hwillson in #6589

  • Revert changes to peerDependencies in package.json (#6594), which would have allowed using incompatible future versions of graphql and/or react due to overly-permissive >= version constraints.
    @hwillson in #6605

Don't miss a new client release

NewReleases is sending notifications on new releases.