To load customer plan data from an external system, store it in session storage, and make it available for other functionalities.
Our Solution
Created a model for store data in session storage.
In created empty cart mutation we added one plugin for store data in cart id in session storage.
Created a mutation for start plan sync. It checks the cart is available in session. If it is not available, it calls create empty cart mutation.
The mutation creates one entry in custom table and initiate message for queue process and return the result.
Created a model for external call Api call and handle the response.The queue process asynchrony call We handled the response and stored the expected data in session storage.
If we call start plan sync mutation second time it gets plans data from table.
Business Benefits
We avoid the external Api call’s delay
We store data in session storage so no need to call external api call’s multiple times.
Key Features: –
Can Create empty cart and start plan sync in single call
Call the external Api and store the data in session storage. So, we can avoid multiple external calls and avoid delays in start plan sync mutation.