apollo-feature-requests
apollo-feature-requests copied to clipboard
feat(client): checking if it's optimistic response from mutation's `update` callback.
const [mutation] = useMutation(ExampleMutation, {
optimisticResponse: {
foo: 'bar'
},
update(cache, { data }) {
// From here, how can I know if the `data` is from `optimisticResponse` or a real response?
}
})
update(cache, { data, isOptimistic }) {
// I suggest an option like `isOptimistic`
}