Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Added "called" prop to the Mutation component #1775

Conversation

excitement-engineer
Copy link
Contributor

Added a "called" field in the MutationResult prop returned in the render prop of the Mutation component. This field is true or false depending on whether the mutation has been called previously.

Adding this field ensures that the MutationResult object in the render prop is always defined which makes destructuring easier. In addition, this will prevent confusion about the meaning of an undefined MutationResult in the render prop as mentioned by #1773.

Would love to hear some feedback regarding these changes. Does this improve the experience of using the Mutation component.

@fbartho
Copy link

fbartho commented Mar 12, 2018

This is a breaking API change, but it really makes sense to me. I support this!

@jbaxleyiii jbaxleyiii merged commit fede11c into apollographql:master Mar 16, 2018
@janhartmann
Copy link

This is so much needed - I was upgrading our system to the beta version, but I ran into these undefined issues but could not understand why, after viewing the source code of the Mutation component.

It was because this change is not yet released. I can not wait! Nice work, guys!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants