@graphql-mesh/graphql 0.33.11-alpha-20230207124039-e1ab926b9 → 0.34.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
@@ -32,9 +32,11 @@ class GraphQLHandler {
32
32
  getArgsAndContextVariables() {
33
33
  return (0, string_interpolation_1.parseInterpolationStrings)(this.interpolationStringSet);
34
34
  }
35
- wrapExecutorToPassSourceName(executor) {
35
+ wrapExecutorToPassSourceNameAndDebug(executor) {
36
36
  const sourceName = this.name;
37
+ const logger = this.logger;
37
38
  return function executorWithSourceName(executionRequest) {
39
+ logger.debug(() => `Sending GraphQL Request: `, (0, graphql_1.print)(executionRequest.document));
38
40
  executionRequest.info = executionRequest.info || {};
39
41
  executionRequest.info.sourceName = sourceName;
40
42
  return executor(executionRequest);
@@ -277,7 +279,7 @@ class GraphQLHandler {
277
279
  const { contextVariables } = this.getArgsAndContextVariables();
278
280
  return {
279
281
  schema,
280
- executor: this.wrapExecutorToPassSourceName(highestValueExecutor),
282
+ executor: this.wrapExecutorToPassSourceNameAndDebug(highestValueExecutor),
281
283
  // Batching doesn't make sense with fallback strategy
282
284
  batch: false,
283
285
  contextVariables,
@@ -327,7 +329,7 @@ class GraphQLHandler {
327
329
  const { contextVariables } = this.getArgsAndContextVariables();
328
330
  return {
329
331
  schema: schemaResult.value,
330
- executor: this.wrapExecutorToPassSourceName(executorResult.value),
332
+ executor: this.wrapExecutorToPassSourceNameAndDebug(executorResult.value),
331
333
  batch: this.config.batch != null ? this.config.batch : true,
332
334
  contextVariables,
333
335
  };
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { buildASTSchema, buildClientSchema, buildSchema, GraphQLSchema, Kind, } from 'graphql';
1
+ import { buildASTSchema, buildClientSchema, buildSchema, GraphQLSchema, Kind, print, } from 'graphql';
2
2
  import lodashGet from 'lodash.get';
3
3
  import { process, util } from '@graphql-mesh/cross-helpers';
4
4
  import { PredefinedProxyOptions } from '@graphql-mesh/store';
@@ -29,9 +29,11 @@ export default class GraphQLHandler {
29
29
  getArgsAndContextVariables() {
30
30
  return parseInterpolationStrings(this.interpolationStringSet);
31
31
  }
32
- wrapExecutorToPassSourceName(executor) {
32
+ wrapExecutorToPassSourceNameAndDebug(executor) {
33
33
  const sourceName = this.name;
34
+ const logger = this.logger;
34
35
  return function executorWithSourceName(executionRequest) {
36
+ logger.debug(() => `Sending GraphQL Request: `, print(executionRequest.document));
35
37
  executionRequest.info = executionRequest.info || {};
36
38
  executionRequest.info.sourceName = sourceName;
37
39
  return executor(executionRequest);
@@ -274,7 +276,7 @@ export default class GraphQLHandler {
274
276
  const { contextVariables } = this.getArgsAndContextVariables();
275
277
  return {
276
278
  schema,
277
- executor: this.wrapExecutorToPassSourceName(highestValueExecutor),
279
+ executor: this.wrapExecutorToPassSourceNameAndDebug(highestValueExecutor),
278
280
  // Batching doesn't make sense with fallback strategy
279
281
  batch: false,
280
282
  contextVariables,
@@ -324,7 +326,7 @@ export default class GraphQLHandler {
324
326
  const { contextVariables } = this.getArgsAndContextVariables();
325
327
  return {
326
328
  schema: schemaResult.value,
327
- executor: this.wrapExecutorToPassSourceName(executorResult.value),
329
+ executor: this.wrapExecutorToPassSourceNameAndDebug(executorResult.value),
328
330
  batch: this.config.batch != null ? this.config.batch : true,
329
331
  contextVariables,
330
332
  };
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@graphql-mesh/graphql",
3
- "version": "0.33.11-alpha-20230207124039-e1ab926b9",
3
+ "version": "0.34.0",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "graphql": "*"
7
7
  },
8
8
  "dependencies": {
9
9
  "@graphql-mesh/cross-helpers": "0.3.1",
10
- "@graphql-mesh/store": "0.9.7-alpha-20230207124039-e1ab926b9",
10
+ "@graphql-mesh/store": "0.9.7",
11
11
  "@graphql-mesh/string-interpolation": "0.4.2",
12
- "@graphql-mesh/types": "0.89.6-alpha-20230207124039-e1ab926b9",
13
- "@graphql-mesh/utils": "0.43.7-alpha-20230207124039-e1ab926b9",
12
+ "@graphql-mesh/types": "0.90.0",
13
+ "@graphql-mesh/utils": "0.43.7",
14
14
  "@graphql-tools/delegate": "9.0.24",
15
15
  "@graphql-tools/url-loader": "7.17.5",
16
16
  "@graphql-tools/utils": "9.1.4",
@@ -12,7 +12,7 @@ export default class GraphQLHandler implements MeshHandler {
12
12
  constructor({ name, config, baseDir, store, importFn, logger, }: MeshHandlerOptions<YamlConfig.Handler['graphql']>);
13
13
  private interpolationStringSet;
14
14
  private getArgsAndContextVariables;
15
- private wrapExecutorToPassSourceName;
15
+ private wrapExecutorToPassSourceNameAndDebug;
16
16
  getExecutorForHTTPSourceConfig(httpSourceConfig: YamlConfig.GraphQLHandlerHTTPConfiguration): Promise<MeshSource['executor']>;
17
17
  getNonExecutableSchemaForHTTPSource(httpSourceConfig: YamlConfig.GraphQLHandlerHTTPConfiguration): Promise<GraphQLSchema>;
18
18
  getCodeFirstSource({ source: schemaConfig, }: YamlConfig.GraphQLHandlerCodeFirstConfiguration): Promise<MeshSource>;
@@ -12,7 +12,7 @@ export default class GraphQLHandler implements MeshHandler {
12
12
  constructor({ name, config, baseDir, store, importFn, logger, }: MeshHandlerOptions<YamlConfig.Handler['graphql']>);
13
13
  private interpolationStringSet;
14
14
  private getArgsAndContextVariables;
15
- private wrapExecutorToPassSourceName;
15
+ private wrapExecutorToPassSourceNameAndDebug;
16
16
  getExecutorForHTTPSourceConfig(httpSourceConfig: YamlConfig.GraphQLHandlerHTTPConfiguration): Promise<MeshSource['executor']>;
17
17
  getNonExecutableSchemaForHTTPSource(httpSourceConfig: YamlConfig.GraphQLHandlerHTTPConfiguration): Promise<GraphQLSchema>;
18
18
  getCodeFirstSource({ source: schemaConfig, }: YamlConfig.GraphQLHandlerCodeFirstConfiguration): Promise<MeshSource>;