@envelop/persisted-operations 4.5.1-alpha-20220824165935-4720f031 → 4.6.0
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 +0 -18
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -15,7 +15,6 @@ yarn add @envelop/persisted-operations
|
|
|
15
15
|
The most basic implementation can use an in-memory JS `Map` wrapper with a `Store` object:
|
|
16
16
|
|
|
17
17
|
```ts
|
|
18
|
-
import { parse, validate, execute, subscribe } from 'graphql'
|
|
19
18
|
import { envelop } from '@envelop/core'
|
|
20
19
|
import { usePersistedOperations, InMemoryStore } from '@envelop/persisted-operations'
|
|
21
20
|
|
|
@@ -29,10 +28,6 @@ const store = new InMemoryStore({
|
|
|
29
28
|
})
|
|
30
29
|
|
|
31
30
|
const getEnveloped = envelop({
|
|
32
|
-
parse,
|
|
33
|
-
validate,
|
|
34
|
-
execute,
|
|
35
|
-
subscribe,
|
|
36
31
|
plugins: [
|
|
37
32
|
// ... other plugins ...
|
|
38
33
|
usePersistedOperations({
|
|
@@ -63,8 +58,6 @@ usePersistedOperations({
|
|
|
63
58
|
## Usage Example with built-in JsonFileStore
|
|
64
59
|
|
|
65
60
|
```ts
|
|
66
|
-
import { parse, validate, execute, subscribe } from 'graphql'
|
|
67
|
-
import { envelop } from '@envelop/core'
|
|
68
61
|
import { usePersistedOperations, JsonFileStore } from '@envelop/persisted-operations'
|
|
69
62
|
|
|
70
63
|
const persistedOperationsStore = new JsonFilesStore()
|
|
@@ -77,10 +70,6 @@ persistedOperationsStore.loadFromFileSync(filePath) // load and parse persisted-
|
|
|
77
70
|
await persistedOperationsStore.loadFromFile(filePath) // load and parse persisted-operations files
|
|
78
71
|
|
|
79
72
|
const getEnveloped = envelop({
|
|
80
|
-
parse,
|
|
81
|
-
validate,
|
|
82
|
-
execute,
|
|
83
|
-
subscribe,
|
|
84
73
|
plugins: [
|
|
85
74
|
// ... other plugins ...
|
|
86
75
|
usePersistedOperations({
|
|
@@ -95,14 +84,7 @@ const getEnveloped = envelop({
|
|
|
95
84
|
The `store` parameter accepts both a `Store` instance, or a function. If you need to support multiple stores (based on incoming GraphQL operation/HTTP request), you can provide a function to toggle between the stores, based on your needs:
|
|
96
85
|
|
|
97
86
|
```ts
|
|
98
|
-
import { parse, validate, execute, subscribe } from 'graphql'
|
|
99
|
-
import { envelop } from '@envelop/core'
|
|
100
|
-
|
|
101
87
|
const getEnveloped = envelop({
|
|
102
|
-
parse,
|
|
103
|
-
validate,
|
|
104
|
-
execute,
|
|
105
|
-
subscribe,
|
|
106
88
|
plugins: [
|
|
107
89
|
// ... other plugins ...
|
|
108
90
|
usePersistedOperations({
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/persisted-operations",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@envelop/core": "2.
|
|
6
|
+
"@envelop/core": "^2.6.0",
|
|
7
7
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
8
8
|
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"tslib": "^2.4.0"
|
|
11
|
+
},
|
|
9
12
|
"repository": {
|
|
10
13
|
"type": "git",
|
|
11
14
|
"url": "https://github.com/n1ru4l/envelop.git",
|