title: Mutation error handling in Apollo Client 2.1
body: <p>The new Apollo Client 2.1 uses the render props patters instead of HoC pattern, so it's changed the way Queries and Mutations are handled a little. </p>
  
  <p>I have started using it, but am unsure of a few basic things. One is error handling. I have a custom "AuthResponse" component which I want to pass in either the success or error response. If it's an error (or success) at the moment I am using React's local component state to pass the error to my AuthResponse component, but I'm not sure if this is the best way?</p>
  
  <pre><code>            &lt;View style={styles.homeContainer}&gt;
              // this is where I want to pass the error to. Currently uses React component state but I'm not sure if this is the best way?
              &lt;AuthResponse
                  authResponse={(this.state &amp;&amp; this.state.authResponse) || null}
              /&gt;
              &lt;Mutation
                  mutation={registerMutation}
                  update={(cache, { data: { registerUser } }) =&gt; {
                      // user has been registered
                  }}
                  onError={error =&gt; {
                      // is this the right place to start passing errors to other components?
                      this.setState({
                          authResponse: error
                      });
                  }}
              &gt;
                  {(registerUser, { data, error }) =&gt; (
                      &lt;View&gt;
                          &lt;Formik
                              onSubmit={(
                                  values,
                                  { setSubmitting, setErrors /* setValues and other goodies */ }
                              ) =&gt; {
                                  registerUser({ variables: { ...values } });
                              }}
                              render={({
                                  handleSubmit
                              }) =&gt; (
                                  &lt;View&gt;
                                      &lt;Button
                                          onPress={handleSubmit}
                                      /&gt;
                                  &lt;/View&gt;
                              )}
                          /&gt;
                      &lt;/View&gt;
                  )}
              &lt;/Mutation&gt;
              &lt;Text onPress={this.goToLogin}&gt;Login&lt;/Text&gt;
          &lt;/View&gt;
  </code></pre>
  
  <p>I am assuming here that the Mutation component should be as small as possible - i.e. not wrap the entire page, because different areas on the screen may require different data from Query or Mutation components. </p>
  
  <p>I did consider wrapping the AuthResponse component with a Query component from Apollo Client, querying the data from local cache which I would have updating manually. This seems like a better solution but there's nothing in the docs about how to spread multiple Query/Mutation components around a page/screen.</p>
  
  <p>Thanks</p>