@envelop/parser-cache 10.1.1 → 10.2.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/LICENSE +3 -1
- package/cjs/index.js +7 -7
- package/esm/index.js +7 -7
- package/package.json +5 -5
- package/typings/index.d.cts +1 -1
- package/typings/index.d.ts +1 -1
package/LICENSE
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2020
|
|
3
|
+
Copyright (c) 2018-2020 Graphcool
|
|
4
|
+
Copyright (c) 2020-2021 Prisma
|
|
5
|
+
Copyright (c) 2021- The Guild
|
|
4
6
|
|
|
5
7
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
8
|
of this software and associated documentation files (the "Software"), to deal
|
package/cjs/index.js
CHANGED
|
@@ -4,14 +4,14 @@ exports.useParserCache = void 0;
|
|
|
4
4
|
const graphql_1 = require("graphql");
|
|
5
5
|
const lru_cache_1 = require("lru-cache");
|
|
6
6
|
const DEFAULT_MAX = 1000;
|
|
7
|
-
const DEFAULT_TTL =
|
|
7
|
+
const DEFAULT_TTL = 3_600_000;
|
|
8
8
|
const useParserCache = (pluginOptions = {}) => {
|
|
9
|
-
const documentCache = typeof pluginOptions.documentCache
|
|
10
|
-
?
|
|
11
|
-
:
|
|
12
|
-
const errorCache = typeof pluginOptions.errorCache
|
|
13
|
-
?
|
|
14
|
-
:
|
|
9
|
+
const documentCache = typeof pluginOptions.documentCache === 'undefined'
|
|
10
|
+
? new lru_cache_1.LRUCache({ max: DEFAULT_MAX, ttl: DEFAULT_TTL })
|
|
11
|
+
: pluginOptions.documentCache;
|
|
12
|
+
const errorCache = typeof pluginOptions.errorCache === 'undefined'
|
|
13
|
+
? new lru_cache_1.LRUCache({ max: DEFAULT_MAX, ttl: DEFAULT_TTL })
|
|
14
|
+
: pluginOptions.errorCache;
|
|
15
15
|
return {
|
|
16
16
|
onParse({ params, setParsedDocument }) {
|
|
17
17
|
const { source } = params;
|
package/esm/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Source } from 'graphql';
|
|
2
2
|
import { LRUCache } from 'lru-cache';
|
|
3
3
|
const DEFAULT_MAX = 1000;
|
|
4
|
-
const DEFAULT_TTL =
|
|
4
|
+
const DEFAULT_TTL = 3_600_000;
|
|
5
5
|
export const useParserCache = (pluginOptions = {}) => {
|
|
6
|
-
const documentCache = typeof pluginOptions.documentCache
|
|
7
|
-
?
|
|
8
|
-
:
|
|
9
|
-
const errorCache = typeof pluginOptions.errorCache
|
|
10
|
-
?
|
|
11
|
-
:
|
|
6
|
+
const documentCache = typeof pluginOptions.documentCache === 'undefined'
|
|
7
|
+
? new LRUCache({ max: DEFAULT_MAX, ttl: DEFAULT_TTL })
|
|
8
|
+
: pluginOptions.documentCache;
|
|
9
|
+
const errorCache = typeof pluginOptions.errorCache === 'undefined'
|
|
10
|
+
? new LRUCache({ max: DEFAULT_MAX, ttl: DEFAULT_TTL })
|
|
11
|
+
: pluginOptions.errorCache;
|
|
12
12
|
return {
|
|
13
13
|
onParse({ params, setParsedDocument }) {
|
|
14
14
|
const { source } = params;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/parser-cache",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.2.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0",
|
|
7
|
-
"@envelop/core": "^5.
|
|
6
|
+
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0",
|
|
7
|
+
"@envelop/core": "^5.6.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"lru-cache": "^11.0.0",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
},
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
|
-
"url": "https://github.com/graphql-hive/
|
|
16
|
-
"directory": "packages/plugins/parser-cache"
|
|
15
|
+
"url": "https://github.com/graphql-hive/graphql-yoga.git",
|
|
16
|
+
"directory": "packages/envelop/plugins/parser-cache"
|
|
17
17
|
},
|
|
18
18
|
"author": "Dotan Simha <dotansimha@gmail.com>",
|
|
19
19
|
"license": "MIT",
|
package/typings/index.d.cts
CHANGED
package/typings/index.d.ts
CHANGED