-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[react-apollo] Update type for QueryRenderProps #2854
Conversation
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.
👍 (Still need an approval from someone with authority obviously)
cc @wzrdzl @thymikee @rasmusprentow |
Code-wise this LGTM, I'll wait to see if the people you pinged will weigh in before merging this. |
LGTM! thanks for fixing it, it was annoying |
Thanks everyone for contributions and/or feedback! |
@ganemone just wanted to point out that
|
If Apollo ever ends up getting rid of the empty object behavior, would you guys have any opposition to changing this to just I was using a utility function that normalizes the empty object to |
Wish I had weighed in on this before merge, but my fault that I didn't. updateAfterDelete={(cache: DataProxy, {data: rawData}: FetchResult<DestroyDeviceGroupMutationData>) => {
const data = normalizeData(rawData)
if (!data) return
const {destroyDeviceGroup: {deviceGroupId}} = data |
This improves the types for QueryRenderProps with respect to
props.data
. It correctly handlesprops.data
beingnull
, an empty object, orTData
.See #2172 (comment) for more context