@envelop/core 2.2.0-alpha-8667975.0 → 2.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.
Files changed (3) hide show
  1. package/index.js +5 -2
  2. package/index.mjs +5 -2
  3. package/package.json +2 -2
package/index.js CHANGED
@@ -1225,12 +1225,15 @@ const useMaskedErrors = (opts) => {
1225
1225
  };
1226
1226
  };
1227
1227
 
1228
- const OnNonIntrospectionFieldReachedValidationRule = (onNonIntrospectionField) => () => {
1228
+ const OnNonIntrospectionFieldReachedValidationRule = (onNonIntrospectionField) => ctx => {
1229
+ const rootQueryType = ctx.getSchema().getQueryType();
1229
1230
  return {
1230
1231
  Field(field) {
1231
- if (!field.name.value.startsWith('__')) {
1232
+ if (ctx.getParentType() === rootQueryType && !field.name.value.startsWith('__')) {
1232
1233
  onNonIntrospectionField();
1234
+ return graphql.BREAK;
1233
1235
  }
1236
+ return undefined;
1234
1237
  },
1235
1238
  };
1236
1239
  };
package/index.mjs CHANGED
@@ -1221,12 +1221,15 @@ const useMaskedErrors = (opts) => {
1221
1221
  };
1222
1222
  };
1223
1223
 
1224
- const OnNonIntrospectionFieldReachedValidationRule = (onNonIntrospectionField) => () => {
1224
+ const OnNonIntrospectionFieldReachedValidationRule = (onNonIntrospectionField) => ctx => {
1225
+ const rootQueryType = ctx.getSchema().getQueryType();
1225
1226
  return {
1226
1227
  Field(field) {
1227
- if (!field.name.value.startsWith('__')) {
1228
+ if (ctx.getParentType() === rootQueryType && !field.name.value.startsWith('__')) {
1228
1229
  onNonIntrospectionField();
1230
+ return BREAK;
1229
1231
  }
1232
+ return undefined;
1230
1233
  },
1231
1234
  };
1232
1235
  };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@envelop/core",
3
- "version": "2.2.0-alpha-8667975.0",
3
+ "version": "2.2.0",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
7
7
  },
8
8
  "dependencies": {
9
- "@envelop/types": "2.1.0-alpha-8667975.0"
9
+ "@envelop/types": "2.1.0"
10
10
  },
11
11
  "repository": {
12
12
  "type": "git",