Many examples of how to Apollo involve something like
<Mutation
mutation={YOUR_MUTATION}
update={(cache, { data }) => {
// do stuff to update Apollo store
}}
>
{ mutate => ( <UI mutate={mutate} /> ) }
</Mutation>
These two rules conflict in ESLint rules and also in practice. We also know that JSX props should not use .bind() - how to avoid using bind? JSX props instantiating new arrow functions on each render aren't good practice.
- How/where do you write your
update
handlers? - If the goal is to make as many "pure" functions as possible, what's the right way to attach a handler to the
update
prop?