Skip to content

Releases: apollographql/apollo-client

@apollo/client@4.0.0-rc.4

08 Jul 17:48
978dda6
Compare
Choose a tag to compare
Pre-release

Minor Changes

v3.14.0-rc.0

07 Jul 21:14
80414c6
Compare
Choose a tag to compare
v3.14.0-rc.0 Pre-release
Pre-release

Minor Changes

v3.14.0-alpha.1

01 Jul 08:05
45e6ee6
Compare
Choose a tag to compare
v3.14.0-alpha.1 Pre-release
Pre-release

Minor Changes

  • #12752 8b779b4 Thanks @jerelmiller! - Add deprecations and warnings to remaining APIs changed in Apollo Client 4.0.

  • #12751 567cad8 Thanks @jerelmiller! - Add @deprecated tags to all properties returned from any query API (e.g. client.query, observableQuery.refetch, etc.), client.mutate, and client.subscribe that are no longer available in Apollo Client 4.0.

  • #12751 567cad8 Thanks @jerelmiller! - Warn when using a standby fetch policy with client.query.

@apollo/client@4.0.0-rc.3

01 Jul 08:08
5ff16fb
Compare
Choose a tag to compare
Pre-release

Major Changes

  • #12731 0198870 Thanks @phryneas! - Ship React Compiler compiled React hooks in @apollo/client/react/compiled.

    We now ship a React-Compiler compiled version of the React hooks in
    @apollo/client/react/compiled.

    This entry point contains everything that @apollo/client/react does,
    so you can use it as a drop-in replacement in your whole application
    if you choose to use the compiled hooks.

Minor Changes

  • #12753 b85818d Thanks @jerelmiller! - Renamed client.reFetchObservableQueries to client.refetchObservableQueries.
    client.reFetchObservableQueries is still available as an alias, but is now
    deprecated and will be removed in a future major version.

v3.14.0-alpha.0

27 Jun 18:24
3e7cfe8
Compare
Choose a tag to compare
v3.14.0-alpha.0 Pre-release
Pre-release

Minor Changes

  • #12746 0bcd2f4 Thanks @jerelmiller! - Add warnings and deprecations for options and methods for all React APIs.

  • #12746 0bcd2f4 Thanks @jerelmiller! - Add preloadQuery.toPromise(queryRef) as a replacement for queryRef.toPromise(). queryRef.toPromise() has been removed in Apollo Client 4.0 in favor of preloadQuery.toPromise and is now considered deprecated.

  • #12736 ea89440 Thanks @jerelmiller! - Add deprecations and deprecation warnings for ApolloClient options and methods.

  • #12459 1c5a031 Thanks @jerelmiller! - Reset addTypenameTransform and fragments caches when calling cache.gc() only when resetResultCache is true.

  • #12743 92ad409 Thanks @jerelmiller! - Add deprecations and warnings for addTypename in InMemoryCache and MockedProvider.

  • #12743 92ad409 Thanks @jerelmiller! - Add deprecations and warnings for canonizeResults.

Patch Changes

  • #12750 ecf3de1 Thanks @phryneas! - Prevent field policies from overwriting/merging into supertype field policies.

@apollo/client@4.0.0-rc.2

27 Jun 18:19
0e686a1
Compare
Choose a tag to compare
Pre-release

Major Changes

  • #12742 575bf3e Thanks @jerelmiller! - The new SetContextLink flips the prevContext and operation arguments in the callback. The setContext function has remained unchanged.

    - new SetContextLink((operation, prevContext) => {
    + new SetContextLink((prevContext, operation) => {
      // ...
    })
  • #12742 575bf3e Thanks @jerelmiller! - The operation argument to the callback passed to SetContextLink is now of type SetContextLink.SetContextOperation which is an Operation without the getContext or setContext functions. Previously the type of operation was GraphQLRequest which had access to a context property. The context property was always undefined and could result in bugs when using it instead of the prevContext argument.

    This change means the operation argument now contains an accessible client property.

Minor Changes

  • #12740 1c6e03c Thanks @phryneas! - Overridable types for dataState: "complete", dataState: "streaming" and
    dataState: "partial" responses.

    This adds the DataValue namespace exported from Apollo Client with the three
    types DataValue.Complete, DataValue.Streaming and DataValue.Partial.

    These types will be used to mark TData in the respective states.

    • Complete defaults to TData
    • Streaming defaults to TData
    • Partial defaults to DeepPartial<TData>

    All three can be overwritten, e.g. to be DeepReadonly using higher kinded types
    by following this pattern:

    import { HKT, DeepPartial } from "@apollo/client/utilities";
    import { DeepReadonly } from "some-type-helper-library";
    
    interface CompleteOverride extends HKT {
      return: DeepReadonly<this["arg1"]>;
    }
    
    interface StreamingOverride extends HKT {
      return: DeepReadonly<this["arg1"]>;
    }
    
    interface PartialOverride extends HKT {
      return: DeepReadonly<DeepPartial<this["arg1"]>>;
    }
    
    declare module "@apollo/client" {
      export interface TypeOverrides {
        Complete: CompleteOverride;
        Streaming: StreamingOverride;
        Partial: PartialOverride;
      }
    }

Patch Changes

@apollo/client-codemod-migrate-3-to-4@1.0.0-rc.0

27 Jun 18:19
0e686a1
Compare
Choose a tag to compare

Major Changes

  • #12727 b845906 Thanks @jerelmiller! - Add a codemod that renames old import locations from 3.x entrypoint to their 4.x entrypoint.

    Run the codemod using the following command:

    npx @apollo/client-codemod-migrate-3-to-4 --parser tsx ./src/**/*.{ts,tsx}

    The codemod supports .js, .jsx, .ts, and .tsx files.

@apollo/client@4.0.0-rc.1

24 Jun 16:00
3bdf391
Compare
Choose a tag to compare
Pre-release

Major Changes

Minor Changes

  • #12725 89ac725 Thanks @jerelmiller! - Add operationType to operation in ApolloLink. This means that determining whether a query is a specific operation type can now be compared with this property instead of using getMainDefinition.

    - import { getMainDefinition } from "@apollo/client/utilities";
    + import { OperationTypeNode } from "graphql";
    
    ApolloLink.split(
    - ({ query }) => {
    -   const definition = getMainDefinition(query);
    -   return (
    -     definition.kind === 'OperationDefinition' &&
    -     definition.operation === 'subscription'
    -   );
    -   return
    - },
    + ({ operationType }) => {
    +   return operationType === OperationTypeNode.SUBSCRIPTION;
    + },
      conditionTrueLink,
      conditionFalseLink,
    );

Patch Changes

  • #12728 07a0c8c Thanks @jerelmiller! - Export the IgnoreModifier type from @apollo/client/cache.

  • #12735 5159880 Thanks @jerelmiller! - Change the unsafePreviousData argument on UpdateQueryMapFn and SubscribeToMoreQueryFn to a DeepPartial since the result may contain partial data.

  • #12734 037979d Thanks @jerelmiller! - Don't warn about a missing resolver if a @client does not have a configured resolver. It is possible the cache contains a read function for the field and the warning added confusion.

    Note that read functions without a defined resolver will receive the existing argument as null instead of undefined even when data hasn't been written to the cache. This is because LocalState sets a default value of null when a resolver is not defined to ensure that the field contains a value in case a read function is not defined rather than omitting the field entirely.

  • #12725 89ac725 Thanks @jerelmiller! - Export getMainDefinition from @apollo/client/utilities.

  • #12729 699c830 Thanks @jerelmiller! - Ensure useQuery rerenders when notifyOnNetworkStatusChange is false and a refetch that changes variables returns a result deeply equal to previous variables.

@apollo/client-graphql-codegen@1.0.0-rc.0

19 Jun 15:42
449c3ea
Compare
Choose a tag to compare

Major Changes

@apollo/client@4.0.0-rc.0

18 Jun 21:53
f1eba94
Compare
Choose a tag to compare
Pre-release

Major Changes