Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version Packages (rc) #11088

Merged
merged 1 commit into from
Aug 1, 2023
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jul 21, 2023

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or setup this action to publish automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to release-3.8, this PR will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

release-3.8 is currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, run changeset pre exit on release-3.8.

⚠️⚠️⚠️⚠️⚠️⚠️

Releases

@apollo/[email protected]

Minor Changes

  • #11112 b4aefcfe9 Thanks @jerelmiller! - Adds support for a skipToken sentinel that can be used as options in useSuspenseQuery and useBackgroundQuery to skip execution of a query. This works identically to the skip option but is more type-safe and as such, becomes the recommended way to skip query execution. As such, the skip option has been deprecated in favor of skipToken.

    We are considering the removal of the skip option from useSuspenseQuery and useBackgroundQuery in the next major. We are releasing with it now to make migration from useQuery easier and make skipToken more discoverable.

    import { skipToken } from "@apollo/client";
    
    const id: number | undefined;
    
    const { data } = useSuspenseQuery(
      query,
      id ? { variables: { id } } : skipToken
    );

    Breaking change

    Previously useBackgroundQuery would always return a queryRef whenever query execution was skipped. This behavior been updated to return a queryRef only when query execution is enabled. If initializing the hook with it skipped, queryRef is now returned as undefined.

    To migrate, conditionally render the component that accepts the queryRef as props.

    Before

    function Parent() {
      const [queryRef] = useBackgroundQuery(query, skip ? skipToken : undefined);
      //      ^? QueryReference<TData | undefined>
    
      return <Child queryRef={queryRef} />;
    }
    
    function Child({
      queryRef,
    }: {
      queryRef: QueryReference<TData | undefined>;
    }) {
      const { data } = useReadQuery(queryRef);
    }

    After

    function Parent() {
      const [queryRef] = useBackgroundQuery(query, skip ? skipToken : undefined);
      //      ^? QueryReference<TData> | undefined
    
      return queryRef ? <Child queryRef={queryRef} /> : null;
    }
    
    function Child({ queryRef }: { queryRef: QueryReference<TData> }) {
      const { data } = useReadQuery(queryRef);
    }

Patch Changes

  • #11086 0264fee06 Thanks @jerelmiller! - Fix an issue where a call to refetch, fetchMore, or changing skip to false that returned a result deeply equal to data in the cache would get stuck in a pending state and never resolve.

  • #11115 78739e3ef Thanks @phryneas! - Enforce export type for all type-level exports.

  • #11103 e3d611daf Thanks @caylahamann! - Fixes a bug in useMutation so that onError is called when an error is returned from the request with errorPolicy set to 'all' .

  • #11083 f766e8305 Thanks @phryneas! - Adjust the rerender timing of useQuery to more closely align with useFragment. This means that cache updates delivered to both hooks should trigger renders at relatively the same time. Previously, the useFragment might rerender much faster leading to some confusion.

  • #11082 0f1cde3a2 Thanks @phryneas! - Restore Apollo Client 3.7 getApolloContext behaviour

@github-actions github-actions bot force-pushed the changeset-release/release-3.8 branch 3 times, most recently from 5fb3f76 to 21b115e Compare July 27, 2023 23:44
@netlify
Copy link

netlify bot commented Jul 27, 2023

Deploy Preview for apollo-client-docs ready!

Name Link
🔨 Latest commit 21b115e
🔍 Latest deploy log https://app.netlify.com/sites/apollo-client-docs/deploys/64c301729515d300084e0c1b
😎 Deploy Preview https://deploy-preview-11088--apollo-client-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot force-pushed the changeset-release/release-3.8 branch 4 times, most recently from 77174b3 to 52eb2a9 Compare August 1, 2023 08:58
@github-actions github-actions bot force-pushed the changeset-release/release-3.8 branch from 52eb2a9 to db8a544 Compare August 1, 2023 22:23
@jerelmiller jerelmiller merged commit c6c489b into release-3.8 Aug 1, 2023
@jerelmiller jerelmiller deleted the changeset-release/release-3.8 branch August 1, 2023 22:32
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant