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

Adjust useReadQuery wrapper logic to work with transported objects. #11757

Merged
merged 2 commits into from
Apr 8, 2024

Conversation

phryneas
Copy link
Member

@phryneas phryneas commented Apr 5, 2024

Prerequisite for apollographql/apollo-client-nextjs#258.

Because in that situation, useReadQuery is not called with a real queryRef, but with some serializable "transport object", the existing logic crashed when trying to access undefined["observable"] (since transportObject[QUERY_REFERENCE_SYMBOL] would be undefined, as symbol properties cannot be (de)serialized)

Copy link

changeset-bot bot commented Apr 5, 2024

🦋 Changeset detected

Latest commit: 216398d

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

This PR includes changesets to release 1 package
Name Type
@apollo/client Patch

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

@phryneas
Copy link
Member Author

phryneas commented Apr 5, 2024

/release:pr

Copy link
Contributor

github-actions bot commented Apr 5, 2024

A new release has been made for this PR. You can install it with:

npm i @apollo/[email protected]

Copy link
Contributor

github-actions bot commented Apr 5, 2024

size-limit report 📦

Path Size
dist/apollo-client.min.cjs 38.6 KB (+0.02% 🔺)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" 46.46 KB (+0.02% 🔺)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" (production) 44.02 KB (+0.02% 🔺)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" 34.16 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" (production) 32.04 KB (0%)
import { ApolloProvider } from "dist/react/index.js" 1.24 KB (0%)
import { ApolloProvider } from "dist/react/index.js" (production) 1.22 KB (0%)
import { useQuery } from "dist/react/index.js" 5.27 KB (0%)
import { useQuery } from "dist/react/index.js" (production) 4.35 KB (0%)
import { useLazyQuery } from "dist/react/index.js" 5.51 KB (0%)
import { useLazyQuery } from "dist/react/index.js" (production) 4.58 KB (0%)
import { useMutation } from "dist/react/index.js" 3.51 KB (0%)
import { useMutation } from "dist/react/index.js" (production) 2.73 KB (0%)
import { useSubscription } from "dist/react/index.js" 3.19 KB (0%)
import { useSubscription } from "dist/react/index.js" (production) 2.38 KB (0%)
import { useSuspenseQuery } from "dist/react/index.js" 5.45 KB (0%)
import { useSuspenseQuery } from "dist/react/index.js" (production) 4.11 KB (0%)
import { useBackgroundQuery } from "dist/react/index.js" 4.92 KB (0%)
import { useBackgroundQuery } from "dist/react/index.js" (production) 3.58 KB (0%)
import { useLoadableQuery } from "dist/react/index.js" 5.03 KB (0%)
import { useLoadableQuery } from "dist/react/index.js" (production) 3.69 KB (0%)
import { useReadQuery } from "dist/react/index.js" 3.31 KB (+4.37% 🔺)
import { useReadQuery } from "dist/react/index.js" (production) 3.25 KB (+4.52% 🔺)
import { useFragment } from "dist/react/index.js" 2.29 KB (0%)
import { useFragment } from "dist/react/index.js" (production) 2.24 KB (0%)

Copy link

netlify bot commented Apr 5, 2024

Deploy Preview for apollo-client-docs ready!

Name Link
🔨 Latest commit 216398d
🔍 Latest deploy log https://app.netlify.com/sites/apollo-client-docs/deploys/660fdc882f76880008bb8fc0
😎 Deploy Preview https://deploy-preview-11757--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.

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.

Seems reasonable to me! This is such an exciting feature 🎉

@github-actions github-actions bot added the auto-cleanup 🤖 label Apr 5, 2024
@phryneas phryneas merged commit 9825295 into release-3.10 Apr 8, 2024
35 checks passed
@phryneas phryneas deleted the pr/useReadQuery-wrap-fallback-client branch April 8, 2024 15:56
@github-actions github-actions bot mentioned this pull request Apr 8, 2024
@github-actions github-actions bot mentioned this pull request Apr 24, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants