@graphql-tools/executor 1.2.6 → 1.2.7-alpha-20240619191149-cd1ab96503149b7ed7feaeae653872e1579a89ca
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/execution/execute.js +26 -1
- package/esm/execution/execute.js +27 -2
- package/package.json +1 -1
package/cjs/execution/execute.js
CHANGED
|
@@ -622,7 +622,10 @@ function ensureValidRuntimeType(runtimeTypeName, exeContext, returnType, fieldNo
|
|
|
622
622
|
// releases before 16.0.0 supported returning `GraphQLObjectType` from `resolveType`
|
|
623
623
|
// TODO: remove in 17.0.0 release
|
|
624
624
|
if ((0, graphql_1.isObjectType)(runtimeTypeName)) {
|
|
625
|
-
|
|
625
|
+
if (graphql_1.versionInfo.major >= 16) {
|
|
626
|
+
throw (0, utils_1.createGraphQLError)('Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.');
|
|
627
|
+
}
|
|
628
|
+
runtimeTypeName = runtimeTypeName.name;
|
|
626
629
|
}
|
|
627
630
|
if (typeof runtimeTypeName !== 'string') {
|
|
628
631
|
throw (0, utils_1.createGraphQLError)(`Abstract type "${returnType.name}" must resolve to an Object type at runtime for field "${info.parentType.name}.${info.fieldName}" with ` +
|
|
@@ -1208,6 +1211,16 @@ function yieldSubsequentPayloads(exeContext) {
|
|
|
1208
1211
|
};
|
|
1209
1212
|
}
|
|
1210
1213
|
class DeferredFragmentRecord {
|
|
1214
|
+
type;
|
|
1215
|
+
errors;
|
|
1216
|
+
label;
|
|
1217
|
+
path;
|
|
1218
|
+
promise;
|
|
1219
|
+
data;
|
|
1220
|
+
parentContext;
|
|
1221
|
+
isCompleted;
|
|
1222
|
+
_exeContext;
|
|
1223
|
+
_resolve;
|
|
1211
1224
|
constructor(opts) {
|
|
1212
1225
|
this.type = 'defer';
|
|
1213
1226
|
this.label = opts.label;
|
|
@@ -1237,6 +1250,18 @@ class DeferredFragmentRecord {
|
|
|
1237
1250
|
}
|
|
1238
1251
|
}
|
|
1239
1252
|
class StreamRecord {
|
|
1253
|
+
type;
|
|
1254
|
+
errors;
|
|
1255
|
+
label;
|
|
1256
|
+
path;
|
|
1257
|
+
items;
|
|
1258
|
+
promise;
|
|
1259
|
+
parentContext;
|
|
1260
|
+
iterator;
|
|
1261
|
+
isCompletedIterator;
|
|
1262
|
+
isCompleted;
|
|
1263
|
+
_exeContext;
|
|
1264
|
+
_resolve;
|
|
1240
1265
|
constructor(opts) {
|
|
1241
1266
|
this.type = 'stream';
|
|
1242
1267
|
this.items = null;
|
package/esm/execution/execute.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { assertValidSchema, getDirectiveValues, GraphQLError, isAbstractType, isLeafType, isListType, isNonNullType, isObjectType, Kind, locatedError, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, } from 'graphql';
|
|
1
|
+
import { assertValidSchema, getDirectiveValues, GraphQLError, isAbstractType, isLeafType, isListType, isNonNullType, isObjectType, Kind, locatedError, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, versionInfo, } from 'graphql';
|
|
2
2
|
import { ValueOrPromise } from 'value-or-promise';
|
|
3
3
|
import { collectSubFields as _collectSubfields, addPath, collectFields, createGraphQLError, getArgumentValues, getDefinedRootType, GraphQLStreamDirective, inspect, isAsyncIterable, isIterableObject, isObjectLike, isPromise, mapAsyncIterator, memoize1, memoize3, pathToArray, promiseReduce, } from '@graphql-tools/utils';
|
|
4
4
|
import { coerceError } from './coerceError.js';
|
|
@@ -614,7 +614,10 @@ function ensureValidRuntimeType(runtimeTypeName, exeContext, returnType, fieldNo
|
|
|
614
614
|
// releases before 16.0.0 supported returning `GraphQLObjectType` from `resolveType`
|
|
615
615
|
// TODO: remove in 17.0.0 release
|
|
616
616
|
if (isObjectType(runtimeTypeName)) {
|
|
617
|
-
|
|
617
|
+
if (versionInfo.major >= 16) {
|
|
618
|
+
throw createGraphQLError('Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.');
|
|
619
|
+
}
|
|
620
|
+
runtimeTypeName = runtimeTypeName.name;
|
|
618
621
|
}
|
|
619
622
|
if (typeof runtimeTypeName !== 'string') {
|
|
620
623
|
throw createGraphQLError(`Abstract type "${returnType.name}" must resolve to an Object type at runtime for field "${info.parentType.name}.${info.fieldName}" with ` +
|
|
@@ -1196,6 +1199,16 @@ function yieldSubsequentPayloads(exeContext) {
|
|
|
1196
1199
|
};
|
|
1197
1200
|
}
|
|
1198
1201
|
class DeferredFragmentRecord {
|
|
1202
|
+
type;
|
|
1203
|
+
errors;
|
|
1204
|
+
label;
|
|
1205
|
+
path;
|
|
1206
|
+
promise;
|
|
1207
|
+
data;
|
|
1208
|
+
parentContext;
|
|
1209
|
+
isCompleted;
|
|
1210
|
+
_exeContext;
|
|
1211
|
+
_resolve;
|
|
1199
1212
|
constructor(opts) {
|
|
1200
1213
|
this.type = 'defer';
|
|
1201
1214
|
this.label = opts.label;
|
|
@@ -1225,6 +1238,18 @@ class DeferredFragmentRecord {
|
|
|
1225
1238
|
}
|
|
1226
1239
|
}
|
|
1227
1240
|
class StreamRecord {
|
|
1241
|
+
type;
|
|
1242
|
+
errors;
|
|
1243
|
+
label;
|
|
1244
|
+
path;
|
|
1245
|
+
items;
|
|
1246
|
+
promise;
|
|
1247
|
+
parentContext;
|
|
1248
|
+
iterator;
|
|
1249
|
+
isCompletedIterator;
|
|
1250
|
+
isCompleted;
|
|
1251
|
+
_exeContext;
|
|
1252
|
+
_resolve;
|
|
1228
1253
|
constructor(opts) {
|
|
1229
1254
|
this.type = 'stream';
|
|
1230
1255
|
this.items = null;
|
package/package.json
CHANGED