@envelop/operation-field-permissions 1.0.8 → 1.0.10

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 +3 -0
  2. package/index.mjs +4 -1
  3. package/package.json +2 -2
package/index.js CHANGED
@@ -34,6 +34,9 @@ const getContext = (input) => {
34
34
  * Validate whether a user is allowed to execute a certain GraphQL operation.
35
35
  */
36
36
  const OperationScopeRule = (options) => (context, executionArgs) => {
37
+ if (core.isIntrospectionDocument(executionArgs.document)) {
38
+ return {};
39
+ }
37
40
  const permissionContext = getContext(executionArgs.contextValue);
38
41
  const handleField = (node, objectType) => {
39
42
  const schemaCoordinate = `${objectType.name}.${node.name.value}`;
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { useExtendContext } from '@envelop/core';
1
+ import { isIntrospectionDocument, useExtendContext } from '@envelop/core';
2
2
  import { useExtendedValidation } from '@envelop/extended-validation';
3
3
  import { isObjectType, isUnionType, isInterfaceType, GraphQLList, GraphQLNonNull, GraphQLError } from 'graphql';
4
4
 
@@ -30,6 +30,9 @@ const getContext = (input) => {
30
30
  * Validate whether a user is allowed to execute a certain GraphQL operation.
31
31
  */
32
32
  const OperationScopeRule = (options) => (context, executionArgs) => {
33
+ if (isIntrospectionDocument(executionArgs.document)) {
34
+ return {};
35
+ }
33
36
  const permissionContext = getContext(executionArgs.contextValue);
34
37
  const handleField = (node, objectType) => {
35
38
  const schemaCoordinate = `${objectType.name}.${node.name.value}`;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@envelop/operation-field-permissions",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "graphql": "^14.0.0 || ^15.0.0"
7
7
  },
8
8
  "dependencies": {
9
- "@envelop/core": "1.2.0",
9
+ "@envelop/core": "1.4.0",
10
10
  "@envelop/extended-validation": "1.1.1"
11
11
  },
12
12
  "repository": {