@graphitation/supermassive 3.6.1 → 3.6.2
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/.eslintcache +1 -1
- package/CHANGELOG.md +4 -12
- package/lib/executeWithoutSchema.d.ts.map +1 -1
- package/lib/executeWithoutSchema.js +11 -48
- package/lib/executeWithoutSchema.js.map +2 -2
- package/lib/executeWithoutSchema.mjs +11 -48
- package/lib/executeWithoutSchema.mjs.map +2 -2
- package/lib/hooks/types.d.ts +3 -3
- package/lib/hooks/types.d.ts.map +1 -1
- package/lib/hooks/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -83,7 +83,7 @@ function executeWithoutSchema(args) {
|
|
|
83
83
|
if (!("schemaFragment" in exeContext)) {
|
|
84
84
|
return { errors: exeContext };
|
|
85
85
|
} else {
|
|
86
|
-
return
|
|
86
|
+
return executeOperation(exeContext);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
function assertValidExecutionArguments(document, rawVariableValues) {
|
|
@@ -175,17 +175,6 @@ function buildPerEventExecutionContext(exeContext, payload) {
|
|
|
175
175
|
errors: []
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
|
-
function executeOperationWithBeforeHook(exeContext) {
|
|
179
|
-
const hooks = exeContext.fieldExecutionHooks;
|
|
180
|
-
let hook;
|
|
181
|
-
if (hooks == null ? void 0 : hooks.beforeOperationExecute) {
|
|
182
|
-
hook = invokeBeforeOperationExecuteHook(exeContext);
|
|
183
|
-
}
|
|
184
|
-
if (isPromise(hook)) {
|
|
185
|
-
return hook.then(() => executeOperation(exeContext));
|
|
186
|
-
}
|
|
187
|
-
return executeOperation(exeContext);
|
|
188
|
-
}
|
|
189
178
|
function executeOperation(exeContext) {
|
|
190
179
|
try {
|
|
191
180
|
const { operation, rootValue } = exeContext;
|
|
@@ -196,6 +185,10 @@ function executeOperation(exeContext) {
|
|
|
196
185
|
);
|
|
197
186
|
const path = void 0;
|
|
198
187
|
let result;
|
|
188
|
+
const hooks = exeContext.fieldExecutionHooks;
|
|
189
|
+
if (hooks == null ? void 0 : hooks.beforeOperationExecute) {
|
|
190
|
+
invokeBeforeOperationExecuteHook(exeContext);
|
|
191
|
+
}
|
|
199
192
|
switch (operation.operation) {
|
|
200
193
|
case "query":
|
|
201
194
|
result = executeFields(
|
|
@@ -463,10 +456,7 @@ function executeSubscriptionImpl(exeContext) {
|
|
|
463
456
|
if (!isDefaultResolverUsed && (hooks == null ? void 0 : hooks.beforeFieldResolve)) {
|
|
464
457
|
hookContext = invokeBeforeFieldResolveHook(info, exeContext);
|
|
465
458
|
}
|
|
466
|
-
const result =
|
|
467
|
-
hookContext = context;
|
|
468
|
-
return resolveFn(rootValue, args, contextValue, info);
|
|
469
|
-
}) : resolveFn(rootValue, args, contextValue, info);
|
|
459
|
+
const result = resolveFn(rootValue, args, contextValue, info);
|
|
470
460
|
if (isPromise(result)) {
|
|
471
461
|
return result.then(assertEventStream).then(
|
|
472
462
|
(resolved) => {
|
|
@@ -550,24 +540,11 @@ function mapResultOrEventStreamOrPromise(resultOrStreamOrPromise, exeContext, pa
|
|
|
550
540
|
payload
|
|
551
541
|
);
|
|
552
542
|
const hooks = exeContext == null ? void 0 : exeContext.fieldExecutionHooks;
|
|
553
|
-
let beforeExecuteFieldsHook;
|
|
554
543
|
if (hooks == null ? void 0 : hooks.beforeSubscriptionEventEmit) {
|
|
555
|
-
|
|
556
|
-
perEventContext,
|
|
557
|
-
payload
|
|
558
|
-
);
|
|
544
|
+
invokeBeforeSubscriptionEventEmitHook(perEventContext, payload);
|
|
559
545
|
}
|
|
560
546
|
try {
|
|
561
|
-
const data =
|
|
562
|
-
() => executeFields(
|
|
563
|
-
exeContext,
|
|
564
|
-
parentTypeName,
|
|
565
|
-
payload,
|
|
566
|
-
path,
|
|
567
|
-
groupedFieldSet,
|
|
568
|
-
void 0
|
|
569
|
-
)
|
|
570
|
-
) : executeFields(
|
|
547
|
+
const data = executeFields(
|
|
571
548
|
exeContext,
|
|
572
549
|
parentTypeName,
|
|
573
550
|
payload,
|
|
@@ -633,10 +610,7 @@ function resolveAndCompleteField(exeContext, parentTypeName, fieldDefinition, fi
|
|
|
633
610
|
if (!isDefaultResolverUsed && (hooks == null ? void 0 : hooks.beforeFieldResolve)) {
|
|
634
611
|
hookContext = invokeBeforeFieldResolveHook(info, exeContext);
|
|
635
612
|
}
|
|
636
|
-
const result =
|
|
637
|
-
hookContext = context;
|
|
638
|
-
return resolveFn(source, args, contextValue, info);
|
|
639
|
-
}) : resolveFn(source, args, contextValue, info);
|
|
613
|
+
const result = resolveFn(source, args, contextValue, info);
|
|
640
614
|
let completed;
|
|
641
615
|
if (isPromise(result)) {
|
|
642
616
|
completed = result.then(
|
|
@@ -1377,20 +1351,9 @@ function executeSafe(execute, onComplete) {
|
|
|
1377
1351
|
} catch (e) {
|
|
1378
1352
|
error = e;
|
|
1379
1353
|
} finally {
|
|
1380
|
-
|
|
1381
|
-
onComplete(result, error);
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
1384
|
-
if (!isPromise(result)) {
|
|
1385
|
-
return result;
|
|
1354
|
+
onComplete(result, error);
|
|
1386
1355
|
}
|
|
1387
|
-
return result
|
|
1388
|
-
onComplete(hookResult, error);
|
|
1389
|
-
return hookResult;
|
|
1390
|
-
}).catch((e) => {
|
|
1391
|
-
onComplete(void 0, e);
|
|
1392
|
-
return void 0;
|
|
1393
|
-
});
|
|
1356
|
+
return result;
|
|
1394
1357
|
}
|
|
1395
1358
|
function toGraphQLError(originalError, path, prependMessage) {
|
|
1396
1359
|
const originalMessage = originalError instanceof Error ? originalError.message : inspect(originalError);
|