-
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
Leave TData
alone in Unmasked
if it does not contain fragment refs
#12267
Conversation
🦋 Changeset detectedLatest commit: 213bcb1 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 |
✅ Docs preview has no changesThe preview was not built because there were no changes. Build ID: 672bbfe98bb926888f96a559 |
commit: |
✅ Deploy Preview for apollo-client-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
size-limit report 📦
|
TData
alone in Unmasked
if it does not contain fragment refs
My thoughts on handling the case where scalars are generated as tagged types: We should probably check to see if the value of the key extends a primitive and leave the type alone if so. We have this branch in : TData extends object ?
{
[K in keyof TData]: UnwrapFragmentRefs<TData[K]>;
} Using a tagged type (i.e. // where `Primitive` is our `Primitive` type in src/utilities/types/Primitive.ts
TData extends Primitive ? TData : // ... |
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.
This looks like a good plan to me.
Hi. This
In the bundle, it actually produces the error
|
@DmitryMasley are you saying that this PR introduces this error, or that this error already exists in published versions? If the latter, can you open a new issue for that? |
It already exists in the |
Gonna fill the issue, though it may be connected, since the issue is caused by |
Partially fixes #12266
Moves the
ContainsFragmentRefs
check fromMaybeMasked
to theUnmasked
type to leaveTData
alone whenTData
does not contain fragment refs.We will still need a solution that works after masked types are generated for situations like #12266.