Skip to content

add dataState to useFragment, DataValue type to useSuspenseFragment #12757

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

Merged
merged 4 commits into from
Jul 8, 2025

Conversation

phryneas
Copy link
Member

@phryneas phryneas commented Jul 2, 2025

I noticed we had missed these.

@phryneas phryneas requested a review from jerelmiller July 2, 2025 08:55
Copy link

changeset-bot bot commented Jul 2, 2025

🦋 Changeset detected

Latest commit: cbc7e3c

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

pkg-pr-new bot commented Jul 2, 2025

npm i https://pkg.pr.new/apollographql/apollo-client/@apollo/client@12757

commit: cbc7e3c

// valid return value
data: diff.result === null ? {} : diff.result,
}),
} as Cache.DiffResult<TData> // TODO: Remove assertion
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved this assertion one level in - although it needs an any there I believe it's more restrictive that way.

Copy link
Contributor

github-actions bot commented Jul 2, 2025

size-limit report 📦

Path Size
import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client" (CJS) 42.67 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client" (production) (CJS) 37.76 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client" 32.57 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client" (production) 26.98 KB (0%)
import { ApolloProvider } from "@apollo/client/react" 5.7 KB (0%)
import { ApolloProvider } from "@apollo/client/react" (production) 960 B (0%)
import { useQuery } from "@apollo/client/react" 7.02 KB (0%)
import { useQuery } from "@apollo/client/react" (production) 2.23 KB (0%)
import { useLazyQuery } from "@apollo/client/react" 6.89 KB (0%)
import { useLazyQuery } from "@apollo/client/react" (production) 2.13 KB (0%)
import { useMutation } from "@apollo/client/react" 6.23 KB (0%)
import { useMutation } from "@apollo/client/react" (production) 1.47 KB (0%)
import { useSubscription } from "@apollo/client/react" 6.56 KB (0%)
import { useSubscription } from "@apollo/client/react" (production) 1.81 KB (0%)
import { useSuspenseQuery } from "@apollo/client/react" 8.34 KB (0%)
import { useSuspenseQuery } from "@apollo/client/react" (production) 3.61 KB (0%)
import { useBackgroundQuery } from "@apollo/client/react" 8.09 KB (0%)
import { useBackgroundQuery } from "@apollo/client/react" (production) 3.37 KB (0%)
import { useLoadableQuery } from "@apollo/client/react" 8.06 KB (0%)
import { useLoadableQuery } from "@apollo/client/react" (production) 3.35 KB (0%)
import { useReadQuery } from "@apollo/client/react" 6.39 KB (0%)
import { useReadQuery } from "@apollo/client/react" (production) 1.63 KB (0%)
import { useFragment } from "@apollo/client/react" 6.45 KB (+0.42% 🔺)
import { useFragment } from "@apollo/client/react" (production) 1.7 KB (+1.58% 🔺)

@@ -140,10 +140,14 @@ describe("useFragment", () => {
}

await waitFor(() => {
expect(getItemTexts()).toEqual(["Item #1", "Item #2", "Item #5"]);
expect(getItemTexts()).toStrictEqualTyped([
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I was at it, I replaced all toEqual in the file with toStrictEqualTyped.

Copy link

@Hardanish-Singh Hardanish-Singh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@jerelmiller jerelmiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@github-actions github-actions bot added the auto-cleanup 🤖 label Jul 8, 2025
@apollo-librarian
Copy link

apollo-librarian bot commented Jul 8, 2025

❌ Docs preview failed

The preview failed to build.

Build ID: 12618a0e434c7eeb7ebea5db

Errors

General: other side closed

@phryneas phryneas merged commit 5fd2e7c into release-4.0 Jul 8, 2025
42 of 43 checks passed
@github-actions github-actions bot mentioned this pull request Jul 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants