apollo-feature-requests icon indicating copy to clipboard operation
apollo-feature-requests copied to clipboard

feat(client): checking if it's optimistic response from mutation's `update` callback.

Open jjangga0214 opened this issue 9 months ago • 0 comments


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`
    }

jjangga0214 avatar Jan 15 '25 07:01 jjangga0214