DEV Community

bdbch
bdbch

Posted on

2 1

Apollo GraphQL Question: How to handle invalid network requests for mutations with optimistic UI?

Hey fellow dev.to readers and writers! Today I have a quick question regarding Apollo GraphQL.

I'm currently working on an offline support feature so we can schedule mutations offline and show optimistic UI responses for them while the server does not respond.

That works fine while being offline, so everytime I submit a chat message, I get an immediate response from the Optimistic UI cache but if I go offline and send messages, I won't get any optimistic UI responses if the network requests are failing.

Am I missing something crucial on that concept?

Would love to hear from you!

Thanks!

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay