@envelop/validation-cache 4.2.0 → 4.4.0-alpha-3936561.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/index.js +2 -6
- package/index.mjs +2 -4
- package/package.json +2 -5
package/index.js
CHANGED
|
@@ -2,16 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const core = require('@envelop/core');
|
|
7
6
|
const graphql = require('graphql');
|
|
8
|
-
const lru = _interopDefault(require('tiny-lru'));
|
|
9
7
|
|
|
10
|
-
const DEFAULT_MAX = 1000;
|
|
11
|
-
const DEFAULT_TTL = 3600000;
|
|
12
8
|
const rawDocumentSymbol = Symbol('rawDocument');
|
|
13
9
|
const useValidationCache = (pluginOptions = {}) => {
|
|
14
|
-
const resultCache = typeof pluginOptions.cache !== 'undefined' ? pluginOptions.cache :
|
|
10
|
+
const resultCache = typeof pluginOptions.cache !== 'undefined' ? pluginOptions.cache : core.getInMemoryLRUCache();
|
|
15
11
|
return {
|
|
16
12
|
onSchemaChange() {
|
|
17
13
|
resultCache.clear();
|
package/index.mjs
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
+
import { getInMemoryLRUCache } from '@envelop/core';
|
|
1
2
|
import { print } from 'graphql';
|
|
2
|
-
import lru from 'tiny-lru';
|
|
3
3
|
|
|
4
|
-
const DEFAULT_MAX = 1000;
|
|
5
|
-
const DEFAULT_TTL = 3600000;
|
|
6
4
|
const rawDocumentSymbol = Symbol('rawDocument');
|
|
7
5
|
const useValidationCache = (pluginOptions = {}) => {
|
|
8
|
-
const resultCache = typeof pluginOptions.cache !== 'undefined' ? pluginOptions.cache :
|
|
6
|
+
const resultCache = typeof pluginOptions.cache !== 'undefined' ? pluginOptions.cache : getInMemoryLRUCache();
|
|
9
7
|
return {
|
|
10
8
|
onSchemaChange() {
|
|
11
9
|
resultCache.clear();
|
package/package.json
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/validation-cache",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0-alpha-3936561.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@envelop/core": "
|
|
6
|
+
"@envelop/core": "2.4.0-alpha-3936561.0",
|
|
7
7
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
8
8
|
},
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"tiny-lru": "7.0.6"
|
|
11
|
-
},
|
|
12
9
|
"repository": {
|
|
13
10
|
"type": "git",
|
|
14
11
|
"url": "https://github.com/dotansimha/envelop.git",
|