Skip to content

Releases: apollographql/apollo-client

v3.8.0-beta.0

03 Aug 09:55
a445e44
Compare
Choose a tag to compare
v3.8.0-beta.0 Pre-release
Pre-release

3.8.0-beta.0

Minor Changes

  • #10887 f8c0b965d Thanks @phryneas! - Add a new mechanism for Error Extraction to reduce bundle size by including
    error message texts on an opt-in basis.
    By default, errors will link to an error page with the entire error message.
    This replaces "development" and "production" errors and works without
    additional bundler configuration.
    Bundling the text of error messages and development warnings can be enabled by

    import { loadErrorMessages, loadDevMessages } from "@apollo/client/dev";
    if (process.env.NODE_ENV !== "production") {
      loadErrorMessages();
      loadDevMessages();
    }
  • #10509 79df2c7ba Thanks @jerelmiller! - Add the ability to specify custom GraphQL document transforms. These transforms are run before reading data from the cache, before local state is resolved, and before the query document is sent through the link chain.

    To register a custom document transform, create a transform using the DocumentTransform class and pass it to the documentTransform option on ApolloClient.

    import { DocumentTransform } from "@apollo/client";
    
    const documentTransform = new DocumentTransform((document) => {
      // do something with `document`
      return transformedDocument;
    });
    
    const client = new ApolloClient({ documentTransform: documentTransform });

    For additional documentation on the behavior and API of DocumentTransform, see the pull request.

  • #10916 ea75e18de Thanks @alessbell! - Remove experimental labels from hooks, move to beta.

v3.7.15

26 May 16:31
4d19216
Compare
Choose a tag to compare

Patch Changes

  • #10891 ab42a5c08 Thanks @laverdet! - Fixes a bug in how multipart responses are read when using @defer. When reading a multipart body, HttpLink no longer attempts to parse the boundary (e.g. "---" or other boundary string) within the response data itself, only when reading the beginning of each mulitpart chunked message.

  • #10789 23a4e1578 Thanks @phryneas! - Fix a bug where other fields could be aliased to __typename or id, in which case an incoming result would be merged into the wrong cache entry.

New Contributors

v3.8.0-alpha.15

03 Aug 09:55
fb95eca
Compare
Choose a tag to compare
v3.8.0-alpha.15 Pre-release
Pre-release

3.8.0-alpha.15

Patch Changes

v3.8.0-alpha.14

03 Aug 09:55
875051c
Compare
Choose a tag to compare
v3.8.0-alpha.14 Pre-release
Pre-release

3.8.0-alpha.14

Minor Changes

  • #10755 e3c676deb Thanks @alessbell! - Feature: adds useBackgroundQuery and useReadQuery hooks

  • #10853 300957960 Thanks @jerelmiller! - Introduce the new removeTypenameFromVariables link. This link will automatically remove __typename fields from variables for all operations. This link can be configured to exclude JSON-scalars for scalars that utilize __typename.

    This change undoes some work from #10724 where __typename was automatically stripped for all operations with no configuration. This was determined to be a breaking change and therefore moved into this link.

Patch Changes

  • #10869 ba1d06166 Thanks @phryneas! - Ensure Context value stability when rerendering ApolloProvider with the same client and/or suspenseCache prop

  • #10789 23a4e1578 Thanks @phryneas! - Fix a bug where other fields could be aliased to __typename or id, in which case an incoming result would be merged into the wrong cache entry.

  • #10765 35f36c5aa Thanks @phryneas! - More robust types for the data property on UseFragmentResult. When a partial result is given, the type is now correctly set to Partial<TData>.

  • #10852 27fbdb3f9 Thanks @phryneas! - Chore: Add ESLint rule for consistent type imports, apply autofix

  • #10877 f40248598 Thanks @phryneas! - Change an import in useQuery and useMutation that added an unnecessary runtime dependency on @apollo/client/core. This drastically reduces the bundle size of each the hooks.

  • #10836 6794893c2 Thanks @phryneas! - Remove the deprecated returnPartialData option from useFragment hook.

  • #10872 96b4f8837 Thanks @phryneas! - The "per-React-Version-Singleton" ApolloContext is now stored on globalThis, not React.createContext, and throws an error message when accessed from React Server Components.

v3.8.0-alpha.13

03 Aug 09:55
707c9cc
Compare
Choose a tag to compare
v3.8.0-alpha.13 Pre-release
Pre-release

3.8.0-alpha.13

Patch Changes

  • #10766 ffb179e55 Thanks @jerelmiller! - More robust typings for the data property returned from useSuspenseQuery when using returnPartialData: true or an errorPolicy of all or ignore. TData now defaults to unknown instead of any.

  • #10809 49d28f764 Thanks @jerelmiller! - Fixed the ability to use refetch and fetchMore with React's startTransition. The hook will now behave correctly by allowing React to avoid showing the Suspense fallback when these functions are wrapped by startTransition. This change deprecates the suspensePolicy option in favor of startTransition.

v3.7.14

03 May 20:45
f216df6
Compare
Choose a tag to compare

Patch Changes

  • #10764 1b0a61fe5 Thanks @phryneas! - Deprecate useFragment returnPartialData option

  • #10810 a6252774f Thanks @dleavitt! - Fix type signature of ServerError.

    In <3.7 HttpLink and BatchHttpLink would return a ServerError.message of e.g. "Unexpected token 'E', \"Error! Foo bar\" is not valid JSON" and a ServerError.result of undefined in the case where a server returned a >= 300 response code with a response body containing a string that could not be parsed as JSON.

    In >=3.7, message became e.g. Response not successful: Received status code 302 and result became the string from the response body, however the type in ServerError.result was not updated to include the string type, which is now properly reflected.

v3.7.13

27 Apr 21:31
9e4d72c
Compare
Choose a tag to compare

Patch Changes

  • #10805 a5503666c Thanks @phryneas! - Fix a potential memory leak in SSR scenarios when many persistedQuery instances were created over time.

  • #10718 577c68bdd Thanks @Hsifnus! - Delay Concast subscription teardown slightly in useSubscription to prevent unexpected Concast teardown when one useSubscription hook tears down its in-flight Concast subscription immediately followed by another useSubscription hook reusing and subscribing to that same Concast

v3.8.0-alpha.12

03 Aug 09:55
abf3b49
Compare
Choose a tag to compare
v3.8.0-alpha.12 Pre-release
Pre-release

3.8.0-alpha.12

Minor Changes

  • #10722 c7e60f83d Thanks @benjamn! - Implement a @nonreactive directive for selectively skipping reactive comparisons of query result subtrees

Patch Changes

v3.7.12

12 Apr 21:45
a0ef413
Compare
Choose a tag to compare

Patch Changes

  • #10735 895bcdcff Thanks @alessbell! - If a multipart chunk contains only hasNext: false, immediately complete the observable.

v3.7.11

31 Mar 18:52
894ae48
Compare
Choose a tag to compare

Patch Changes

  • #10586 4175af594 Thanks @alessbell! - Improve WebSocket error handling for generic Event received on error. For more information see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/error_event.

  • #10411 152baac34 Thanks @lovasoa! - Simplify error message generation and make 'undefined' an impossible message string.

  • #10592 cdb98ae08 Thanks @alessbell! - Adds support for multipart subscriptions in HttpLink.

  • #10698 38508a251 Thanks @jerelmiller! - Changes the behavior of useLazyQuery introduced in #10427 where unmounting a component before a query was resolved would reject the promise with an abort error. Instead, the promise will now resolve naturally with the result from the request.

    Other notable fixes:

    • Kicking off multiple requests in parallel with the execution function will now ensure each returned promise is resolved with the data from its request. Previously, each promise was resolved with data from the last execution.
    • Re-rendering useLazyQuery with a different query document will now ensure the execution function uses the updated query document. Previously, only the query document rendered the first time would be used for the request.
  • #10660 364bee98f Thanks @alessbell! - Upgrades TypeScript to v5. This change is fully backward-compatible and transparent to users.

  • #10597 8fb9d190d Thanks @phryneas! - Fix a bug where an incoming cache update could prevent future updates from the active link.

  • #10629 02605bb3c Thanks @phryneas! - useQuery: delay unsubscribe to fix race conditions