@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.
- package/cjs/optimizers/remove-description.js +1 -1
- package/cjs/optimizers/remove-empty-nodes.js +1 -1
- package/cjs/optimizers/remove-loc.js +1 -1
- package/esm/optimizers/remove-description.js +1 -1
- package/esm/optimizers/remove-empty-nodes.js +1 -1
- package/esm/optimizers/remove-loc.js +1 -1
- package/package.json +6 -4
- package/typings/index.d.cts +5 -0
- package/typings/optimize.d.cts +10 -0
- package/typings/optimize.d.ts +1 -1
- package/typings/optimizers/remove-description.d.cts +6 -0
- package/typings/optimizers/remove-empty-nodes.d.cts +6 -0
- package/typings/optimizers/remove-loc.d.cts +6 -0
- package/typings/types.d.cts +2 -0
- package/typings/types.d.ts +1 -1
|
@@ -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("
|
|
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("
|
|
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("
|
|
4
|
+
const graphql_1 = require("graphql");
|
|
5
5
|
/**
|
|
6
6
|
* This optimizer removes "loc" fields
|
|
7
7
|
* @param input
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/optimize",
|
|
3
|
-
"version": "1.3.1-alpha-
|
|
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.
|
|
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.
|
|
42
|
+
"types": "./typings/*.d.cts",
|
|
41
43
|
"default": "./cjs/*.js"
|
|
42
44
|
},
|
|
43
45
|
"import": {
|
|
@@ -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;
|
package/typings/optimize.d.ts
CHANGED
|
@@ -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;
|
package/typings/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DocumentNode } from '
|
|
1
|
+
import { DocumentNode } from 'graphql';
|
|
2
2
|
export declare type DocumentOptimizer = (input: DocumentNode) => DocumentNode;
|