@envelop/disable-introspection 4.0.0-alpha-36a1267.0 → 4.0.0-alpha-5b6bfa8.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/README.md CHANGED
@@ -11,12 +11,12 @@ yarn add @envelop/disable-introspection
11
11
  ## Usage Example
12
12
 
13
13
  ```ts
14
- import { envelop } from '@envelop/core';
15
- import { useDisableIntrospection } from '@envelop/disable-introspection';
14
+ import { envelop } from '@envelop/core'
15
+ import { useDisableIntrospection } from '@envelop/disable-introspection'
16
16
 
17
17
  const getEnveloped = envelop({
18
- plugins: [useDisableIntrospection()],
19
- });
18
+ plugins: [useDisableIntrospection()]
19
+ })
20
20
  ```
21
21
 
22
22
  ## Optional configuration
@@ -1,22 +1,19 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const graphql = require('graphql');
6
-
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useDisableIntrospection = void 0;
4
+ const graphql_1 = require("@graphql-tools/graphql");
7
5
  const useDisableIntrospection = (options) => {
8
6
  const disableIf = options === null || options === void 0 ? void 0 : options.disableIf;
9
7
  return {
10
8
  onValidate: disableIf
11
9
  ? ({ addValidationRule, context, params }) => {
12
10
  if (disableIf({ context, params })) {
13
- addValidationRule(graphql.NoSchemaIntrospectionCustomRule);
11
+ addValidationRule(graphql_1.NoSchemaIntrospectionCustomRule);
14
12
  }
15
13
  }
16
14
  : ({ addValidationRule }) => {
17
- addValidationRule(graphql.NoSchemaIntrospectionCustomRule);
15
+ addValidationRule(graphql_1.NoSchemaIntrospectionCustomRule);
18
16
  },
19
17
  };
20
18
  };
21
-
22
19
  exports.useDisableIntrospection = useDisableIntrospection;
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -1,6 +1,5 @@
1
- import { NoSchemaIntrospectionCustomRule } from 'graphql';
2
-
3
- const useDisableIntrospection = (options) => {
1
+ import { NoSchemaIntrospectionCustomRule } from '@graphql-tools/graphql';
2
+ export const useDisableIntrospection = (options) => {
4
3
  const disableIf = options === null || options === void 0 ? void 0 : options.disableIf;
5
4
  return {
6
5
  onValidate: disableIf
@@ -14,5 +13,3 @@ const useDisableIntrospection = (options) => {
14
13
  },
15
14
  };
16
15
  };
17
-
18
- export { useDisableIntrospection };
package/package.json CHANGED
@@ -1,33 +1,55 @@
1
1
  {
2
2
  "name": "@envelop/disable-introspection",
3
- "version": "4.0.0-alpha-36a1267.0",
3
+ "version": "4.0.0-alpha-5b6bfa8.0",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
- "@envelop/core": "2.1.0-alpha-36a1267.0",
7
- "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
6
+ "@envelop/core": "3.0.0-alpha-5b6bfa8.0",
7
+ "@graphql-tools/graphql": "0.1.0-alpha-33fb2950.0"
8
8
  },
9
+ "dependencies": {},
9
10
  "repository": {
10
11
  "type": "git",
11
- "url": "https://github.com/dotansimha/envelop.git",
12
+ "url": "https://github.com/n1ru4l/envelop.git",
12
13
  "directory": "packages/plugins/disable-introspection"
13
14
  },
14
15
  "author": "Dotan Simha <dotansimha@gmail.com>",
15
16
  "license": "MIT",
16
- "main": "index.js",
17
- "module": "index.mjs",
18
- "typings": "index.d.ts",
17
+ "main": "cjs/index.js",
18
+ "module": "esm/index.js",
19
+ "typings": "typings/index.d.ts",
19
20
  "typescript": {
20
- "definition": "index.d.ts"
21
+ "definition": "typings/index.d.ts"
21
22
  },
23
+ "type": "module",
22
24
  "exports": {
23
25
  ".": {
24
- "require": "./index.js",
25
- "import": "./index.mjs"
26
+ "require": {
27
+ "types": "./typings/index.d.ts",
28
+ "default": "./cjs/index.js"
29
+ },
30
+ "import": {
31
+ "types": "./typings/index.d.ts",
32
+ "default": "./esm/index.js"
33
+ },
34
+ "default": {
35
+ "types": "./typings/index.d.ts",
36
+ "default": "./esm/index.js"
37
+ }
26
38
  },
27
39
  "./*": {
28
- "require": "./*.js",
29
- "import": "./*.mjs"
40
+ "require": {
41
+ "types": "./typings/*.d.ts",
42
+ "default": "./cjs/*.js"
43
+ },
44
+ "import": {
45
+ "types": "./typings/*.d.ts",
46
+ "default": "./esm/*.js"
47
+ },
48
+ "default": {
49
+ "types": "./typings/*.d.ts",
50
+ "default": "./esm/*.js"
51
+ }
30
52
  },
31
53
  "./package.json": "./package.json"
32
54
  }
33
- }
55
+ }
@@ -5,4 +5,4 @@ export interface DisableIntrospectionOptions {
5
5
  params: Parameters<NonNullable<Plugin['onValidate']>>[0]['params'];
6
6
  }) => boolean;
7
7
  }
8
- export declare const useDisableIntrospection: (options?: DisableIntrospectionOptions | undefined) => Plugin;
8
+ export declare const useDisableIntrospection: (options?: DisableIntrospectionOptions) => Plugin;