@envelop/response-cache 4.0.0 → 4.0.1
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/README.md +6 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -38,13 +38,13 @@ When configuring the `useResponseCache`, you can choose the type of cache:
|
|
|
38
38
|
The in-memory LRU cache is used by default.
|
|
39
39
|
|
|
40
40
|
```ts
|
|
41
|
-
import { parse, validate, execute, subscribe } from 'graphql'
|
|
41
|
+
import { parse, validate, specifiedRules, execute, subscribe } from 'graphql'
|
|
42
42
|
import { envelop, useEngine } from '@envelop/core'
|
|
43
43
|
import { useResponseCache } from '@envelop/response-cache'
|
|
44
44
|
|
|
45
45
|
const getEnveloped = envelop({
|
|
46
46
|
plugins: [
|
|
47
|
-
useEngine({ parse, validate, execute, subscribe }),
|
|
47
|
+
useEngine({ parse, validate, specifiedRules, execute, subscribe }),
|
|
48
48
|
// ... other plugins ...
|
|
49
49
|
useResponseCache({
|
|
50
50
|
// use global cache for all operations
|
|
@@ -57,7 +57,7 @@ const getEnveloped = envelop({
|
|
|
57
57
|
Or, you may create the in-memory LRU cache explicitly.
|
|
58
58
|
|
|
59
59
|
```ts
|
|
60
|
-
import { parse, validate, execute, subscribe } from 'graphql'
|
|
60
|
+
import { parse, validate, specifiedRules, execute, subscribe } from 'graphql'
|
|
61
61
|
import { envelop, useEngine } from '@envelop/core'
|
|
62
62
|
import { useResponseCache, createInMemoryCache } from '@envelop/response-cache'
|
|
63
63
|
|
|
@@ -65,7 +65,7 @@ const cache = createInMemoryCache()
|
|
|
65
65
|
|
|
66
66
|
const getEnveloped = envelop({
|
|
67
67
|
plugins: [
|
|
68
|
-
useEngine({ parse, validate, execute, subscribe }),
|
|
68
|
+
useEngine({ parse, validate, specifiedRules, execute, subscribe }),
|
|
69
69
|
// ... other plugins ...
|
|
70
70
|
useResponseCache({
|
|
71
71
|
cache,
|
|
@@ -80,13 +80,13 @@ const getEnveloped = envelop({
|
|
|
80
80
|
### Cache based on session/user
|
|
81
81
|
|
|
82
82
|
```ts
|
|
83
|
-
import { parse, validate, execute, subscribe } from 'graphql'
|
|
83
|
+
import { parse, validate, specifiedRules, execute, subscribe } from 'graphql'
|
|
84
84
|
import { envelop, useEngine } from '@envelop/core'
|
|
85
85
|
import { useResponseCache } from '@envelop/response-cache'
|
|
86
86
|
|
|
87
87
|
const getEnveloped = envelop({
|
|
88
88
|
plugins: [
|
|
89
|
-
useEngine({ parse, validate, execute, subscribe }),
|
|
89
|
+
useEngine({ parse, validate, specifiedRules, execute, subscribe }),
|
|
90
90
|
// ... other plugins ...
|
|
91
91
|
useResponseCache({
|
|
92
92
|
ttl: 2000,
|
package/package.json
CHANGED