jmap-client
jmap-client copied to clipboard
Study how we could add the possibility to execute multiple queries in one API call
The idea is to minimize roundtrips to the backend. The spec defines back references that can help for the implementation I suppose...
If I got it well you mean doing stuffs like saveAsDraft and moveToOutbox in one roundtrip?
Yes @abenchi. The spec defines back references so that you can reference an entity created earlier in the same jmap operation. This will look like this:
[
[ "setMessages", { "create": { "clientIdForCreatedMessage": { ... } } }, "#0" ]
[ "setMessages", { "update": { "clientIdForMoveMessage": { "id": "#clientIdForCreatedMessage", mailboxIds: [...] } } }, "#1" ]
]
This will make both operations run in a single HTTP request, which is great as far as performance is concerned.
And the server is soo performent that you can send him hundred of commands at once.
great