@graphql-tools/delegate 8.7.11 → 8.7.12-alpha-b3ffd406.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/index.js +6 -3
- package/index.mjs +7 -4
- package/package.json +5 -6
package/index.js
CHANGED
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const graphql = require('graphql');
|
|
6
6
|
const utils = require('@graphql-tools/utils');
|
|
7
|
-
const graphqlExecutor = require('graphql-executor');
|
|
8
7
|
const valueOrPromise = require('value-or-promise');
|
|
9
8
|
const batchExecute = require('@graphql-tools/batch-execute');
|
|
10
9
|
|
|
@@ -1243,16 +1242,20 @@ function getExecutor(delegationContext) {
|
|
|
1243
1242
|
return executor;
|
|
1244
1243
|
}
|
|
1245
1244
|
const createDefaultExecutor = utils.memoize1(function createDefaultExecutor(schema) {
|
|
1246
|
-
const executorInstance = new graphqlExecutor.Executor({ schema });
|
|
1247
1245
|
return function defaultExecutor(request) {
|
|
1248
1246
|
const executionArgs = {
|
|
1247
|
+
schema,
|
|
1249
1248
|
document: request.document,
|
|
1250
1249
|
rootValue: request.rootValue,
|
|
1251
1250
|
contextValue: request.context,
|
|
1252
1251
|
variableValues: request.variables,
|
|
1253
1252
|
operationName: request.operationName,
|
|
1254
1253
|
};
|
|
1255
|
-
|
|
1254
|
+
const operationType = request.operationType || utils.getOperationASTFromRequest(request).operation;
|
|
1255
|
+
if (operationType === 'subscription') {
|
|
1256
|
+
return graphql.subscribe(executionArgs);
|
|
1257
|
+
}
|
|
1258
|
+
return graphql.execute(executionArgs);
|
|
1256
1259
|
};
|
|
1257
1260
|
});
|
|
1258
1261
|
|
package/index.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Kind, isAbstractType, isInterfaceType, TypeInfo, visit, visitWithTypeInfo, getNamedType, isObjectType, versionInfo, TypeNameMetaFieldDef, responsePathAsArray, GraphQLError, locatedError, getNullableType, isCompositeType, isListType, typeFromAST, defaultFieldResolver, validate } from 'graphql';
|
|
1
|
+
import { Kind, isAbstractType, isInterfaceType, TypeInfo, visit, visitWithTypeInfo, getNamedType, isObjectType, versionInfo, TypeNameMetaFieldDef, responsePathAsArray, GraphQLError, locatedError, getNullableType, isCompositeType, isListType, typeFromAST, defaultFieldResolver, validate, subscribe, execute } from 'graphql';
|
|
2
2
|
import { memoize2, implementsAbstractType, getRootTypeNames, getDefinedRootType, createVariableNameGenerator, updateArgument, serializeInputValue, inspect, collectFields, relocatedError, AggregateError, getResponseKeyFromInfo, isAsyncIterable, mapAsyncIterator, getOperationASTFromRequest, memoize1 } from '@graphql-tools/utils';
|
|
3
|
-
import { Executor } from 'graphql-executor';
|
|
4
3
|
import { ValueOrPromise } from 'value-or-promise';
|
|
5
4
|
import { getBatchingExecutor } from '@graphql-tools/batch-execute';
|
|
6
5
|
|
|
@@ -1239,16 +1238,20 @@ function getExecutor(delegationContext) {
|
|
|
1239
1238
|
return executor;
|
|
1240
1239
|
}
|
|
1241
1240
|
const createDefaultExecutor = memoize1(function createDefaultExecutor(schema) {
|
|
1242
|
-
const executorInstance = new Executor({ schema });
|
|
1243
1241
|
return function defaultExecutor(request) {
|
|
1244
1242
|
const executionArgs = {
|
|
1243
|
+
schema,
|
|
1245
1244
|
document: request.document,
|
|
1246
1245
|
rootValue: request.rootValue,
|
|
1247
1246
|
contextValue: request.context,
|
|
1248
1247
|
variableValues: request.variables,
|
|
1249
1248
|
operationName: request.operationName,
|
|
1250
1249
|
};
|
|
1251
|
-
|
|
1250
|
+
const operationType = request.operationType || getOperationASTFromRequest(request).operation;
|
|
1251
|
+
if (operationType === 'subscription') {
|
|
1252
|
+
return subscribe(executionArgs);
|
|
1253
|
+
}
|
|
1254
|
+
return execute(executionArgs);
|
|
1252
1255
|
};
|
|
1253
1256
|
});
|
|
1254
1257
|
|
package/package.json
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/delegate",
|
|
3
|
-
"version": "8.7.
|
|
3
|
+
"version": "8.7.12-alpha-b3ffd406.0",
|
|
4
4
|
"description": "A set of utils for faster development of GraphQL tools",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|
|
7
7
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@graphql-tools/batch-execute": "8.4.
|
|
11
|
-
"@graphql-tools/schema": "8.
|
|
12
|
-
"@graphql-tools/utils": "8.
|
|
10
|
+
"@graphql-tools/batch-execute": "8.4.11-alpha-b3ffd406.0",
|
|
11
|
+
"@graphql-tools/schema": "8.4.0-alpha-b3ffd406.0",
|
|
12
|
+
"@graphql-tools/utils": "8.7.0-alpha-b3ffd406.0",
|
|
13
13
|
"dataloader": "2.1.0",
|
|
14
|
-
"
|
|
15
|
-
"tslib": "^2.4.0",
|
|
14
|
+
"tslib": "~2.4.0",
|
|
16
15
|
"value-or-promise": "1.0.11"
|
|
17
16
|
},
|
|
18
17
|
"repository": {
|