react-apollo-hooks
react-apollo-hooks copied to clipboard
Fix fallback of `data` attribute in query result
Related to #127.
As described in https://www.apollographql.com/docs/react/essentials/queries#props, the data
object is either the actual query result, or the empty object {}
when the data is not (yet) available.
The type of QueryHookResult
should match that.
Alright, it seems it's more complicated than this. I guess we'd need a type union to differentiate between loading and/or failed queries (that have data
of {}
) and completed queries (that have actual data
).
And then there's partial queries also …