We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 90b6e3d commit 48db6acCopy full SHA for 48db6ac
packages/gatsby/src/schema/resolvers.ts
@@ -566,13 +566,23 @@ export function wrappingResolver<TSource, TArgs>(
566
)
567
activity.start()
568
}
569
- try {
570
- return resolver(parent, args, context, info)
571
- } finally {
+ const result = resolver(parent, args, context, info)
+
+ if (!activity) {
572
+ return result
573
+ }
574
575
+ const endActivity = (): void => {
576
if (activity) {
577
activity.end()
578
579
580
+ if (typeof result?.then === `function`) {
581
+ result.then(endActivity, endActivity)
582
+ } else {
583
+ endActivity()
584
585
586
587
588
0 commit comments