github apollographql/apollo-client @apollo/client@4.0.0-rc.5

latest releases: @apollo/client@4.0.4, @apollo/client@4.0.3, @apollo/client@4.0.2...
pre-releaseone month ago

Major Changes

  • #12776 bce9b74 Thanks @jerelmiller! - Report masked fragments as complete even when a nested masked fragment contains partial data.

  • #12774 511b4f3 Thanks @jerelmiller! - Apply document transforms before reading data from the cache for client.readQuery, client.readFragment, client.watchFragment, useFragment, and useSuspenseFragment.

    NOTE: This change does not affect the equivalent cache.* APIs. To read data from the cache without first running document transforms, run cache.readQuery, cache.readFragment, etc.

Minor Changes

Patch Changes

  • #12776 bce9b74 Thanks @jerelmiller! - cache.watchFragment now returns an Unmasked<TData> result since cache.watchFragment does not mask fragment spreads.

  • #12370 0517163 Thanks @phryneas! - InMemoryCache: Fields with an empty argument object are now saved the same way as fields without arguments.

    Previously, it was possible that the reponses for these two queries would be stored differently in the cache:

    query PlainAccess {
      myField
    }

    would be stored as myField
    and

    query AccessWithoutOptionalArgument($optional: String) {
      myField(optional: $optional)
    }

    would be stored as myField({"optional":"Foo"}) if called with {optional: "Foo"} and as myField({}) if called without the optional argument.

    The cases myField and myField({}) are equivalent from the perspective of a GraphQL server, and so in the future both of these will be stored as myField in the cache.

  • #12775 454ec78 Thanks @jerelmiller! - Don't export gql from @apollo/client/react entrypoint. Import from @apollo/client instead.

  • #12761 db6f7c3 Thanks @phryneas! - Deprecate second argument to readFragment and readQuery - optimistic should be passed as part of the object in the first argument instead.

Don't miss a new apollo-client release

NewReleases is sending notifications on new releases.