@graphql-mesh/graphql 0.30.0-alpha-d63361380.0 → 1.0.0-alpha-c34a7d66e.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.
Files changed (3) hide show
  1. package/index.js +3 -34
  2. package/index.mjs +3 -34
  3. package/package.json +4 -4
package/index.js CHANGED
@@ -7,6 +7,7 @@ const graphql = require('graphql');
7
7
  const wrap = require('@graphql-tools/wrap');
8
8
  const utils = require('@graphql-mesh/utils');
9
9
  const utils$1 = require('@graphql-tools/utils');
10
+ const store = require('@graphql-mesh/store');
10
11
  const lodashGet = _interopDefault(require('lodash.get'));
11
12
  const stringInterpolation = require('@graphql-mesh/string-interpolation');
12
13
  const crossHelpers = require('@graphql-mesh/cross-helpers');
@@ -19,46 +20,14 @@ const getResolverData = utils$1.memoize1(function getResolverData(params) {
19
20
  env: crossHelpers.process.env,
20
21
  };
21
22
  });
22
- const GraphQLSchemaWithDiffing = {
23
- codify: schema => `
24
- import { buildASTSchema } from 'graphql';
25
-
26
- const schemaAST = ${JSON.stringify(utils$1.getDocumentNodeFromSchema(schema), null, 2)};
27
-
28
- export default buildASTSchema(schemaAST, {
29
- assumeValid: true,
30
- assumeValidSDL: true
31
- });
32
- `.trim(),
33
- fromJSON: schemaAST => graphql.buildASTSchema(schemaAST, { assumeValid: true, assumeValidSDL: true }),
34
- toJSON: schema => utils$1.getDocumentNodeFromSchema(schema),
35
- validate: () => { },
36
- /*
37
- validate: async (oldSchema, newSchema) => {
38
- const changes = await diff(oldSchema, newSchema);
39
- const errors: string[] = [];
40
- for (const change of changes) {
41
- if (
42
- change.criticality.level === CriticalityLevel.Breaking ||
43
- change.criticality.level === CriticalityLevel.Dangerous
44
- ) {
45
- errors.push(change.message);
46
- }
47
- }
48
- if (errors.length) {
49
- throw new AggregateError(errors);
50
- }
51
- },
52
- */
53
- };
54
23
  class GraphQLHandler {
55
- constructor({ config, baseDir, fetchFn, store, importFn, logger, }) {
24
+ constructor({ config, baseDir, fetchFn, store: store$1, importFn, logger, }) {
56
25
  this.urlLoader = new urlLoader.UrlLoader();
57
26
  this.interpolationStringSet = new Set();
58
27
  this.config = config;
59
28
  this.baseDir = baseDir;
60
29
  this.fetchFn = fetchFn;
61
- this.nonExecutableSchema = store.proxy('introspectionSchema', GraphQLSchemaWithDiffing);
30
+ this.nonExecutableSchema = store$1.proxy('introspectionSchema', store.PredefinedProxyOptions.GraphQLSchemaWithDiffing);
62
31
  this.importFn = importFn;
63
32
  this.logger = logger;
64
33
  }
package/index.mjs CHANGED
@@ -2,7 +2,8 @@ import { UrlLoader } from '@graphql-tools/url-loader';
2
2
  import { buildSchema, buildASTSchema, buildClientSchema, GraphQLSchema, Kind } from 'graphql';
3
3
  import { introspectSchema } from '@graphql-tools/wrap';
4
4
  import { readFileOrUrl, loadFromModuleExportExpression } from '@graphql-mesh/utils';
5
- import { isDocumentNode, parseSelectionSet, memoize1, getDocumentNodeFromSchema, getOperationASTFromRequest, isAsyncIterable } from '@graphql-tools/utils';
5
+ import { isDocumentNode, parseSelectionSet, memoize1, getOperationASTFromRequest, isAsyncIterable } from '@graphql-tools/utils';
6
+ import { PredefinedProxyOptions } from '@graphql-mesh/store';
6
7
  import lodashGet from 'lodash.get';
7
8
  import { parseInterpolationStrings, getInterpolatedStringFactory, getInterpolatedHeadersFactory } from '@graphql-mesh/string-interpolation';
8
9
  import { process, util } from '@graphql-mesh/cross-helpers';
@@ -15,38 +16,6 @@ const getResolverData = memoize1(function getResolverData(params) {
15
16
  env: process.env,
16
17
  };
17
18
  });
18
- const GraphQLSchemaWithDiffing = {
19
- codify: schema => `
20
- import { buildASTSchema } from 'graphql';
21
-
22
- const schemaAST = ${JSON.stringify(getDocumentNodeFromSchema(schema), null, 2)};
23
-
24
- export default buildASTSchema(schemaAST, {
25
- assumeValid: true,
26
- assumeValidSDL: true
27
- });
28
- `.trim(),
29
- fromJSON: schemaAST => buildASTSchema(schemaAST, { assumeValid: true, assumeValidSDL: true }),
30
- toJSON: schema => getDocumentNodeFromSchema(schema),
31
- validate: () => { },
32
- /*
33
- validate: async (oldSchema, newSchema) => {
34
- const changes = await diff(oldSchema, newSchema);
35
- const errors: string[] = [];
36
- for (const change of changes) {
37
- if (
38
- change.criticality.level === CriticalityLevel.Breaking ||
39
- change.criticality.level === CriticalityLevel.Dangerous
40
- ) {
41
- errors.push(change.message);
42
- }
43
- }
44
- if (errors.length) {
45
- throw new AggregateError(errors);
46
- }
47
- },
48
- */
49
- };
50
19
  class GraphQLHandler {
51
20
  constructor({ config, baseDir, fetchFn, store, importFn, logger, }) {
52
21
  this.urlLoader = new UrlLoader();
@@ -54,7 +23,7 @@ class GraphQLHandler {
54
23
  this.config = config;
55
24
  this.baseDir = baseDir;
56
25
  this.fetchFn = fetchFn;
57
- this.nonExecutableSchema = store.proxy('introspectionSchema', GraphQLSchemaWithDiffing);
26
+ this.nonExecutableSchema = store.proxy('introspectionSchema', PredefinedProxyOptions.GraphQLSchemaWithDiffing);
58
27
  this.importFn = importFn;
59
28
  this.logger = logger;
60
29
  }
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@graphql-mesh/graphql",
3
- "version": "0.30.0-alpha-d63361380.0",
3
+ "version": "1.0.0-alpha-c34a7d66e.0",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
+ "@graphql-mesh/types": "0.79.0-alpha-c34a7d66e.0",
6
7
  "graphql": "*"
7
8
  },
8
9
  "dependencies": {
9
10
  "@graphql-mesh/cross-helpers": "0.2.0",
10
- "@graphql-mesh/store": "0.9.0-alpha-d63361380.0",
11
+ "@graphql-mesh/store": "1.0.0-alpha-c34a7d66e.0",
11
12
  "@graphql-mesh/string-interpolation": "0.3.0",
12
- "@graphql-mesh/types": "0.79.0-alpha-d63361380.0",
13
- "@graphql-mesh/utils": "0.37.5-alpha-d63361380.0",
13
+ "@graphql-mesh/utils": "1.0.0-alpha-c34a7d66e.0",
14
14
  "@graphql-tools/delegate": "8.8.0",
15
15
  "@graphql-tools/url-loader": "7.13.0",
16
16
  "@graphql-tools/utils": "8.8.0",