-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optimisticResponse freezes / lags UI #6201
Comments
Can you share two performance profiles/flame graphs that show the time between the click and the finished rendering (with and without |
The cache updates take much less time than the 500-1000 ms you mentioned above, so the performance problem may be caused by the re-rendering that's happening after the update. The reason why I was asking about |
I've been digging into this and I think it's because we have one large query that's a combination of a few queries and the single object gets quite large because of that. I'm starting to break it down into smaller queries and seeing if updating the cache will be improved this way. So when we write to the cache it updates a smaller portion. |
We were able to get around this through various changes to our app. The largest change was breaking down one massive query we had into lots of smaller queries. We should've done this in the beginning but were fairly new to GraphQL when we started. With those three updates things are feeling a lot faster and we haven't run into massive lag issues. |
Hey brotzky, In my example i got a Query FETCH_CITIES_QUERY which gets me around 25 000 entries of cities. |
I'm not 100% sure this is a bug, but whenever we use
optimisticResponse
on a mutation hook the UI will freeze for ~500-1000ms. Removing theoptimisticResponse
will render the UI updates without any lag -- the feedback is instant.For example, a user selects an option from a dropdown and the dropdown will only close 500ms after they've selected. If we remove the
optimisticResponse
the dropdown closes immediately.I was wondering if anyone's had this issue and if there's a workaround? We want to update the UI as the user selects an option but can't because of the lag.
Here's an example of of a mutation with an
optmisticResponse
that would delay an UI updates--
The text was updated successfully, but these errors were encountered: