@graphql-mesh/plugin-rate-limit 1.0.0-alpha-20230523160518-5443a1139 → 1.0.0-alpha-20230523160829-449dc3c14
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 +1 -2
- package/esm/index.js +1 -2
- package/package.json +8 -5
package/cjs/index.js
CHANGED
|
@@ -38,13 +38,12 @@ function useMeshRateLimit(options) {
|
|
|
38
38
|
const cacheKey = `rate-limit-${identifier}-${parentType.name}.${fieldDef.name}`;
|
|
39
39
|
const remainingTokens$ = options.cache.get(cacheKey);
|
|
40
40
|
jobs.push(remainingTokens$.then((remainingTokens) => {
|
|
41
|
-
var _a;
|
|
42
41
|
if (remainingTokens == null) {
|
|
43
42
|
remainingTokens = config.max;
|
|
44
43
|
}
|
|
45
44
|
if (remainingTokens === 0) {
|
|
46
45
|
errors.push((0, utils_1.createGraphQLError)(`Rate limit of "${parentType.name}.${fieldDef.name}" exceeded for "${identifier}"`, {
|
|
47
|
-
path: [
|
|
46
|
+
path: [fieldNode.alias?.value || fieldDef.name],
|
|
48
47
|
extensions: {
|
|
49
48
|
http: {
|
|
50
49
|
status: 429,
|
package/esm/index.js
CHANGED
|
@@ -35,13 +35,12 @@ export default function useMeshRateLimit(options) {
|
|
|
35
35
|
const cacheKey = `rate-limit-${identifier}-${parentType.name}.${fieldDef.name}`;
|
|
36
36
|
const remainingTokens$ = options.cache.get(cacheKey);
|
|
37
37
|
jobs.push(remainingTokens$.then((remainingTokens) => {
|
|
38
|
-
var _a;
|
|
39
38
|
if (remainingTokens == null) {
|
|
40
39
|
remainingTokens = config.max;
|
|
41
40
|
}
|
|
42
41
|
if (remainingTokens === 0) {
|
|
43
42
|
errors.push(createGraphQLError(`Rate limit of "${parentType.name}.${fieldDef.name}" exceeded for "${identifier}"`, {
|
|
44
|
-
path: [
|
|
43
|
+
path: [fieldNode.alias?.value || fieldDef.name],
|
|
45
44
|
extensions: {
|
|
46
45
|
http: {
|
|
47
46
|
status: 429,
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-mesh/plugin-rate-limit",
|
|
3
|
-
"version": "1.0.0-alpha-
|
|
3
|
+
"version": "1.0.0-alpha-20230523160829-449dc3c14",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@graphql-mesh/cross-helpers": "0.4.0-alpha-
|
|
7
|
-
"@graphql-mesh/types": "1.0.0-alpha-
|
|
8
|
-
"@graphql-tools/utils": "^9.2.1",
|
|
6
|
+
"@graphql-mesh/cross-helpers": "0.4.0-alpha-20230523160829-449dc3c14",
|
|
7
|
+
"@graphql-mesh/types": "1.0.0-alpha-20230523160829-449dc3c14",
|
|
8
|
+
"@graphql-tools/utils": "^9.2.1 || ^10.0.0",
|
|
9
9
|
"graphql": "*",
|
|
10
10
|
"tslib": "^2.4.0"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@graphql-mesh/string-interpolation": "0.5.0-alpha-
|
|
13
|
+
"@graphql-mesh/string-interpolation": "0.5.0-alpha-20230523160829-449dc3c14",
|
|
14
14
|
"minimatch": "8.0.4"
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
"directory": "packages/plugins/response-cache"
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT",
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=16.0.0"
|
|
24
|
+
},
|
|
22
25
|
"main": "cjs/index.js",
|
|
23
26
|
"module": "esm/index.js",
|
|
24
27
|
"typings": "typings/index.d.ts",
|