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

Make promise from mutate return a tuple of "simple" and "full" types #99

Closed mbirkegaard closed 4 years ago

mbirkegaard commented 4 years ago

Analogous to the useMutation hook returning both controlledResult and controlledVariantResult, it would be useful to have both a variant type and a full type when handling the promise returned by mutate.

There are (same as for the hook) situations where both errors and data is needed. Only having the variant makes this impossible. If there were any errors during a mutation, the variant is just Error, yet it might contain data that we'd with to do something with regardless.

I added a draft PR #98 (which assumes #97 will be merged).

mbirkegaard commented 4 years ago

Implemented in #98