@graphitation/supermassive 3.8.0-alpha.2 → 3.8.0-alpha.3

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/CHANGELOG.md CHANGED
@@ -1,16 +1,16 @@
1
1
  # Change Log - @graphitation/supermassive
2
2
 
3
- <!-- This log was last generated on Mon, 16 Dec 2024 18:09:33 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Tue, 17 Dec 2024 19:43:04 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## 3.8.0-alpha.2
7
+ ## 3.8.0-alpha.3
8
8
 
9
- Mon, 16 Dec 2024 18:09:33 GMT
9
+ Tue, 17 Dec 2024 19:43:04 GMT
10
10
 
11
11
  ### Changes
12
12
 
13
- - fix (77059398+vejrj@users.noreply.github.com)
13
+ - subscribe hooks fixed (77059398+vejrj@users.noreply.github.com)
14
14
 
15
15
  ## 3.7.2
16
16
 
@@ -1 +1 @@
1
- {"version":3,"file":"executeWithoutSchema.d.ts","sourceRoot":"","sources":["../src/executeWithoutSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAIZ,YAAY,EACZ,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AACjB,OAAO,EAGL,UAAU,EAEX,MAAM,iBAAiB,CAAC;AAOzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAG3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,KAAK,EACV,0BAA0B,EAC1B,qBAAqB,EACrB,WAAW,EACX,YAAY,EACZ,eAAe,EACf,oBAAoB,EAKpB,0BAA0B,EAC1B,cAAc,EACd,oBAAoB,EAErB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ildResponseHook(exeContext, initialResult);
298
+ const hookResult = invokeAfterBuildResponseHook(
299
+ exeContext,
300
+ initialResult
301
+ );
299
302
  if (exeContext.errors.length > ((_b = (_a = initialResult.errors) == null ? void 0 : _a.length) != null ? _b : 0)) {
300
303
  initialResult.errors = exeContext.errors;
301
304
  }
305
+ if (hookResult instanceof import_graphql.GraphQLError) {
306
+ return { errors: initialResult.errors };
307
+ }
302
308
  }
303
309
  return initialResult;
304
310
  }
@@ -487,23 +493,18 @@ function executeSubscriptionImpl(exeContext) {
487
493
  const hooks = exeContext.fieldExecutionHooks;
488
494
  let hookContext = void 0;
489
495
  try {
490
- const args = (0, import_values.getArgumentValues)(exeContext, fieldDef, fieldGroup[0]);
491
- const contextValue = exeContext.contextValue;
496
+ let result;
492
497
  if (!isDefaultResolverUsed && (hooks == null ? void 0 : hooks.beforeFieldSubscribe)) {
493
498
  hookContext = invokeBeforeFieldSubscribeHook(info, exeContext);
494
499
  }
495
- let result;
500
+ const args = (0, import_values.getArgumentValues)(exeContext, fieldDef, fieldGroup[0]);
501
+ const contextValue = exeContext.contextValue;
496
502
  if (hookContext) {
497
503
  if ((0, import_isPromise.isPromise)(hookContext)) {
498
504
  result = hookContext.then((context) => {
499
505
  hookContext = context;
500
- if (hookContext instanceof import_graphql.GraphQLError) {
501
- return null;
502
- }
503
506
  return resolveFn(rootValue, args, contextValue, info);
504
507
  });
505
- } else if (hookContext instanceof import_graphql.GraphQLError) {
506
- result = null;
507
508
  }
508
509
  }
509
510
  if (result === void 0) {
@@ -518,42 +519,23 @@ function executeSubscriptionImpl(exeContext) {
518
519
  resolved,
519
520
  error
520
521
  );
521
- if (hookContext instanceof import_graphql.GraphQLError) {
522
- throw hookContext;
523
- }
524
522
  }
525
523
  };
526
524
  if ((0, import_isPromise.isPromise)(result)) {
527
- return result.then(assertEventStream).then(
528
- (resolved) => {
529
- if (resolved instanceof import_graphql.GraphQLError) {
530
- throw resolved;
531
- }
532
- if (!isDefaultResolverUsed && (hooks == null ? void 0 : hooks.afterFieldSubscribe)) {
533
- hookContext = invokeAfterFieldSubscribeHook(
534
- info,
535
- exeContext,
536
- hookContext,
537
- resolved
538
- );
539
- if (hookContext instanceof import_graphql.GraphQLError) {
540
- throw hookContext;
541
- }
542
- }
543
- return resolved;
544
- },
545
- (error) => {
546
- afterFieldSubscribeHandle(void 0, error);
547
- throw (0, import_graphql.locatedError)(error, fieldGroup, (0, import_Path.pathToArray)(path));
548
- }
549
- );
525
+ return result.then(assertEventStream, (error) => {
526
+ afterFieldSubscribeHandle(void 0, error);
527
+ throw (0, import_graphql.locatedError)(error, fieldGroup, (0, import_Path.pathToArray)(path));
528
+ }).then((resolved) => {
529
+ afterFieldSubscribeHandle(resolved);
530
+ return resolved;
531
+ });
550
532
  }
551
533
  const stream = assertEventStream(result);
552
534
  afterFieldSubscribeHandle(stream);
553
535
  return stream;
554
536
  } catch (error) {
555
537
  if (!isDefaultResolverUsed && (hooks == null ? void 0 : hooks.afterFieldSubscribe)) {
556
- hookContext = invokeAfterFieldSubscribeHook(
538
+ invokeAfterFieldSubscribeHook(
557
539
  info,
558
540
  exeContext,
559
541
  hookContext,
@@ -561,9 +543,6 @@ function executeSubscriptionImpl(exeContext) {
561
543
  error
562
544
  );
563
545
  }
564
- if (hookContext instanceof import_graphql.GraphQLError) {
565
- throw hookContext;
566
- }
567
546
  throw (0, import_graphql.locatedError)(error, fieldGroup, (0, import_Path.pathToArray)(path));
568
547
  }
569
548
  }
@@ -757,13 +736,10 @@ function resolveAndCompleteField(exeContext, parentTypeName, fieldDefinition, fi
757
736
  ),
758
737
  (rawError) => {
759
738
  const error = (0, import_graphql.locatedError)(rawError, fieldGroup, (0, import_Path.pathToArray)(path));
760
- const hookResult = handleAfterFieldHooks(
739
+ handleAfterFieldHooks(
761
740
  invokeAfterFieldCompleteHook,
762
741
  !!(hooks == null ? void 0 : hooks.afterFieldComplete)
763
742
  )(void 0, error);
764
- if (hookResult === null) {
765
- return null;
766
- }
767
743
  handleFieldError(
768
744
  rawError,
769
745
  exeContext,
@@ -1294,7 +1270,7 @@ function invokeBeforeFieldSubscribeHook(resolveInfo, exeContext) {
1294
1270
  "Unexpected error in beforeFieldSubscribe hook"
1295
1271
  );
1296
1272
  exeContext.errors.push(error);
1297
- return error;
1273
+ throw error;
1298
1274
  } else if (result instanceof Error) {
1299
1275
  const error = toGraphQLError(
1300
1276
  result,
@@ -1302,7 +1278,7 @@ function invokeBeforeFieldSubscribeHook(resolveInfo, exeContext) {
1302
1278
  "Unexpected error in beforeFieldSubscribe hook"
1303
1279
  );
1304
1280
  exeContext.errors.push(error);
1305
- return error;
1281
+ throw error;
1306
1282
  }
1307
1283
  return result;
1308
1284
  }
@@ -1397,7 +1373,7 @@ function invokeAfterFieldSubscribeHook(resolveInfo, exeContext, hookContext, res
1397
1373
  "Unexpected error in afterFieldSubscribe hook"
1398
1374
  );
1399
1375
  exeContext.errors.push(error2);
1400
- return error2;
1376
+ throw error2;
1401
1377
  } else if (result2 instanceof Error) {
1402
1378
  const error2 = toGraphQLError(
1403
1379
  result2,
@@ -1405,7 +1381,7 @@ function invokeAfterFieldSubscribeHook(resolveInfo, exeContext, hookContext, res
1405
1381
  "Unexpected error in afterFieldSubscribe hook"
1406
1382
  );
1407
1383
  exeContext.errors.push(error2);
1408
- return error2;
1384
+ throw error2;
1409
1385
  }
1410
1386
  return result2;
1411
1387
  }
@@ -1468,7 +1444,7 @@ function invokeBeforeOperationExecuteHook(exeContext) {
1468
1444
  }
1469
1445
  if (result instanceof Error) {
1470
1446
  const error = toGraphQLError(
1471
- rawError,
1447
+ result,
1472
1448
  void 0,
1473
1449
  "Unexpected error in beforeOperationExecute hook"
1474
1450
  );
@@ -1523,7 +1499,7 @@ function invokeAfterBuildResponseHook(exeContext, result) {
1523
1499
  operation: exeContext.operation,
1524
1500
  result
1525
1501
  }),
1526
- (_, rawError) => {
1502
+ (result2, rawError) => {
1527
1503
  if (rawError) {
1528
1504
  const error = toGraphQLError(
1529
1505
  rawError,
@@ -1531,6 +1507,14 @@ function invokeAfterBuildResponseHook(exeContext, result) {
1531
1507
  "Unexpected error in afterBuildResponse hook"
1532
1508
  );
1533
1509
  exeContext.errors.push(error);
1510
+ return error;
1511
+ } else if (result2 instanceof Error) {
1512
+ const error = toGraphQLError(
1513
+ result2,
1514
+ void 0,
1515
+ "Unexpected error in afterBuildResponse hook"
1516
+ );
1517
+ exeContext.errors.push(error);
1534
1518
  }
1535
1519
  }
1536
1520
  );