-
Notifications
You must be signed in to change notification settings - Fork 25
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
Allow fragment refs to be null or undefined #94
Conversation
@@ -193,6 +252,39 @@ export function usePaginationFragment< | |||
isLoadingNext: boolean; | |||
isLoadingPrevious: boolean; | |||
refetch: RefetchFn<TQuery["variables"]>; | |||
}; | |||
export function usePaginationFragment< |
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.
How is this definition different from one below?
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.
If you mean the one with the implementation then it isn't different. But afaik you can't have the implementation serve as one of the definitions.
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.
Aha, one is definition the other implementation
96ddc10
to
960ca0b
Compare
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.
Looks good, just some minor feedback 👍
Relay allows for fragment references to be
null
orundefined
. Our typings have been stricter where they do not allownull
orundefined
.This causes us to miss out on things like
@skip
and@include
.This PR adds the ability to pass
null
orundefined
as the fragment reference touseFragment
usePaginationFragment
oruseRefetchableFragment
.