-
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
[Data masking] Fix issue with @unmask(mode: "migrate")
with nested partial objects from parent query
#12134
Conversation
✅ Docs Preview ReadyNo new or changed pages found. |
🦋 Changeset detectedLatest commit: dcc61a7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
commit: |
src/core/masking.ts
Outdated
@@ -434,3 +447,52 @@ function warnOnImproperCacheImplementation() { | |||
); | |||
} | |||
} | |||
|
|||
function backfillFieldsWithWarnings( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Halp. This sucks. Its late so @phryneas if you have ideas on how to make this better, I'd love your feedback.
The goal of this particular function is to merge two objects that look something like this:
const albumInQuery = {
id: '1',
__typename: 'Album',
}
const albumWithWarnings = {
id: '1',
images: [...] // (get/set) with warnings
__typename: 'Album'
}
Where accessing album.id
and album.__typename
would not emit warnings (since they are in the parent query), but accessing album.images
would since its part of the fragment unmasked with warnings.
8848206
to
52be1e0
Compare
c02a3ab
to
07b38d5
Compare
5486b97
to
65bc279
Compare
size-limit report 📦
|
Fixes an issue where a query selects some fields from an object and warnings are applied to a fragment that selects from the same selection set with more fields. Currently the additional fields are masked accidentally. See the test for a reproduction.