Homepage

Durable storage for key-value pairs

Last edit:

This section describes an easy way to persist key => value pairs across requests.

Problem

Currently, there is no easy way to persist key => value pairs for an Instance for later use. An example use case for such a feature can be Salesforce integration. You authorize to Salesforce by sending a time-consuming API call to get an authorization token in return. This token is valid for 2 hours since the last use. If you wanted to be able to re-use this token instead of sending an unnecessary authorization call every time you want to send an API call to Salesforce, you would need to create a Model Schema and then write GraphQL queries and mutations to manage it. It is doable, but difficult for beginners.

Solution

The solution is to create a new tag, for example {% storage 'my_key', 'my_value' %}, which would be accessible later via{{ context.storage.my_key }}. There is potential to enhance this solution later on with, for example, being able to specify the expire key.

Questions?

We are always happy to help with any questions you may have.

contact us