Open barbalex opened 5 years ago
These are braking changes!
If this is the expected behaviour, then the major version should have been bumped.
I normally destruct the data
object for "cleaner" code:
const {data: {human}} = useQuery(...);
Any news on this?
@darrikonn Before version 1.0.0 any version may break, as far as I know. But if this is really a breaking change that should be mentioned in the release notes.
This query: https://github.com/barbalex/vermehrung/blob/0a7bc911e9d5e5dcd8493e4c5e091833802e99d6/src/components/TreeContainer/index.js#L41 works fine in v0.4.5.
It breaks in v0.5.0 with this error, before the query is run:
When the error occurs the query has not been run, judging by the network panel. The return value from the query is:
Seems that
data
was not undefined before? Becauseundefined
breaks my next line of code:When setting it to:
it works again.
Yep, if I set react-apollo-hooks back to v0.4.5 the output of my console.log is:
So data used to return as an empty object and is now returned as
undefined
.Don't know if returning an empty object was non-standard behaviour?