react-apollo-hooks
react-apollo-hooks copied to clipboard
data is no longer defined in 0.5.0 before data is loaded
In v0.4.5 the following code would load without error:
const {
data: { subData, moreSubData }, // we want these keys specifically
loading,
} = useQuery(someQuery);
In v0.5.0 that code errors with Uncaught TypeError: Cannot read property 'subData' of undefined. It's solved by pulling those keys out of data after checking for loading.
This really starts to hurt if we have multiple queries where data is already defined in a previous query. Was it an intentional change to support the official projects behavior?
same issue for me.
is there any reason for this change?
Looking for an update on this behavior.