twenty icon indicating copy to clipboard operation
twenty copied to clipboard

add optimistic responses on mutations

Open pacyL2K19 opened this issue 4 months ago • 2 comments

This PR

  • Adds optimistic responses on Mutations
  • Related to #5676

Note to @FelixMalfait

The initial scope of the issue was to apply optimistic rendering on queries, but it seems like Apollo Client only supports it on Mutations (https://www.apollographql.com/docs/react/performance/optimistic-ui/). This PR doesn't really improve the time it takes to resolve the mutation due to the queries in the refetchQueries array Screenshot 2024-10-02 at 16 22 07 No matter how fast the mutation becomes, it still needs to re-fetch some queries(which makes 100% sense, leading to some limitations on the client side to improve the API call) Unfortunately, queries seems to be the ones delaying our API calls (see image below), maybe addressing the performance on those queries, server-side would make more sense Screenshot 2024-10-02 at 16 13 09

@FelixMalfait please have a look and tell me if I missed something

pacyL2K19 avatar Oct 02 '24 14:10 pacyL2K19