Intended outcome:
Re-rendering a component with a mutation using options.client should not throw an error.
Actual outcome:
Invariant Violation
The operation 'addPerson' wrapping 'Foo' is expecting a variable: 'person' but it was not found in the props passed to 'Apollo(Foo)'
How to reproduce the issue:
https://codesandbox.io/s/v57lv7275
When debugging I've found that GraphQL.prototype.componentWillReceiveProps fires and falls into the if (this.client !== client && this.client !== nextContext.client) { block which then calls this.updateQuery(nextProps) and then this.calculateOptions(props) from there. The operation.variables has length so it loops through and throws this error.
The error does not occur if I remove the mutation options.client.
Version
What happens with this bug ? Also occurs in react-apollo 1.4.15 on the same conditions
Looks fine with updated dependencies https://codesandbox.io/s/98lz33wr0y
Most helpful comment
What happens with this bug ? Also occurs in react-apollo 1.4.15 on the same conditions