reasonml-community / reason-apollo-hooks

Deprecated in favor of https://github.com/reasonml-community/graphql-ppx
https://reasonml-community.github.io/reason-apollo-hooks/
MIT License
137 stars 28 forks source link

fix: makes mutate promise return Error even if there was data #96

Closed mbirkegaard closed 4 years ago

mbirkegaard commented 4 years ago

This PR reorders the switch that produced the result('data) returned by the mutate function, so that the promise resolves to Error when when error is non-null and data is either, whereas the previous version only resolves to Error when data is null.

This make the behaviour consistent with the controlledVariantResult('data).

mbirkegaard commented 4 years ago

Credit goes to @Emilios1995 for finding the bug.

fakenickels commented 4 years ago

Amazing!