It would be nice to have a handler for streaming data #7723
Unanswered
AlexFrazer
asked this question in
Ideas
Replies: 1 comment 2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Say (for the sake of this example) you're building a chatbot like chat.openai.com and want to use react-query to handle the data side of it. I started by creating a mutation for sending a message
Here's the catch: when sending a message, I will receive back a stream of data, not an individual atomic response. I can somewhat handle it as follows:
Now this works fine enough. However, I noticed some downstream effects as a result of this. This mutation will be fairly long running and I need to do a lot to manage that
This also brings up a use case where mutations should be cancelable
Ultimately, I think it would make sense to possibly have another handler or addition to the api for this
Beta Was this translation helpful? Give feedback.
All reactions