Packages

@apollo/client

4.3.5 · 19 Oct 2026MIT5.3M / weekRepositoryHomepagenpmAtom feed

Your version

3.5.4

19 Nov 2021Where it was published

3.14.1 is the newest release of 3.x.

In short

2 new1 changed

Release note

Apollo Client 3.5.4 (2021-11-19)

Notices

⚠️ The following advice about metro.config.js should no longer be necessary, as of Apollo Client v3.6.4.

  • [Relevant if you use Apollo Client with React Native] Since Apollo Client v3.5.0, CommonJS bundles provided by @apollo/client use a .cjs file extension rather than .cjs.js, so Node.js won't interpret them as ECMAScript modules. While this change should be an implementation detail, it may cause problems for the Metro bundler used by React Native, whose resolver.sourceExts configuration does not include the cjs extension by default.

    As a workaround until this issue is resolved, you can configure Metro to understand the .cjs file extension by creating a metro.config.js file in the root of your React Native project:

    // NOTE: No longer necessary in @apollo/client@3.6.4!
    const { getDefaultConfig } = require("metro-config");
    const { resolver: defaultResolver } = getDefaultConfig.getDefaultValues();
    exports.resolver = {
      ...defaultResolver,
      sourceExts: [...defaultResolver.sourceExts, "cjs"],
    };

Improvements

  • Restore the ability to pass onError() and onCompleted() to the mutation execution function. @brainkim

  • Work around webpack 5 errors of the form

    The request 'ts-invariant/process' failed to resolve only because it was resolved as fully specified

    by ensuring import ... from 'ts-invariant/process' is internally written to import ... from 'ts-invariant/process/index.js'.
    @benjamn in #9083