-
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
useFragment
: remove returnPartialData
option
#10836
Conversation
🦋 Changeset detectedLatest commit: 784fe04 The changes in this PR will be included in the next version bump. 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 |
// Since the above definition of UseFragmentOptions can be hard to parse without | ||
// help from TypeScript/VSCode, here are the intended fields and their types. | ||
// Uncomment this code to check that it's consistent with the definition above. | ||
// | ||
// export interface UseFragmentOptions<TData, TVars> { | ||
// from: string | StoreObject | Reference; | ||
// fragment: DocumentNode | TypedDocumentNode<TData, TVars>; | ||
// fragmentName?: string; | ||
// optimistic?: boolean; | ||
// variables?: TVars; | ||
// returnPartialData?: boolean; | ||
// canonizeResults?: boolean; | ||
// } |
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 removed this comment and added a type test for this interface shape instead.
@@ -84,9 +62,10 @@ export function useFragment_experimental< | |||
|
|||
const diffOptions: Cache.DiffOptions<TData, TVars> = { | |||
...rest, | |||
returnPartialData: true, |
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.
forcing returnPartialData
to true in case someone isn't using TypeScript and keeps using the option.
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 change looks great! I like this decision a lot. Feel free to accept/skip any of my formatting suggestions.
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.
🙌
Co-authored-by: Jerel Miller <jerelmiller@gmail.com>
Checklist: