Repository: quarkusio/quarkus
Issue: quarkus-smallrye-graphql: @ErrorDataFetch event is not emitted in batch query

### Describe the bug

When executing a non-batch query, the following code can receive the error that is thrown during data-fetching process.
```
  public void onError(@Observes @ErrorDataFetch ErrorInfo errorInfo) {
    System.out.println("[error] " + errorInfo.getT().getMessage());
  }
```

But, when executing a [batch query](https://quarkus.io/guides/smallrye-graphql#batching) and an error is thrown in the batch process, the above observer can't receive the error.

I guess that we should call `eventEmitter.fireOnDataFetchError(...)` like [this code of non-batching query](https://github.com/quarkusio/quarkus/blob/7744dec/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/spi/datafetcher/QuarkusDefaultDataFetcher.java#L90).

### Expected behavior

_No response_

### Actual behavior

_No response_

### How to Reproduce?

I wrote a minimum reproducible example.
https://github.com/ikenox/code-with-quarkus/blob/e794dddd21d75d09e9a3e68b4602f5da48d7ca62/src/main/java/info/ikenox/ExampleResolver.java

You can reproduce the issue by executing the following GraphQL query.
```
query {
  example{
    fooValue
    bar{
      barValue
    }
  }
}
```

### Output of `uname -a` or `ver`

_No response_

### Output of `java -version`

_No response_

### GraalVM version (if different from Java)

_No response_

### Quarkus version or git rev

_No response_

### Build tool (ie. output of `mvnw --version` or `gradlew --version`)

_No response_

### Additional information

_No response_

Changed files:
extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/spi/datafetcher/QuarkusDefaultDataFetcher.java

diff --git a/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/spi/datafetcher/QuarkusDefaultDataFetcher.java b/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/spi/datafetcher/QuarkusDefaultDataFetcher.java
index d6d6dad5005..311891879e5 100644
--- a/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/spi/datafetcher/QuarkusDefaultDataFetcher.java
+++ b/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/spi/datafetcher/QuarkusDefaultDataFetcher.java
@@ -3,6 +3,7 @@
 import java.util.List;
 import java.util.concurrent.Callable;
 import java.util.concurrent.CompletionStage;
+import java.util.function.Consumer;
 
 import org.eclipse.microprofile.graphql.GraphQLException;
 
@@ -110,10 +111,20 @@ private CompletionStage<List<T>> invokeBatchBlocking(DataFetchingEnvironment dfe
             return (List<T>) operationInvoker.invokePrivileged(arguments);
         });
 
+        // this gets called on a batch error, so that error callbacks can run with the proper context too
+        Consumer<Throwable> onErrorConsumer = threadContext.contextualConsumer((Throwable exception) -> {
+            io.smallrye.graphql.api.Context context = dfe.getGraphQlContext().get("context");
+            eventEmitter.fireOnDataFetchError(context, exception);
+        });
+
         // Here call blocking with context
         BlockingHelper.runBlocking(vc, contextualCallable, result);
-        return result.future().toCompletionStage();
-
+        return result.future().toCompletionStage()
+                .whenComplete((resultList, error) -> {
+                    if (error != null) {
+                        onErrorConsumer.accept(error);
+                    }
+                });
     }
 
     private boolean runBlocking(DataFetchingEnvironment dfe) {