How to subscribe to relay / graphql mutation progress event

I want to use mutations to upload files, too, but I can’t find a way to track the progress of the mutation (loading it, similar to the XMLHttpRequest progress event). Afaik relays use sampling, but sampling provides no way to track progress ( https://github.com/whatwg/fetch/issues/21 ).

So what is the best solution? Write a user network layer that uses XMLHttpRequest? But then again, how do I get the link to the request object back to the caller Store.commitUpdate...?

+4
source share
1 answer

In this case, you should use GraphQL subscriptions. Want an example? Please go here: https://github.com/evolastech/todo-react

0
source

Source: https://habr.com/ru/post/1658069/


All Articles