-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Apollo Client has null values filtered in queries since v3.9.0 when using a type policy #11560
Comments
Hi @bengry 👋 Thanks for providing the reproduction - unfortunately I'm not able to access it: Would you mind checking that it's shared publicly (assuming that was your intent)? Thanks! |
Woops, try again now please |
@bengry yes, I can view it now. I'll need to dig into this a bit more and I'm nearing the end of my day, but will take a look as soon as I can. Thanks! |
Just adding a comment here to say we're experiencing the same issue, it appears our defined For example, we have a query that returns something similar to the below; query TermsAndConditions {
xyz {
hasSignedTerms
}
} Where Unfortunately the In 3.8 this would always mean the |
I think the same happens with empty lists |
Hi all 👋 This regression is related to the bug fix in #11202. We're looking into it and should have an update soon, thanks for your patience. |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better. |
The fix will go out in a next patch release in the next day or two - I've tested snapshot release |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Issue Description
We have a type policy for handling Relay-like connection fields which broke in Apollo 3.9.0. Works fine in previous versions. See the attached repro for more information, and the behavior in
~3.8.0
vs>= v3.9.0
.The difference is that in v3.9.0 onwards, when we get
nodes: null
back from the server, this key gets removed after going through our type policy.This breaks some of the stuff we rely on, since we look at the shape of the response in some hooks, which checks if
nodes
exists ondata
, which it doesn't in>= v3.9.0
.This happens for example in this scenario (see the CSB link to see it live):
For a query that contains a nullable field, such as this:
If the backend returns:
for the following code:
in Apollo Client 3.8.x,
data
is:While in 3.9.x,
data
is:Link to Reproduction
https://codesandbox.io/p/devbox/peaceful-chihiro-p75rds
Reproduction Steps
No response
@apollo/client
version3.9.0
The text was updated successfully, but these errors were encountered: