github apollographql/apollo-client @apollo/client@4.1.0-alpha.0

pre-release11 hours ago

Minor Changes

  • #12923 2aa31c7 Thanks @jerelmiller! - Fix an issue where deferred payloads that reteurned arrays with fewer items than the original cached array would retain items from the cached array. This change includes @stream arrays where stream arrays replace the cached arrays.

  • #12926 c7fba99 Thanks @jerelmiller! - Support the newer incremental delivery format for the @defer directive implemented in graphql@17.0.0-alpha.9. Import the GraphQL17Alpha9Handler to use the newer incremental delivery format with @defer.

    import { GraphQL17Alpha9Handler } from "@apollo/client/incremental";
    
    const client = new ApolloClient({
      // ...
      incrementalHandler: new GraphQL17Alpha9Handler(),
    });

    [!NOTE]
    In order to use the GraphQL17Alpha9Handler, the GraphQL server MUST implement the newer incremental delivery format. You may see errors or unusual behavior if you use the wrong handler. If you are using Apollo Router, continue to use the Defer20220824Handler because Apollo Router does not yet support the newer incremental delivery format.

  • #12918 562e219 Thanks @jerelmiller! - Add support for the @stream directive on both the Defer20220824Handler and the GraphQL17Alpha2Handler.

    [!NOTE]
    The implementations of @stream differ in the delivery of incremental results between the different GraphQL spec versions. If you upgrading from the older format to the newer format, expect the timing of some incremental results to change.

Patch Changes

  • #12925 f538a83 Thanks @jerelmiller! - Fix an issue where calling fetchMore with @defer or @stream would not rerender incremental results as they were streamed.

  • #12923 01cace0 Thanks @jerelmiller! - Improve the cache data loss warning message when existing or incoming is an array.

Don't miss a new apollo-client release

NewReleases is sending notifications on new releases.