@graphql-mesh/plugin-response-cache 0.104.2 → 0.104.3-alpha-20250406195032-2960958ac5a21aa1a12cd847dd6be62ac76da5bf
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.js +3 -0
- package/esm/index.js +3 -0
- package/package.json +1 -1
- package/typings/index.d.cts +1 -1
- package/typings/index.d.ts +1 -1
package/cjs/index.js
CHANGED
|
@@ -47,6 +47,9 @@ function getShouldCacheResult(shouldCacheResultDef) {
|
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
function getCacheForResponseCache(meshCache) {
|
|
50
|
+
if (!meshCache) {
|
|
51
|
+
throw new Error('Response Cache is enabled, but no cache is configured. Please provide a cache instance through the `cache` option.');
|
|
52
|
+
}
|
|
50
53
|
return {
|
|
51
54
|
get(responseId) {
|
|
52
55
|
return meshCache.get(`response-cache:${responseId}`);
|
package/esm/index.js
CHANGED
|
@@ -43,6 +43,9 @@ function getShouldCacheResult(shouldCacheResultDef) {
|
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
function getCacheForResponseCache(meshCache) {
|
|
46
|
+
if (!meshCache) {
|
|
47
|
+
throw new Error('Response Cache is enabled, but no cache is configured. Please provide a cache instance through the `cache` option.');
|
|
48
|
+
}
|
|
46
49
|
return {
|
|
47
50
|
get(responseId) {
|
|
48
51
|
return meshCache.get(`response-cache:${responseId}`);
|
package/package.json
CHANGED
package/typings/index.d.cts
CHANGED
|
@@ -26,5 +26,5 @@ export default function useMeshResponseCache(options: ResponseCacheConfig): Gate
|
|
|
26
26
|
* @param options
|
|
27
27
|
*/
|
|
28
28
|
export default function useMeshResponseCache(options: YamlConfig.ResponseCacheConfig & {
|
|
29
|
-
cache
|
|
29
|
+
cache?: KeyValueCache;
|
|
30
30
|
}): GatewayPlugin;
|
package/typings/index.d.ts
CHANGED
|
@@ -26,5 +26,5 @@ export default function useMeshResponseCache(options: ResponseCacheConfig): Gate
|
|
|
26
26
|
* @param options
|
|
27
27
|
*/
|
|
28
28
|
export default function useMeshResponseCache(options: YamlConfig.ResponseCacheConfig & {
|
|
29
|
-
cache
|
|
29
|
+
cache?: KeyValueCache;
|
|
30
30
|
}): GatewayPlugin;
|