API Design Best Practices for long-running Operations: GraphQL vs REST
I've recently read an article where the author stated that GraphQL is "not appropriate for long-running operations". I'd like to show that GraphQL can very well be used for long-running operations.
We'll also take a look at how such a problem can be ...
stefanatwundergraph.hashnode.dev12 min read
Simone Saviolo
A curious man, a software developer, a keyboardist, a photographer, and other personalities.
If the client can receive HTTP requests (for example, if it's an HTTP application itself making server-to-server calls), a solution I've often used is to give the client the option to specify a callback URL. This way, when the server completes the long-running operation, a request is sent to the callback URL with the relevant information (basically the same content of the
statusresponse). This addresses the issue of polling being potentially heavy on the server, but it requires the client to be more complex.