-
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
Make private fields protected in QueryManager #11013
Make private fields protected in QueryManager #11013
Conversation
🦋 Changeset detectedLatest commit: c22ab96 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 |
size-limit report 📦
|
Could we only move over the members that are accessed by |
@jerelmiller sure, that works too - updated 👍 |
@@ -144,7 +146,7 @@ export class QueryManager<TStore> { | |||
assumeImmutableResults?: boolean; | |||
}) { | |||
const defaultDocumentTransform = new DocumentTransform( | |||
(document) => this.cache.transformDocument(document), |
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.
I really need to fix my editor so that it removes trailing whitespace 🤦♂️
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.
Prettier will take care of that soon :)
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.
Appreciate you scoping this down! LGTM
I'm gonna merge this since Alessia is OOO, and there's no good reason to let this sit around any longer :) |
This PR makes all private fields/methods on the
QueryManager
class protected, making them accessible to any class that extendsQueryManager
while remaining inaccessible externally.The main benefit for our purposes is being able to access type information in the
NextSSRApolloClient
class which (unsafely) accessesQueryManager
methods.Without going so far as to make these fields public,
protected
seems like a reasonable middle ground so we can still benefit from TS types in this scenario.Before
After
Note the

number
annotation in the D.TS output forfoo
:Checklist: