3 ms·
Not the OP but one option that HTTP/2 makes possible is to pipeline the requests. GET /invoices?invoicesQuery=criteria GET /invoices/orders?invoicesQue
by stickfigure 6y ago
Not the OP but one option that HTTP/2 makes possible is to pipeline the requests.
GET /invoices?invoicesQuery=criteria
GET /invoices/orders?invoicesQuery=criteria
This doesn't take longer than graphql (because you're not waiting for the first response) and is a lot simpler.
- frosted-flakes 6y agoHow does that work when the second request depends on the results of the first request?
- stickfigure 6y agoIt doesn't. But graphql doesn't help in that case either.
- deleted 6y ago[deleted]
- spiralx 6y agoYou'd get the order(s) embedded with their invoice in GraphQL in a single request, applying the criteria to the invoices. Or you'd get orders matching the criteria with its invoice(s) inline. Doing two requests would be way more complicated for the developer to write.
- stickfigure 6y agoNonsense. As someone who's spent the last year and a half working with Shopify's API, it's far more complex to formulate a single request and then extract all the parts out of it. Especially if there's any kind of pagination involved. Shopify's REST API is way easier to use, it's just slower. If pipelining solved the latency issue, it would be an all round superior experience.