I am following the tutorial to edit an existing order with Admin API. In total, 4 requests are required to accomplish the task of adding a free variant to an existing order programmatically.
Understandably, the result of the prior mutation is used in the next mutation in the sequence stated above.
For example: the id of the addedLineItems returned from the addVariantToOrder is used in the orderEditAddLineItemDiscount mutation to apply a discount to the newly added line item.
However, I wanted to know if there is any way to lessen the number of requests in order to fulfill the same task. I am concern about the delays on the frontend for the user due the many "roundtrips" involved between the client and the server. I have tried searching online and it seems that there is no way to pipe result from one mutation to another in GraphQL.
Any advice is appreciated!
User | Count |
---|---|
14 | |
8 | |
7 | |
7 | |
6 |