Skip to content

Releases: apollographql/apollo-client

v3.8.8

29 Nov 18:32
89ec18e
Compare
Choose a tag to compare

Patch Changes

v3.9.0-alpha.4

08 Nov 15:41
950cae8
Compare
Choose a tag to compare
v3.9.0-alpha.4 Pre-release
Pre-release

Minor Changes

  • #11175 d6d14911c Thanks @phryneas! - To work around issues in React Server Components, especially with bundling for
    the Next.js "edge" runtime we now use an external package to wrap react imports
    instead of importing React directly.

Patch Changes

v3.9.0-alpha.3

02 Nov 14:04
be2029b
Compare
Choose a tag to compare
v3.9.0-alpha.3 Pre-release
Pre-release

Minor Changes

  • #11301 46ab032af Thanks @alessbell! - Add multipart subscription network adapters for Relay and urql

    Relay

    import { createFetchMultipartSubscription } from "@apollo/client/utilities/subscriptions/relay";
    import { Environment, Network, RecordSource, Store } from "relay-runtime";
    
    const fetchMultipartSubs = createFetchMultipartSubscription(
      "http://localhost:4000"
    );
    
    const network = Network.create(fetchQuery, fetchMultipartSubs);
    
    export const RelayEnvironment = new Environment({
      network,
      store: new Store(new RecordSource()),
    });

    Urql

    import { createFetchMultipartSubscription } from "@apollo/client/utilities/subscriptions/urql";
    import { Client, fetchExchange, subscriptionExchange } from "@urql/core";
    
    const url = "http://localhost:4000";
    
    const multipartSubscriptionForwarder = createFetchMultipartSubscription(url);
    
    const client = new Client({
      url,
      exchanges: [
        fetchExchange,
        subscriptionExchange({
          forwardSubscription: multipartSubscriptionForwarder,
        }),
      ],
    });

Patch Changes

  • #11275 3862f9ba9 Thanks @phryneas! - Add a defaultContext option and property on ApolloClient, e.g. for keeping track of changing auth tokens or dependency injection.

    This can be used e.g. in authentication scenarios, where a new token might be
    generated outside of the link chain and should passed into the link chain.

    import { ApolloClient, createHttpLink, InMemoryCache } from "@apollo/client";
    import { setContext } from "@apollo/client/link/context";
    
    const httpLink = createHttpLink({
      uri: "/graphql",
    });
    
    const authLink = setContext((_, { headers, token }) => {
      return {
        headers: {
          ...headers,
          authorization: token ? `Bearer ${token}` : "",
        },
      };
    });
    
    const client = new ApolloClient({
      link: authLink.concat(httpLink),
      cache: new InMemoryCache(),
    });
    
    // somewhere else in your application
    function onNewToken(newToken) {
      // token can now be changed for future requests without need for a global
      // variable, scoped ref or recreating the client
      client.defaultContext.token = newToken;
    }
  • #11297 c8c76a522 Thanks @jerelmiller! - Add an explicit return type for the useReadQuery hook called UseReadQueryResult. Previously the return type of this hook was inferred from the return value.

v3.8.7

02 Nov 15:54
8329f07
Compare
Choose a tag to compare

Patch Changes

  • #11297 c8c76a522 Thanks @jerelmiller! - Add an explicit return type for the useReadQuery hook called UseReadQueryResult. Previously the return type of this hook was inferred from the return value.

  • #11337 bb1da8349 Thanks @phryneas! - #11206 used the TypeScript syntax infer X extends Y that was introduced in TS 4.8.
    This caused some problems for some users, so we are rolling back to a more backwards-compatible (albeit slightly less performant) type.

v3.8.6

16 Oct 15:46
1cdaea2
Compare
Choose a tag to compare

Patch Changes

  • #11291 2be7eafe3 Thanks @ArioA! - Fix a bug that allows to only call loadErrorMessages without also calling loadDevErrorMessages.

  • #11274 b29f000f3 Thanks @jerelmiller! - Start the query ref auto dispose timeout after the initial promise has settled. This prevents requests that run longer than the timeout duration from keeping the component suspended indefinitely.

  • #11289 b5894dbf0 Thanks @phryneas! - MockedProvider: default connectToDevTools to false in created ApolloClient instance.

    This will prevent the mocked ApolloClient instance from trying to connect to the DevTools, which would start a setTimeout that might keep running after a test has finished.

  • #11206 dd2ce7687 Thanks @phryneas! - cache.modify: Less strict types & new dev runtime warnings.

v3.9.0-alpha.2

11 Oct 11:02
ba5faa5
Compare
Choose a tag to compare
v3.9.0-alpha.2 Pre-release
Pre-release

Patch Changes

  • #11254 d08970d34 Thanks @benjamn! - Decouple canonicalStringify from ObjectCanon for better time and memory performance.

v3.8.5

05 Oct 19:07
f6b9953
Compare
Choose a tag to compare

Patch Changes

  • #11266 5192cf6e1 Thanks @phryneas! - Fixes argument handling for invariant log messages.

  • #11235 6cddaaf65 Thanks @phryneas! - Fix nextFetchPolicy behaviour with transformed documents by keeping options reference stable when passing it through QueryManager.

  • #11252 327a2abbd Thanks @phryneas! - Fixes a race condition in asyncMap that caused issues in React Native when errors were returned in the response payload along with a data property that was null.

  • #11229 c372bad4e Thanks @phryneas! - Remove (already throwing) SuspenseCache export that should have been removed in 3.8.

  • #11267 bc055e068 Thanks @phryneas! - Remove some dead code.

v3.9.0-alpha.1

21 Sep 22:38
33e0d78
Compare
Choose a tag to compare
v3.9.0-alpha.1 Pre-release
Pre-release

Minor Changes

v3.9.0-alpha.0

19 Sep 17:36
4cdcb91
Compare
Choose a tag to compare
v3.9.0-alpha.0 Pre-release
Pre-release

Minor Changes

  • #11202 7c2bc08b2 Thanks @benjamn! - Prevent QueryInfo#markResult mutation of result.data and return cache data consistently whether complete or incomplete.

  • #6701 8d2b4e107 Thanks @prowe! - Ability to dynamically match mocks

    Adds support for a new property MockedResponse.variableMatcher: a predicate function that accepts a variables param. If true, the variables will be passed into the ResultFunction to help dynamically build a response.

v3.8.4

19 Sep 15:26
fb9457d
Compare
Choose a tag to compare

Patch Changes

  • #11195 9e59b251d Thanks @phryneas! - For invariant.log etc., error arguments are now serialized correctly in the link to the error page.