@graphql-tools/module-loader 7.2.2-alpha-e7752ba5.0 → 7.2.2-alpha-420b7771.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/cjs/index.js CHANGED
@@ -24,7 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.ModuleLoader = void 0;
27
- const graphql_1 = require("@graphql-tools/graphql");
27
+ const graphql_1 = require("graphql");
28
28
  const fs_1 = require("fs");
29
29
  const { access } = fs_1.promises;
30
30
  const InvalidError = new Error(`Imported object was not a string, DocumentNode or GraphQLSchema`);
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { isSchema } from '@graphql-tools/graphql';
1
+ import { isSchema } from 'graphql';
2
2
  import { existsSync, promises as fsPromises } from 'fs';
3
3
  const { access } = fsPromises;
4
4
  const InvalidError = new Error(`Imported object was not a string, DocumentNode or GraphQLSchema`);
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "@graphql-tools/module-loader",
3
- "version": "7.2.2-alpha-e7752ba5.0",
3
+ "version": "7.2.2-alpha-420b7771.0",
4
4
  "description": "A set of utils for faster development of GraphQL tools",
5
5
  "sideEffects": false,
6
+ "peerDependencies": {
7
+ "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
8
+ },
6
9
  "dependencies": {
7
- "@graphql-tools/utils": "8.9.1-alpha-e7752ba5.0",
8
- "@graphql-tools/graphql": "0.1.0-alpha-e7752ba5.0",
10
+ "@graphql-tools/utils": "8.9.1-alpha-420b7771.0",
9
11
  "tslib": "^2.4.0"
10
12
  },
11
13
  "repository": {
@@ -25,7 +27,7 @@
25
27
  "exports": {
26
28
  ".": {
27
29
  "require": {
28
- "types": "./typings/index.d.ts",
30
+ "types": "./typings/index.d.cts",
29
31
  "default": "./cjs/index.js"
30
32
  },
31
33
  "import": {
@@ -39,7 +41,7 @@
39
41
  },
40
42
  "./*": {
41
43
  "require": {
42
- "types": "./typings/*.d.ts",
44
+ "types": "./typings/*.d.cts",
43
45
  "default": "./cjs/*.js"
44
46
  },
45
47
  "import": {
@@ -0,0 +1,21 @@
1
+ import { Loader, Source } from '@graphql-tools/utils';
2
+ /**
3
+ * * This loader loads documents and type definitions from a Node module
4
+ *
5
+ * ```js
6
+ * const schema = await loadSchema('module:someModuleName#someNamedExport', {
7
+ * loaders: [new ModuleLoader()],
8
+ * })
9
+ * ```
10
+ */
11
+ export declare class ModuleLoader implements Loader {
12
+ private isExpressionValid;
13
+ canLoad(pointer: string): Promise<boolean>;
14
+ canLoadSync(pointer: string): boolean;
15
+ load(pointer: string): Promise<Source[]>;
16
+ loadSync(pointer: string): Source[];
17
+ private parse;
18
+ private extractFromModule;
19
+ private importModule;
20
+ private importModuleSync;
21
+ }