@graphql-yoga/plugin-response-cache 3.0.0 → 3.1.0-alpha-20231030113255-863e6833
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 +4 -1
- package/esm/index.js +1 -0
- package/package.json +2 -2
- package/typings/index.d.cts +2 -2
- package/typings/index.d.ts +2 -2
package/cjs/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createInMemoryCache = exports.useResponseCache = void 0;
|
|
3
|
+
exports.createInMemoryCache = exports.useResponseCache = exports.hashSHA256 = exports.cacheControlDirective = void 0;
|
|
4
4
|
const response_cache_1 = require("@envelop/response-cache");
|
|
5
|
+
var response_cache_2 = require("@envelop/response-cache");
|
|
6
|
+
Object.defineProperty(exports, "cacheControlDirective", { enumerable: true, get: function () { return response_cache_2.cacheControlDirective; } });
|
|
7
|
+
Object.defineProperty(exports, "hashSHA256", { enumerable: true, get: function () { return response_cache_2.hashSHA256; } });
|
|
5
8
|
const operationIdByRequest = new WeakMap();
|
|
6
9
|
const sessionByRequest = new WeakMap();
|
|
7
10
|
function sessionFactoryForEnvelop({ request }) {
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defaultBuildResponseCacheKey, createInMemoryCache as envelopCreateInMemoryCache, resultWithMetadata, useResponseCache as useEnvelopResponseCache, } from '@envelop/response-cache';
|
|
2
|
+
export { cacheControlDirective, hashSHA256 } from '@envelop/response-cache';
|
|
2
3
|
const operationIdByRequest = new WeakMap();
|
|
3
4
|
const sessionByRequest = new WeakMap();
|
|
4
5
|
function sessionFactoryForEnvelop({ request }) {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-yoga/plugin-response-cache",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0-alpha-20231030113255-863e6833",
|
|
4
4
|
"description": "",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"graphql": "^15.2.0 || ^16.0.0",
|
|
7
7
|
"graphql-yoga": "^5.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@envelop/response-cache": "^6.
|
|
10
|
+
"@envelop/response-cache": "^6.1.0"
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
package/typings/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ExecutionResult } from 'graphql';
|
|
2
2
|
import { Maybe, Plugin, PromiseOrValue } from 'graphql-yoga';
|
|
3
3
|
import { BuildResponseCacheKeyFunction as EnvelopBuildResponseCacheKeyFunction, Cache as EnvelopCache, ResponseCacheExtensions as EnvelopResponseCacheExtensions, UseResponseCacheParameter as UseEnvelopResponseCacheParameter } from '@envelop/response-cache';
|
|
4
|
+
export { cacheControlDirective, hashSHA256 } from '@envelop/response-cache';
|
|
4
5
|
export type BuildResponseCacheKeyFunction = (params: Omit<Parameters<EnvelopBuildResponseCacheKeyFunction>[0], 'context'> & {
|
|
5
6
|
request: Request;
|
|
6
7
|
}) => ReturnType<EnvelopBuildResponseCacheKeyFunction>;
|
|
@@ -17,9 +18,8 @@ export interface ResponseCachePluginExtensions {
|
|
|
17
18
|
responseCache: EnvelopResponseCacheExtensions;
|
|
18
19
|
[key: string]: unknown;
|
|
19
20
|
}
|
|
20
|
-
interface Cache extends EnvelopCache {
|
|
21
|
+
export interface Cache extends EnvelopCache {
|
|
21
22
|
get(key: string): Promise<ExecutionResult<Record<string, unknown>, ResponseCachePluginExtensions> | undefined>;
|
|
22
23
|
}
|
|
23
24
|
export declare function useResponseCache(options: UseResponseCacheParameter): Plugin;
|
|
24
25
|
export declare const createInMemoryCache: (params?: import("@envelop/response-cache").InMemoryCacheParameter | undefined) => Cache;
|
|
25
|
-
export {};
|
package/typings/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ExecutionResult } from 'graphql';
|
|
2
2
|
import { Maybe, Plugin, PromiseOrValue } from 'graphql-yoga';
|
|
3
3
|
import { BuildResponseCacheKeyFunction as EnvelopBuildResponseCacheKeyFunction, Cache as EnvelopCache, ResponseCacheExtensions as EnvelopResponseCacheExtensions, UseResponseCacheParameter as UseEnvelopResponseCacheParameter } from '@envelop/response-cache';
|
|
4
|
+
export { cacheControlDirective, hashSHA256 } from '@envelop/response-cache';
|
|
4
5
|
export type BuildResponseCacheKeyFunction = (params: Omit<Parameters<EnvelopBuildResponseCacheKeyFunction>[0], 'context'> & {
|
|
5
6
|
request: Request;
|
|
6
7
|
}) => ReturnType<EnvelopBuildResponseCacheKeyFunction>;
|
|
@@ -17,9 +18,8 @@ export interface ResponseCachePluginExtensions {
|
|
|
17
18
|
responseCache: EnvelopResponseCacheExtensions;
|
|
18
19
|
[key: string]: unknown;
|
|
19
20
|
}
|
|
20
|
-
interface Cache extends EnvelopCache {
|
|
21
|
+
export interface Cache extends EnvelopCache {
|
|
21
22
|
get(key: string): Promise<ExecutionResult<Record<string, unknown>, ResponseCachePluginExtensions> | undefined>;
|
|
22
23
|
}
|
|
23
24
|
export declare function useResponseCache(options: UseResponseCacheParameter): Plugin;
|
|
24
25
|
export declare const createInMemoryCache: (params?: import("@envelop/response-cache").InMemoryCacheParameter | undefined) => Cache;
|
|
25
|
-
export {};
|