From e4bc915c78b83f8f85a27d74696719db7f9e2e9b Mon Sep 17 00:00:00 2001 From: david-leifker <114954101+david-leifker@users.noreply.github.com> Date: Thu, 15 Feb 2024 20:24:44 -0600 Subject: [PATCH] chore(graphql): bump graphql engine version (#9864) --- build.gradle | 4 ++-- .../exception/DataHubDataFetcherExceptionHandler.java | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 0f5b4ccde8fb09..62b305edf27d71 100644 --- a/build.gradle +++ b/build.gradle @@ -128,8 +128,8 @@ project.ext.externalDependency = [ 'elasticSearchRest': 'org.opensearch.client:opensearch-rest-high-level-client:' + elasticsearchVersion, 'elasticSearchJava': 'org.opensearch.client:opensearch-java:2.6.0', 'findbugsAnnotations': 'com.google.code.findbugs:annotations:3.0.1', - 'graphqlJava': 'com.graphql-java:graphql-java:19.5', - 'graphqlJavaScalars': 'com.graphql-java:graphql-java-extended-scalars:19.1', + 'graphqlJava': 'com.graphql-java:graphql-java:21.3', + 'graphqlJavaScalars': 'com.graphql-java:graphql-java-extended-scalars:21.0', 'gson': 'com.google.code.gson:gson:2.8.9', 'guice': 'com.google.inject:guice:7.0.0', 'guice4': 'com.google.inject:guice:4.2.3', // Used for frontend while still on old Play version diff --git a/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/exception/DataHubDataFetcherExceptionHandler.java b/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/exception/DataHubDataFetcherExceptionHandler.java index 746ce0cdc10fe1..48c57b5c641576 100644 --- a/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/exception/DataHubDataFetcherExceptionHandler.java +++ b/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/exception/DataHubDataFetcherExceptionHandler.java @@ -6,6 +6,7 @@ import graphql.execution.DataFetcherExceptionHandlerResult; import graphql.execution.ResultPath; import graphql.language.SourceLocation; +import java.util.concurrent.CompletableFuture; import lombok.extern.slf4j.Slf4j; @PublicApi @@ -15,7 +16,7 @@ public class DataHubDataFetcherExceptionHandler implements DataFetcherExceptionH private static final String DEFAULT_ERROR_MESSAGE = "An unknown error occurred."; @Override - public DataFetcherExceptionHandlerResult onException( + public CompletableFuture handleException( DataFetcherExceptionHandlerParameters handlerParameters) { Throwable exception = handlerParameters.getException(); SourceLocation sourceLocation = handlerParameters.getSourceLocation(); @@ -44,7 +45,8 @@ public DataFetcherExceptionHandlerResult onException( log.error("Failed to execute", exception); } DataHubGraphQLError error = new DataHubGraphQLError(message, path, sourceLocation, errorCode); - return DataFetcherExceptionHandlerResult.newResult().error(error).build(); + return CompletableFuture.completedFuture( + DataFetcherExceptionHandlerResult.newResult().error(error).build()); } T findFirstThrowableCauseOfClass(Throwable throwable, Class clazz) {