@constructive-io/graphql-server 5.25.0 → 5.25.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.
|
@@ -16,6 +16,13 @@
|
|
|
16
16
|
* The walk is manual rather than `visitWithTypeInfo` because fragment spreads
|
|
17
17
|
* have to be followed (a document can hide its depth entirely inside
|
|
18
18
|
* fragments) and the visitor does not follow them.
|
|
19
|
+
*
|
|
20
|
+
* Schema introspection (`__schema` / `__type`) is governed only by
|
|
21
|
+
* `enableIntrospection`. Its selections are not walked: the introspection types
|
|
22
|
+
* carry no connections, so there is nothing to cost, and the standard
|
|
23
|
+
* introspection document nests a fixed `ofType` chain deeper than a sensible
|
|
24
|
+
* tenant depth budget, so charging depth would make the budget decide whether
|
|
25
|
+
* clients can introspect at all — a decision the dedicated switch already owns.
|
|
19
26
|
*/
|
|
20
27
|
import { errors } from '@constructive-io/errors';
|
|
21
28
|
import { ASSUMED_PAGE_SIZE } from '@constructive-io/express-context';
|
|
@@ -84,6 +91,7 @@ function walkSelectionSet(walk, selectionSet, parentType, depth, multiplier) {
|
|
|
84
91
|
if (!walk.protection.enableIntrospection) {
|
|
85
92
|
reject(errors.INTROSPECTION_DISABLED());
|
|
86
93
|
}
|
|
94
|
+
continue;
|
|
87
95
|
}
|
|
88
96
|
const field = parentType && isObjectType(parentType)
|
|
89
97
|
? parentType.getFields()[selection.name.value]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructive-io/graphql-server",
|
|
3
|
-
"version": "5.25.
|
|
3
|
+
"version": "5.25.1",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "Constructive GraphQL Server",
|
|
6
6
|
"main": "index.js",
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"supertest": "^7.2.2",
|
|
97
97
|
"ts-node": "^10.9.2"
|
|
98
98
|
},
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "164f6e481961196e681eb3dee9e5f9ebcb8fb834"
|
|
100
100
|
}
|
|
@@ -16,6 +16,13 @@
|
|
|
16
16
|
* The walk is manual rather than `visitWithTypeInfo` because fragment spreads
|
|
17
17
|
* have to be followed (a document can hide its depth entirely inside
|
|
18
18
|
* fragments) and the visitor does not follow them.
|
|
19
|
+
*
|
|
20
|
+
* Schema introspection (`__schema` / `__type`) is governed only by
|
|
21
|
+
* `enableIntrospection`. Its selections are not walked: the introspection types
|
|
22
|
+
* carry no connections, so there is nothing to cost, and the standard
|
|
23
|
+
* introspection document nests a fixed `ofType` chain deeper than a sensible
|
|
24
|
+
* tenant depth budget, so charging depth would make the budget decide whether
|
|
25
|
+
* clients can introspect at all — a decision the dedicated switch already owns.
|
|
19
26
|
*/
|
|
20
27
|
import { type RequestProtection } from '@constructive-io/express-context';
|
|
21
28
|
import type { DocumentNode, GraphQLSchema } from 'graphql';
|
|
@@ -17,6 +17,13 @@
|
|
|
17
17
|
* The walk is manual rather than `visitWithTypeInfo` because fragment spreads
|
|
18
18
|
* have to be followed (a document can hide its depth entirely inside
|
|
19
19
|
* fragments) and the visitor does not follow them.
|
|
20
|
+
*
|
|
21
|
+
* Schema introspection (`__schema` / `__type`) is governed only by
|
|
22
|
+
* `enableIntrospection`. Its selections are not walked: the introspection types
|
|
23
|
+
* carry no connections, so there is nothing to cost, and the standard
|
|
24
|
+
* introspection document nests a fixed `ofType` chain deeper than a sensible
|
|
25
|
+
* tenant depth budget, so charging depth would make the budget decide whether
|
|
26
|
+
* clients can introspect at all — a decision the dedicated switch already owns.
|
|
20
27
|
*/
|
|
21
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
29
|
exports.enforceDocumentProtection = enforceDocumentProtection;
|
|
@@ -87,6 +94,7 @@ function walkSelectionSet(walk, selectionSet, parentType, depth, multiplier) {
|
|
|
87
94
|
if (!walk.protection.enableIntrospection) {
|
|
88
95
|
reject(errors_1.errors.INTROSPECTION_DISABLED());
|
|
89
96
|
}
|
|
97
|
+
continue;
|
|
90
98
|
}
|
|
91
99
|
const field = parentType && (0, graphql_1.isObjectType)(parentType)
|
|
92
100
|
? parentType.getFields()[selection.name.value]
|