@graphql-mesh/runtime 0.105.21 → 0.105.22

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/get-mesh.js CHANGED
@@ -10,6 +10,7 @@ const executor_1 = require("@graphql-tools/executor");
10
10
  const utils_2 = require("@graphql-tools/utils");
11
11
  const wrap_1 = require("@graphql-tools/wrap");
12
12
  const fetch_1 = require("@whatwg-node/fetch");
13
+ const promise_helpers_1 = require("@whatwg-node/promise-helpers");
13
14
  const constants_js_1 = require("./constants.js");
14
15
  const utils_js_1 = require("./utils.js");
15
16
  const memoizedGetEnvelopedFactory = (0, utils_2.memoize1)(function getEnvelopedFactory(plugins) {
@@ -223,7 +224,7 @@ async function getMesh(options) {
223
224
  }
224
225
  const isSubscription = operationAST.operation === 'subscription';
225
226
  const executeFn = isSubscription ? subscribe : execute;
226
- return (0, utils_1.mapMaybePromise)(contextFactory(contextValue), contextValue => executeFn({
227
+ return (0, promise_helpers_1.handleMaybePromise)(() => contextFactory(contextValue), contextValue => executeFn({
227
228
  schema,
228
229
  document,
229
230
  contextValue,
@@ -236,7 +237,7 @@ async function getMesh(options) {
236
237
  function sdkRequesterFactory(globalContext) {
237
238
  const executor = createExecutor(globalContext);
238
239
  return function sdkRequester(...args) {
239
- return (0, utils_1.mapMaybePromise)(executor(...args), function handleExecutorResultForSdk(result) {
240
+ return (0, promise_helpers_1.handleMaybePromise)(() => executor(...args), function handleExecutorResultForSdk(result) {
240
241
  if ((0, utils_2.isAsyncIterable)(result)) {
241
242
  return (0, utils_2.mapAsyncIterator)(result, extractDataOrThrowErrors);
242
243
  }
package/esm/get-mesh.js CHANGED
@@ -1,11 +1,12 @@
1
1
  import { getOperationAST, specifiedRules, validate } from 'graphql';
2
2
  import { envelop, useEngine, useExtendContext, useSchema } from '@envelop/core';
3
3
  import { process } from '@graphql-mesh/cross-helpers';
4
- import { applySchemaTransforms, DefaultLogger, getHeadersObj, getInContextSDK, groupTransforms, makeDisposable, mapMaybePromise, parseWithCache, PubSub, wrapFetchWithHooks, } from '@graphql-mesh/utils';
4
+ import { applySchemaTransforms, DefaultLogger, getHeadersObj, getInContextSDK, groupTransforms, makeDisposable, parseWithCache, PubSub, wrapFetchWithHooks, } from '@graphql-mesh/utils';
5
5
  import { normalizedExecutor } from '@graphql-tools/executor';
6
6
  import { createGraphQLError, getRootTypeMap, isAsyncIterable, mapAsyncIterator, memoize1, } from '@graphql-tools/utils';
7
7
  import { wrapSchema } from '@graphql-tools/wrap';
8
8
  import { fetch as defaultFetchFn } from '@whatwg-node/fetch';
9
+ import { handleMaybePromise } from '@whatwg-node/promise-helpers';
9
10
  import { MESH_CONTEXT_SYMBOL } from './constants.js';
10
11
  import { getOriginalError } from './utils.js';
11
12
  const memoizedGetEnvelopedFactory = memoize1(function getEnvelopedFactory(plugins) {
@@ -219,7 +220,7 @@ export async function getMesh(options) {
219
220
  }
220
221
  const isSubscription = operationAST.operation === 'subscription';
221
222
  const executeFn = isSubscription ? subscribe : execute;
222
- return mapMaybePromise(contextFactory(contextValue), contextValue => executeFn({
223
+ return handleMaybePromise(() => contextFactory(contextValue), contextValue => executeFn({
223
224
  schema,
224
225
  document,
225
226
  contextValue,
@@ -232,7 +233,7 @@ export async function getMesh(options) {
232
233
  function sdkRequesterFactory(globalContext) {
233
234
  const executor = createExecutor(globalContext);
234
235
  return function sdkRequester(...args) {
235
- return mapMaybePromise(executor(...args), function handleExecutorResultForSdk(result) {
236
+ return handleMaybePromise(() => executor(...args), function handleExecutorResultForSdk(result) {
236
237
  if (isAsyncIterable(result)) {
237
238
  return mapAsyncIterator(result, extractDataOrThrowErrors);
238
239
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-mesh/runtime",
3
- "version": "0.105.21",
3
+ "version": "0.105.22",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "graphql": "*"
@@ -11,14 +11,15 @@
11
11
  "@envelop/graphql-jit": "^9.0.0",
12
12
  "@graphql-mesh/cross-helpers": "^0.4.10",
13
13
  "@graphql-mesh/string-interpolation": "^0.5.8",
14
- "@graphql-mesh/types": "^0.103.19",
15
- "@graphql-mesh/utils": "^0.103.19",
14
+ "@graphql-mesh/types": "^0.103.20",
15
+ "@graphql-mesh/utils": "^0.103.20",
16
16
  "@graphql-tools/batch-delegate": "^9.0.9",
17
17
  "@graphql-tools/delegate": "^10.0.28",
18
18
  "@graphql-tools/executor": "^1.3.2",
19
19
  "@graphql-tools/utils": "^10.8.0",
20
20
  "@graphql-tools/wrap": "^10.0.28",
21
21
  "@whatwg-node/fetch": "^0.10.4",
22
+ "@whatwg-node/promise-helpers": "^1.0.0",
22
23
  "graphql-jit": "^0.8.7",
23
24
  "tslib": "^2.4.0"
24
25
  },