@graphql-tools/optimize 1.3.1-alpha-e7752ba5.0 → 1.3.1-alpha-b9e4a92b.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.
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.removeDescriptions = void 0;
4
- const graphql_1 = require("@graphql-tools/graphql");
4
+ const graphql_1 = require("graphql");
5
5
  /**
6
6
  * This optimizer removes "description" field from schema AST definitions.
7
7
  * @param input
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.removeEmptyNodes = void 0;
4
- const graphql_1 = require("@graphql-tools/graphql");
4
+ const graphql_1 = require("graphql");
5
5
  /**
6
6
  * This optimizer removes empty nodes/arrays (directives/argument/variableDefinitions) from a given DocumentNode of operation/fragment.
7
7
  * @param input
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.removeLoc = void 0;
4
- const graphql_1 = require("@graphql-tools/graphql");
4
+ const graphql_1 = require("graphql");
5
5
  /**
6
6
  * This optimizer removes "loc" fields
7
7
  * @param input
@@ -1,4 +1,4 @@
1
- import { visit } from '@graphql-tools/graphql';
1
+ import { visit } from 'graphql';
2
2
  /**
3
3
  * This optimizer removes "description" field from schema AST definitions.
4
4
  * @param input
@@ -1,4 +1,4 @@
1
- import { visit } from '@graphql-tools/graphql';
1
+ import { visit } from 'graphql';
2
2
  /**
3
3
  * This optimizer removes empty nodes/arrays (directives/argument/variableDefinitions) from a given DocumentNode of operation/fragment.
4
4
  * @param input
@@ -1,4 +1,4 @@
1
- import { visit } from '@graphql-tools/graphql';
1
+ import { visit } from 'graphql';
2
2
  /**
3
3
  * This optimizer removes "loc" fields
4
4
  * @param input
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "@graphql-tools/optimize",
3
- "version": "1.3.1-alpha-e7752ba5.0",
3
+ "version": "1.3.1-alpha-b9e4a92b.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/graphql": "0.1.0-alpha-e7752ba5.0",
8
10
  "tslib": "^2.4.0"
9
11
  },
10
12
  "repository": {
@@ -23,7 +25,7 @@
23
25
  "exports": {
24
26
  ".": {
25
27
  "require": {
26
- "types": "./typings/index.d.ts",
28
+ "types": "./typings/index.d.cts",
27
29
  "default": "./cjs/index.js"
28
30
  },
29
31
  "import": {
@@ -37,7 +39,7 @@
37
39
  },
38
40
  "./*": {
39
41
  "require": {
40
- "types": "./typings/*.d.ts",
42
+ "types": "./typings/*.d.cts",
41
43
  "default": "./cjs/*.js"
42
44
  },
43
45
  "import": {
@@ -0,0 +1,5 @@
1
+ export * from './optimize.cjs';
2
+ export * from './types.cjs';
3
+ export * from './optimizers/remove-description.cjs';
4
+ export * from './optimizers/remove-empty-nodes.cjs';
5
+ export * from './optimizers/remove-loc.cjs';
@@ -0,0 +1,10 @@
1
+ import { DocumentNode } from 'graphql';
2
+ import { DocumentOptimizer } from './types.cjs';
3
+ /**
4
+ * This method accept a DocumentNode and applies the optimizations you wish to use.
5
+ * You can override the default ones or provide you own optimizers if you wish.
6
+ *
7
+ * @param node document to optimize
8
+ * @param optimizers optional, list of optimizer to use
9
+ */
10
+ export declare function optimizeDocumentNode(node: DocumentNode, optimizers?: DocumentOptimizer[]): DocumentNode;
@@ -1,4 +1,4 @@
1
- import { DocumentNode } from '@graphql-tools/graphql';
1
+ import { DocumentNode } from 'graphql';
2
2
  import { DocumentOptimizer } from './types.js';
3
3
  /**
4
4
  * This method accept a DocumentNode and applies the optimizations you wish to use.
@@ -0,0 +1,6 @@
1
+ import { DocumentOptimizer } from '../types.cjs';
2
+ /**
3
+ * This optimizer removes "description" field from schema AST definitions.
4
+ * @param input
5
+ */
6
+ export declare const removeDescriptions: DocumentOptimizer;
@@ -0,0 +1,6 @@
1
+ import { DocumentOptimizer } from '../types.cjs';
2
+ /**
3
+ * This optimizer removes empty nodes/arrays (directives/argument/variableDefinitions) from a given DocumentNode of operation/fragment.
4
+ * @param input
5
+ */
6
+ export declare const removeEmptyNodes: DocumentOptimizer;
@@ -0,0 +1,6 @@
1
+ import { DocumentOptimizer } from '../types.cjs';
2
+ /**
3
+ * This optimizer removes "loc" fields
4
+ * @param input
5
+ */
6
+ export declare const removeLoc: DocumentOptimizer;
@@ -0,0 +1,2 @@
1
+ import { DocumentNode } from 'graphql';
2
+ export declare type DocumentOptimizer = (input: DocumentNode) => DocumentNode;
@@ -1,2 +1,2 @@
1
- import { DocumentNode } from '@graphql-tools/graphql';
1
+ import { DocumentNode } from 'graphql';
2
2
  export declare type DocumentOptimizer = (input: DocumentNode) => DocumentNode;