Private _cachePrivate _defaultTTLPrivate _runtimeGenerates a unique cache key based on a full query and its variables.
This method creates a UUIDv5 hash as a key for caching the full response of a query based on its query string, variables, and access keys. The key is constructed from a sorted JSON string of these components.
A UUIDv5 hash as a cache key.
The query string to be executed.
The variables applied to the query.
Access keys of the user executing the query.
Retrieves a cached value given a cache key.
This method checks whether the cached item is valid by comparing its timestamp with that of any invalidation tags. If any tag has been modified after the item was cached, the item is treated as invalid and removed.
A promise that resolves to the cached value or null if not found or invalidated.
Identifier of the tenant accessing the cache.
The cache key to look up.
Invalidates cache entries associated with a specific tag.
This method updates the timestamp for a given tag, setting it to the current date and time, which will invalidate any cache entries linked to this tag if they were cached before this timestamp.
A promise that resolves once the invalidation is complete.
Identifier of the tenant.
The tag to invalidate.
Stores data in the cache with a specified key and optional tags.
This method caches data with a key that includes the tenant id as a prefix, along with an optional list of tags that can be used for later invalidation. The data is stored with a default TTL value.
A promise that resolves when the cache operation is complete.
Identifier of the tenant for which to cache the data.
The key under which to store the data.
The actual data to be cached.
An optional array of tags for easy invalidation. Defaults to an empty array.
Generated using TypeDoc
A class to manage caching of query results.
This class provides functionality to cache query results, invalidate cached items based on tags, and retrieve cached items. It relies on a cache service for the actual storage and retrieval of cache entries.