@graphql-tools/relay-operation-optimizer 6.5.2-alpha-e7752ba5.0 → 6.5.2-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/index.js CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.optimizeDocuments = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const utils_1 = require("@graphql-tools/utils");
6
- const graphql_1 = require("@graphql-tools/graphql");
6
+ const graphql_1 = require("graphql");
7
7
  const SkipRedundantNodesTransform_js_1 = require("@ardatan/relay-compiler/lib/transforms/SkipRedundantNodesTransform.js");
8
8
  const InlineFragmentsTransform_js_1 = require("@ardatan/relay-compiler/lib/transforms/InlineFragmentsTransform.js");
9
9
  const ApplyFragmentArgumentTransform_js_1 = require("@ardatan/relay-compiler/lib/transforms/ApplyFragmentArgumentTransform.js");
@@ -22,7 +22,6 @@ function optimizeDocuments(schema, documents, options = {}) {
22
22
  // transformASTSchema creates a new schema instance instead of mutating the old one
23
23
  const adjustedSchema = (0, Schema_js_1.create)((0, utils_1.printSchemaWithDirectives)(schema, options));
24
24
  const documentAsts = (0, graphql_1.concatAST)(documents);
25
- // @ts-expect-error Uses graphql-js so it doesn't like us
26
25
  const relayDocuments = (0, RelayParser_js_1.transform)(adjustedSchema, documentAsts.definitions);
27
26
  const result = [];
28
27
  if (options.includeFragments) {
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { printSchemaWithDirectives } from '@graphql-tools/utils';
2
- import { parse, concatAST } from '@graphql-tools/graphql';
2
+ import { parse, concatAST } from 'graphql';
3
3
  import { transform as skipRedundantNodesTransform } from '@ardatan/relay-compiler/lib/transforms/SkipRedundantNodesTransform.js';
4
4
  import { transform as inlineFragmentsTransform } from '@ardatan/relay-compiler/lib/transforms/InlineFragmentsTransform.js';
5
5
  import { transform as applyFragmentArgumentTransform } from '@ardatan/relay-compiler/lib/transforms/ApplyFragmentArgumentTransform.js';
@@ -18,7 +18,6 @@ export function optimizeDocuments(schema, documents, options = {}) {
18
18
  // transformASTSchema creates a new schema instance instead of mutating the old one
19
19
  const adjustedSchema = relayCreate(printSchemaWithDirectives(schema, options));
20
20
  const documentAsts = concatAST(documents);
21
- // @ts-expect-error Uses graphql-js so it doesn't like us
22
21
  const relayDocuments = relayTransform(adjustedSchema, documentAsts.definitions);
23
22
  const result = [];
24
23
  if (options.includeFragments) {
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "@graphql-tools/relay-operation-optimizer",
3
- "version": "6.5.2-alpha-e7752ba5.0",
3
+ "version": "6.5.2-alpha-b9e4a92b.0",
4
4
  "description": "Package for optimizing your GraphQL operations relay style.",
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-b9e4a92b.0",
9
11
  "@ardatan/relay-compiler": "12.0.0",
10
12
  "tslib": "^2.4.0"
11
13
  },
@@ -37,7 +39,7 @@
37
39
  "exports": {
38
40
  ".": {
39
41
  "require": {
40
- "types": "./typings/index.d.ts",
42
+ "types": "./typings/index.d.cts",
41
43
  "default": "./cjs/index.js"
42
44
  },
43
45
  "import": {
@@ -51,7 +53,7 @@
51
53
  },
52
54
  "./*": {
53
55
  "require": {
54
- "types": "./typings/*.d.ts",
56
+ "types": "./typings/*.d.cts",
55
57
  "default": "./cjs/*.js"
56
58
  },
57
59
  "import": {
@@ -0,0 +1,6 @@
1
+ import { SchemaPrintOptions } from '@graphql-tools/utils';
2
+ import { GraphQLSchema, DocumentNode, ParseOptions } from 'graphql';
3
+ export declare type OptimizeDocumentsOptions = SchemaPrintOptions & ParseOptions & {
4
+ includeFragments?: boolean;
5
+ };
6
+ export declare function optimizeDocuments(schema: GraphQLSchema, documents: DocumentNode[], options?: OptimizeDocumentsOptions): DocumentNode[];
@@ -1,5 +1,5 @@
1
1
  import { SchemaPrintOptions } from '@graphql-tools/utils';
2
- import { GraphQLSchema, DocumentNode, ParseOptions } from '@graphql-tools/graphql';
2
+ import { GraphQLSchema, DocumentNode, ParseOptions } from 'graphql';
3
3
  export declare type OptimizeDocumentsOptions = SchemaPrintOptions & ParseOptions & {
4
4
  includeFragments?: boolean;
5
5
  };