line / armeria

Your go-to microservice framework for any situation, from the creator of Netty et al. You can build any type of microservice leveraging your favorite technologies, including gRPC, Thrift, Kotlin, Retrofit, Reactive Streams, Spring Boot and Dropwizard.
https://armeria.dev
Apache License 2.0
4.83k stars 922 forks source link

Handle a null ExecutionResult in `GraphqlService` #5816

Closed ikhoon closed 4 months ago

ikhoon commented 4 months ago

Motivation:

If GraphQL.execute(input) returns a CompletableFuture completing exceptionally, NullPointException is raised while handling ExecutionResult.

java.lang.NullPointerException: Cannot invoke "graphql.ExecutionResult.getData()" because "executionResult" is null
    at com.linecorp.armeria.server.graphql.DefaultGraphqlService.lambda$execute$1(DefaultGraphqlService.java:117)
    at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934)
    at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911)

Modifications:

Result:

github-actions[bot] commented 4 months ago

🔍 Build Scan® (commit: 3d3089a5d91d46e42a48cdef83bac9aabad1b7e7)

Job name Status Build Scan®
build-windows-latest-jdk-21 https://ge.armeria.dev/s/bzoe7cnl6iclu
build-self-hosted-unsafe-jdk-8 https://ge.armeria.dev/s/hnqvh7jkxcnqy
build-self-hosted-unsafe-jdk-21-snapshot-blockhound https://ge.armeria.dev/s/uq2rojimb76sa
build-self-hosted-unsafe-jdk-17-min-java-17-coverage https://ge.armeria.dev/s/lwcxd55dqboqi
build-self-hosted-unsafe-jdk-17-min-java-11 https://ge.armeria.dev/s/xiivgsb7tf2cs
build-self-hosted-unsafe-jdk-17-leak https://ge.armeria.dev/s/cmlgb3wmonpou
build-self-hosted-unsafe-jdk-11 https://ge.armeria.dev/s/7ebqix3x6jf5k
build-macos-12-jdk-21 https://ge.armeria.dev/s/pu7ubnondl54m