From 9fdfdcbb46923688aed78bc5007cef0700301038 Mon Sep 17 00:00:00 2001 From: Phillip Kruger Date: Tue, 26 Jan 2021 11:46:13 +0200 Subject: [PATCH 1/3] Added test app for (upcoming) batch exception fix. (master) Signed-off-by:Phillip Kruger --- server/pom.xml | 2 +- .../graphql/test/apps/batch/api/BatchApi.java | 60 +++++++++++++++++++ .../test/apps/batch/api/BatchPojo.java | 17 ++++++ .../apps/batch/api/BusinessException.java | 24 ++++++++ 4 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 server/tck/src/test/java/io/smallrye/graphql/test/apps/batch/api/BatchApi.java create mode 100644 server/tck/src/test/java/io/smallrye/graphql/test/apps/batch/api/BatchPojo.java create mode 100644 server/tck/src/test/java/io/smallrye/graphql/test/apps/batch/api/BusinessException.java diff --git a/server/pom.xml b/server/pom.xml index 8b283223e..1d96b3e6c 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -16,7 +16,7 @@ - 21.0.1.Final + 22.0.0.Final diff --git a/server/tck/src/test/java/io/smallrye/graphql/test/apps/batch/api/BatchApi.java b/server/tck/src/test/java/io/smallrye/graphql/test/apps/batch/api/BatchApi.java new file mode 100644 index 000000000..9f18ba09e --- /dev/null +++ b/server/tck/src/test/java/io/smallrye/graphql/test/apps/batch/api/BatchApi.java @@ -0,0 +1,60 @@ +package io.smallrye.graphql.test.apps.batch.api; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +import org.eclipse.microprofile.graphql.GraphQLApi; +import org.eclipse.microprofile.graphql.Query; +import org.eclipse.microprofile.graphql.Source; + +@GraphQLApi +public class BatchApi { + + // Normal List Query + @Query + public List batchPojos() { + List l = new ArrayList<>(); + l.add(new BatchPojo(1)); + l.add(new BatchPojo(2)); + l.add(new BatchPojo(3)); + l.add(new BatchPojo(4)); + + return l; + } + + // Nornal Source + public String greeting(@Source BatchPojo batchPojo) { + return "hello"; + } + + // Normal Batch Source + public List uuid(@Source List batchPojos) { + List uuids = new ArrayList<>(); + for (BatchPojo batchPojo : batchPojos) { + uuids.add(UUID.fromString("88aaea3a-a48c-46de-a675-d6f2a65a9b2" + batchPojo.id)); + } + return uuids; + } + + // Runtime Exception Source + public String runtime(@Source BatchPojo batchPojo) { + throw new RuntimeException("Some runtime exception"); + } + + // Runtime Exception Batch Source + public List runtimes(@Source List batchPojos) { + throw new RuntimeException("Some runtimes exception"); + } + + // Business Exception Source + public String business(@Source BatchPojo batchPojo) throws BusinessException { + throw new BusinessException("Some business exception"); + } + + // Business Exception Batch Source + public List businesses(@Source List batchPojos) throws BusinessException { + throw new BusinessException("Some businesses exception"); + } + +} \ No newline at end of file diff --git a/server/tck/src/test/java/io/smallrye/graphql/test/apps/batch/api/BatchPojo.java b/server/tck/src/test/java/io/smallrye/graphql/test/apps/batch/api/BatchPojo.java new file mode 100644 index 000000000..29a2e6126 --- /dev/null +++ b/server/tck/src/test/java/io/smallrye/graphql/test/apps/batch/api/BatchPojo.java @@ -0,0 +1,17 @@ +package io.smallrye.graphql.test.apps.batch.api; + +public class BatchPojo { + + public int id; + + public BatchPojo() { + } + + public BatchPojo(int id) { + this.id = id; + } + + public String getSimpleField() { + return "Some String"; + } +} \ No newline at end of file diff --git a/server/tck/src/test/java/io/smallrye/graphql/test/apps/batch/api/BusinessException.java b/server/tck/src/test/java/io/smallrye/graphql/test/apps/batch/api/BusinessException.java new file mode 100644 index 000000000..ef383014c --- /dev/null +++ b/server/tck/src/test/java/io/smallrye/graphql/test/apps/batch/api/BusinessException.java @@ -0,0 +1,24 @@ +package io.smallrye.graphql.test.apps.batch.api; + +public class BusinessException extends Exception { + + public BusinessException() { + } + + public BusinessException(String message) { + super(message); + } + + public BusinessException(String message, Throwable cause) { + super(message, cause); + } + + public BusinessException(Throwable cause) { + super(cause); + } + + public BusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } + +} \ No newline at end of file From 1d8c9a74f343833e1245f723f14bb73bee91aeed Mon Sep 17 00:00:00 2001 From: Phillip Kruger Date: Tue, 26 Jan 2021 20:56:53 +0200 Subject: [PATCH 2/3] Batch exception fix when unwrapping exception Signed-off-by:Phillip Kruger --- .../io/smallrye/graphql/bootstrap/Config.java | 8 +- .../datafetcher/AbstractDataFetcher.java | 28 -- .../CompletionStageDataFetcher.java | 2 - .../datafetcher/DefaultDataFetcher.java | 23 +- .../execution/datafetcher/UniDataFetcher.java | 3 - .../execution/error/ExceptionHandler.java | 32 ++ .../SmallRyeGraphQLArchiveProcessor.java | 2 + .../resources/tests/batch/error/input.graphql | 8 + .../resources/tests/batch/error/output.json | 336 ++++++++++++++++++ .../tests/batch/{ => error}/test.properties | 0 .../tests/batch/{ => normal}/input.graphql | 0 .../tests/batch/{ => normal}/output.json | 0 .../tests/batch/normal/test.properties | 2 + 13 files changed, 402 insertions(+), 42 deletions(-) create mode 100644 server/tck/src/test/resources/tests/batch/error/input.graphql create mode 100644 server/tck/src/test/resources/tests/batch/error/output.json rename server/tck/src/test/resources/tests/batch/{ => error}/test.properties (100%) rename server/tck/src/test/resources/tests/batch/{ => normal}/input.graphql (100%) rename server/tck/src/test/resources/tests/batch/{ => normal}/output.json (100%) create mode 100644 server/tck/src/test/resources/tests/batch/normal/test.properties diff --git a/server/implementation/src/main/java/io/smallrye/graphql/bootstrap/Config.java b/server/implementation/src/main/java/io/smallrye/graphql/bootstrap/Config.java index 01c9a861a..ae260b785 100644 --- a/server/implementation/src/main/java/io/smallrye/graphql/bootstrap/Config.java +++ b/server/implementation/src/main/java/io/smallrye/graphql/bootstrap/Config.java @@ -26,6 +26,10 @@ default Optional> getShowErrorMessageList() { return Optional.empty(); } + default Optional> getUnwrapExceptions() { + return Optional.empty(); + } + default boolean isAllowGet() { return false; } @@ -74,10 +78,6 @@ default String getFieldVisibility() { return FIELD_VISIBILITY_DEFAULT; } - default Optional> getUnwrapExceptions() { - return Optional.empty(); - } - default T getConfigValue(String key, Class type, T defaultValue) { return defaultValue; } diff --git a/server/implementation/src/main/java/io/smallrye/graphql/execution/datafetcher/AbstractDataFetcher.java b/server/implementation/src/main/java/io/smallrye/graphql/execution/datafetcher/AbstractDataFetcher.java index f954c295d..ff9b2aa06 100644 --- a/server/implementation/src/main/java/io/smallrye/graphql/execution/datafetcher/AbstractDataFetcher.java +++ b/server/implementation/src/main/java/io/smallrye/graphql/execution/datafetcher/AbstractDataFetcher.java @@ -1,9 +1,5 @@ package io.smallrye.graphql.execution.datafetcher; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.CompletionException; - import org.dataloader.BatchLoaderWithContext; import org.eclipse.microprofile.graphql.GraphQLException; @@ -38,7 +34,6 @@ public abstract class AbstractDataFetcher implements DataFetcher, Batch protected ArgumentHelper argumentHelper; protected EventEmitter eventEmitter; protected BatchLoaderHelper batchLoaderHelper; - protected List unwrapExceptions = new ArrayList<>(); public AbstractDataFetcher(Operation operation, Config config) { this.operation = operation; @@ -48,10 +43,6 @@ public AbstractDataFetcher(Operation operation, Config config) { this.argumentHelper = new ArgumentHelper(operation.getArguments()); this.partialResultHelper = new PartialResultHelper(); this.batchLoaderHelper = new BatchLoaderHelper(); - if (config != null && config.getUnwrapExceptions().isPresent()) { - this.unwrapExceptions.addAll(config.getUnwrapExceptions().get()); - } - this.unwrapExceptions.addAll(DEFAULT_EXCEPTION_UNWRAP); } @Override @@ -92,23 +83,4 @@ protected abstract T invokeAndTransform(DataFetchingEnvironment dfe, DataFet protected abstract T invokeFailure(DataFetcherResult.Builder resultBuilder); - protected Throwable unwrapThrowable(Throwable t) { - if (shouldUnwrapThrowable(t)) { - t = t.getCause(); - return unwrapThrowable(t); - } - return t; - } - - private boolean shouldUnwrapThrowable(Throwable t) { - return unwrapExceptions.contains(t.getClass().getName()) && t.getCause() != null; - } - - private static final List DEFAULT_EXCEPTION_UNWRAP = new ArrayList<>(); - - static { - DEFAULT_EXCEPTION_UNWRAP.add(CompletionException.class.getName()); - DEFAULT_EXCEPTION_UNWRAP.add("javax.ejb.EJBException"); - DEFAULT_EXCEPTION_UNWRAP.add("jakarta.ejb.EJBException"); - } } diff --git a/server/implementation/src/main/java/io/smallrye/graphql/execution/datafetcher/CompletionStageDataFetcher.java b/server/implementation/src/main/java/io/smallrye/graphql/execution/datafetcher/CompletionStageDataFetcher.java index c4b199634..3187cce2f 100644 --- a/server/implementation/src/main/java/io/smallrye/graphql/execution/datafetcher/CompletionStageDataFetcher.java +++ b/server/implementation/src/main/java/io/smallrye/graphql/execution/datafetcher/CompletionStageDataFetcher.java @@ -44,8 +44,6 @@ protected T invokeAndTransform(DataFetchingEnvironment dfe, DataFetcherResul return (T) futureResultFromMethodCall.handle((result, throwable) -> { if (throwable != null) { - throwable = unwrapThrowable(throwable); - eventEmitter.fireOnDataFetchError(dfe.getExecutionId().toString(), throwable); if (throwable instanceof GraphQLException) { GraphQLException graphQLException = (GraphQLException) throwable; diff --git a/server/implementation/src/main/java/io/smallrye/graphql/execution/datafetcher/DefaultDataFetcher.java b/server/implementation/src/main/java/io/smallrye/graphql/execution/datafetcher/DefaultDataFetcher.java index df9e6841f..6cd430d67 100644 --- a/server/implementation/src/main/java/io/smallrye/graphql/execution/datafetcher/DefaultDataFetcher.java +++ b/server/implementation/src/main/java/io/smallrye/graphql/execution/datafetcher/DefaultDataFetcher.java @@ -1,5 +1,7 @@ package io.smallrye.graphql.execution.datafetcher; +import static io.smallrye.graphql.SmallRyeGraphQLServerMessages.msg; + import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; @@ -37,8 +39,6 @@ public T invokeAndTransform(DataFetchingEnvironment dfe, DataFetcherResult.B Object resultFromTransform = fieldHelper.transformResponse(resultFromMethodCall); resultBuilder.data(resultFromTransform); return (T) resultBuilder.build(); - } catch (Exception e) { - throw (Exception) unwrapThrowable(e); } finally { SmallRyeContext.remove(); } @@ -58,10 +58,23 @@ public CompletionStage> load(List keys, BatchLoaderEnvironment ble) { ThreadContext threadContext = ThreadContext.builder().build(); try { SmallRyeContext.setContext(context); + + CompletableFuture> reflectionSupplier = CompletableFuture.supplyAsync(() -> { + try { + return (List) reflectionHelper.invokePrivileged(tccl, arguments); + } catch (Exception e) { + if (e instanceof RuntimeException && e.getCause() != null && !(e.getCause() instanceof RuntimeException)) { + throw msg.dataFetcherException(operation, e.getCause()); + } else if (e instanceof RuntimeException) { + throw (RuntimeException) e; + } else { + throw msg.dataFetcherException(operation, e); + } + } + }, threadContext.currentContextExecutor()); + return threadContext - .withContextCapture( - CompletableFuture.supplyAsync(() -> (List) reflectionHelper.invokePrivileged(tccl, arguments), - threadContext.currentContextExecutor())); + .withContextCapture(reflectionSupplier); } finally { SmallRyeContext.remove(); } diff --git a/server/implementation/src/main/java/io/smallrye/graphql/execution/datafetcher/UniDataFetcher.java b/server/implementation/src/main/java/io/smallrye/graphql/execution/datafetcher/UniDataFetcher.java index fa410ef38..9f2ea34fb 100644 --- a/server/implementation/src/main/java/io/smallrye/graphql/execution/datafetcher/UniDataFetcher.java +++ b/server/implementation/src/main/java/io/smallrye/graphql/execution/datafetcher/UniDataFetcher.java @@ -41,7 +41,6 @@ protected T invokeAndTransform(DataFetchingEnvironment dfe, DataFetcherResul .onItemOrFailure().transform((result, throwable) -> { if (throwable != null) { - throwable = unwrapThrowable(throwable); eventEmitter.fireOnDataFetchError(dfe.getExecutionId().toString(), throwable); if (throwable instanceof GraphQLException) { GraphQLException graphQLException = (GraphQLException) throwable; @@ -61,8 +60,6 @@ protected T invokeAndTransform(DataFetchingEnvironment dfe, DataFetcherResul return resultBuilder.build(); }).runSubscriptionOn(Infrastructure.getDefaultExecutor()).subscribe().asCompletionStage(); - } catch (Exception e) { - throw (Exception) unwrapThrowable(e); } finally { SmallRyeContext.remove(); } diff --git a/server/implementation/src/main/java/io/smallrye/graphql/execution/error/ExceptionHandler.java b/server/implementation/src/main/java/io/smallrye/graphql/execution/error/ExceptionHandler.java index 261d05b38..393cecb0f 100644 --- a/server/implementation/src/main/java/io/smallrye/graphql/execution/error/ExceptionHandler.java +++ b/server/implementation/src/main/java/io/smallrye/graphql/execution/error/ExceptionHandler.java @@ -2,6 +2,10 @@ import static io.smallrye.graphql.SmallRyeGraphQLServerLogging.log; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CompletionException; + import graphql.ExceptionWhileDataFetching; import graphql.execution.DataFetcherExceptionHandler; import graphql.execution.DataFetcherExceptionHandlerParameters; @@ -9,6 +13,7 @@ import graphql.execution.ResultPath; import graphql.language.SourceLocation; import io.smallrye.graphql.bootstrap.Config; +import io.smallrye.graphql.execution.datafetcher.DataFetcherException; /** * Here we have the ability to mask certain messages to the client (for security reasons) @@ -19,15 +24,21 @@ public class ExceptionHandler implements DataFetcherExceptionHandler { private final Config config; private final ExceptionLists exceptionLists; + protected List unwrapExceptions = new ArrayList<>(); public ExceptionHandler(Config config) { this.config = config; this.exceptionLists = new ExceptionLists(config.getHideErrorMessageList(), config.getShowErrorMessageList()); + if (config.getUnwrapExceptions().isPresent()) { + this.unwrapExceptions.addAll(config.getUnwrapExceptions().get()); + } + this.unwrapExceptions.addAll(DEFAULT_EXCEPTION_UNWRAP); } @Override public DataFetcherExceptionHandlerResult onException(DataFetcherExceptionHandlerParameters handlerParameters) { Throwable throwable = handlerParameters.getException(); + throwable = unwrapThrowable(throwable); SourceLocation sourceLocation = handlerParameters.getSourceLocation(); ResultPath path = handlerParameters.getPath(); ExceptionWhileDataFetching error = getExceptionWhileDataFetching(throwable, sourceLocation, path); @@ -57,4 +68,25 @@ private ExceptionWhileDataFetching getExceptionWhileDataFetching(Throwable throw } } } + + private Throwable unwrapThrowable(Throwable t) { + if (shouldUnwrapThrowable(t)) { + t = t.getCause(); + return unwrapThrowable(t); + } + return t; + } + + private boolean shouldUnwrapThrowable(Throwable t) { + return unwrapExceptions.contains(t.getClass().getName()) && t.getCause() != null; + } + + private static final List DEFAULT_EXCEPTION_UNWRAP = new ArrayList<>(); + + static { + DEFAULT_EXCEPTION_UNWRAP.add(CompletionException.class.getName()); + DEFAULT_EXCEPTION_UNWRAP.add(DataFetcherException.class.getName()); + DEFAULT_EXCEPTION_UNWRAP.add("javax.ejb.EJBException"); + DEFAULT_EXCEPTION_UNWRAP.add("jakarta.ejb.EJBException"); + } } diff --git a/server/tck/src/test/java/io/smallrye/graphql/SmallRyeGraphQLArchiveProcessor.java b/server/tck/src/test/java/io/smallrye/graphql/SmallRyeGraphQLArchiveProcessor.java index aa53f8d62..382adce41 100644 --- a/server/tck/src/test/java/io/smallrye/graphql/SmallRyeGraphQLArchiveProcessor.java +++ b/server/tck/src/test/java/io/smallrye/graphql/SmallRyeGraphQLArchiveProcessor.java @@ -12,6 +12,7 @@ import org.jboss.shrinkwrap.resolver.api.maven.Maven; import io.smallrye.graphql.test.apps.async.api.AsyncApi; +import io.smallrye.graphql.test.apps.batch.api.BatchApi; import io.smallrye.graphql.test.apps.context.api.ContextApi; import io.smallrye.graphql.test.apps.defaultvalue.api.DefaultValueParrotAPI; import io.smallrye.graphql.test.apps.error.api.ErrorApi; @@ -86,6 +87,7 @@ public void process(Archive applicationArchive, TestClass testClass) { war.addPackage(MutinyApi.class.getPackage()); war.addPackage(ContextApi.class.getPackage()); war.addPackage(JsonPApi.class.getPackage()); + war.addPackage(BatchApi.class.getPackage()); System.out.println(war.toString(true)); } diff --git a/server/tck/src/test/resources/tests/batch/error/input.graphql b/server/tck/src/test/resources/tests/batch/error/input.graphql new file mode 100644 index 000000000..727571cc8 --- /dev/null +++ b/server/tck/src/test/resources/tests/batch/error/input.graphql @@ -0,0 +1,8 @@ +{ + batchPojos{ + business + runtime + businesses + runtimes + } +} \ No newline at end of file diff --git a/server/tck/src/test/resources/tests/batch/error/output.json b/server/tck/src/test/resources/tests/batch/error/output.json new file mode 100644 index 000000000..73722fc55 --- /dev/null +++ b/server/tck/src/test/resources/tests/batch/error/output.json @@ -0,0 +1,336 @@ +{ + "errors": [ + { + "message": "Some business exception", + "locations": [ + { + "line": 3, + "column": 5 + } + ], + "path": [ + "batchPojos", + 0, + "business" + ], + "extensions": { + "exception": "io.smallrye.graphql.test.apps.batch.api.BusinessException", + "classification": "DataFetchingException", + "code": "business" + } + }, + { + "message": "Unexpected failure in the system. Jarvis is working to fix it.", + "locations": [ + { + "line": 4, + "column": 5 + } + ], + "path": [ + "batchPojos", + 0, + "runtime" + ], + "extensions": { + "exception": "java.lang.RuntimeException", + "classification": "DataFetchingException", + "code": "runtime" + } + }, + { + "message": "Some business exception", + "locations": [ + { + "line": 3, + "column": 5 + } + ], + "path": [ + "batchPojos", + 1, + "business" + ], + "extensions": { + "exception": "io.smallrye.graphql.test.apps.batch.api.BusinessException", + "classification": "DataFetchingException", + "code": "business" + } + }, + { + "message": "Unexpected failure in the system. Jarvis is working to fix it.", + "locations": [ + { + "line": 4, + "column": 5 + } + ], + "path": [ + "batchPojos", + 1, + "runtime" + ], + "extensions": { + "exception": "java.lang.RuntimeException", + "classification": "DataFetchingException", + "code": "runtime" + } + }, + { + "message": "Some business exception", + "locations": [ + { + "line": 3, + "column": 5 + } + ], + "path": [ + "batchPojos", + 2, + "business" + ], + "extensions": { + "exception": "io.smallrye.graphql.test.apps.batch.api.BusinessException", + "classification": "DataFetchingException", + "code": "business" + } + }, + { + "message": "Unexpected failure in the system. Jarvis is working to fix it.", + "locations": [ + { + "line": 4, + "column": 5 + } + ], + "path": [ + "batchPojos", + 2, + "runtime" + ], + "extensions": { + "exception": "java.lang.RuntimeException", + "classification": "DataFetchingException", + "code": "runtime" + } + }, + { + "message": "Some business exception", + "locations": [ + { + "line": 3, + "column": 5 + } + ], + "path": [ + "batchPojos", + 3, + "business" + ], + "extensions": { + "exception": "io.smallrye.graphql.test.apps.batch.api.BusinessException", + "classification": "DataFetchingException", + "code": "business" + } + }, + { + "message": "Unexpected failure in the system. Jarvis is working to fix it.", + "locations": [ + { + "line": 4, + "column": 5 + } + ], + "path": [ + "batchPojos", + 3, + "runtime" + ], + "extensions": { + "exception": "java.lang.RuntimeException", + "classification": "DataFetchingException", + "code": "runtime" + } + }, + { + "message": "Some businesses exception", + "locations": [ + { + "line": 5, + "column": 5 + } + ], + "path": [ + "batchPojos", + 0, + "businesses" + ], + "extensions": { + "exception": "io.smallrye.graphql.test.apps.batch.api.BusinessException", + "classification": "DataFetchingException", + "code": "business" + } + }, + { + "message": "Some businesses exception", + "locations": [ + { + "line": 5, + "column": 5 + } + ], + "path": [ + "batchPojos", + 1, + "businesses" + ], + "extensions": { + "exception": "io.smallrye.graphql.test.apps.batch.api.BusinessException", + "classification": "DataFetchingException", + "code": "business" + } + }, + { + "message": "Some businesses exception", + "locations": [ + { + "line": 5, + "column": 5 + } + ], + "path": [ + "batchPojos", + 2, + "businesses" + ], + "extensions": { + "exception": "io.smallrye.graphql.test.apps.batch.api.BusinessException", + "classification": "DataFetchingException", + "code": "business" + } + }, + { + "message": "Some businesses exception", + "locations": [ + { + "line": 5, + "column": 5 + } + ], + "path": [ + "batchPojos", + 3, + "businesses" + ], + "extensions": { + "exception": "io.smallrye.graphql.test.apps.batch.api.BusinessException", + "classification": "DataFetchingException", + "code": "business" + } + }, + { + "message": "Unexpected failure in the system. Jarvis is working to fix it.", + "locations": [ + { + "line": 6, + "column": 5 + } + ], + "path": [ + "batchPojos", + 0, + "runtimes" + ], + "extensions": { + "exception": "java.lang.RuntimeException", + "classification": "DataFetchingException", + "code": "runtime" + } + }, + { + "message": "Unexpected failure in the system. Jarvis is working to fix it.", + "locations": [ + { + "line": 6, + "column": 5 + } + ], + "path": [ + "batchPojos", + 1, + "runtimes" + ], + "extensions": { + "exception": "java.lang.RuntimeException", + "classification": "DataFetchingException", + "code": "runtime" + } + }, + { + "message": "Unexpected failure in the system. Jarvis is working to fix it.", + "locations": [ + { + "line": 6, + "column": 5 + } + ], + "path": [ + "batchPojos", + 2, + "runtimes" + ], + "extensions": { + "exception": "java.lang.RuntimeException", + "classification": "DataFetchingException", + "code": "runtime" + } + }, + { + "message": "Unexpected failure in the system. Jarvis is working to fix it.", + "locations": [ + { + "line": 6, + "column": 5 + } + ], + "path": [ + "batchPojos", + 3, + "runtimes" + ], + "extensions": { + "exception": "java.lang.RuntimeException", + "classification": "DataFetchingException", + "code": "runtime" + } + } + ], + "data": { + "batchPojos": [ + { + "business": null, + "runtime": null, + "businesses": null, + "runtimes": null + }, + { + "business": null, + "runtime": null, + "businesses": null, + "runtimes": null + }, + { + "business": null, + "runtime": null, + "businesses": null, + "runtimes": null + }, + { + "business": null, + "runtime": null, + "businesses": null, + "runtimes": null + } + ] + } +} \ No newline at end of file diff --git a/server/tck/src/test/resources/tests/batch/test.properties b/server/tck/src/test/resources/tests/batch/error/test.properties similarity index 100% rename from server/tck/src/test/resources/tests/batch/test.properties rename to server/tck/src/test/resources/tests/batch/error/test.properties diff --git a/server/tck/src/test/resources/tests/batch/input.graphql b/server/tck/src/test/resources/tests/batch/normal/input.graphql similarity index 100% rename from server/tck/src/test/resources/tests/batch/input.graphql rename to server/tck/src/test/resources/tests/batch/normal/input.graphql diff --git a/server/tck/src/test/resources/tests/batch/output.json b/server/tck/src/test/resources/tests/batch/normal/output.json similarity index 100% rename from server/tck/src/test/resources/tests/batch/output.json rename to server/tck/src/test/resources/tests/batch/normal/output.json diff --git a/server/tck/src/test/resources/tests/batch/normal/test.properties b/server/tck/src/test/resources/tests/batch/normal/test.properties new file mode 100644 index 000000000..db74c7f9b --- /dev/null +++ b/server/tck/src/test/resources/tests/batch/normal/test.properties @@ -0,0 +1,2 @@ +ignore=false +priority=100 From 5a299b1ef6f17a4b68fb393d451c468ed5420dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phillip=20Kr=C3=BCger?= Date: Fri, 29 Jan 2021 10:48:59 +0200 Subject: [PATCH 3/3] Update server/tck/src/test/java/io/smallrye/graphql/test/apps/batch/api/BatchApi.java MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: RĂ¼diger zu Dohna --- .../io/smallrye/graphql/test/apps/batch/api/BatchApi.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/tck/src/test/java/io/smallrye/graphql/test/apps/batch/api/BatchApi.java b/server/tck/src/test/java/io/smallrye/graphql/test/apps/batch/api/BatchApi.java index 9f18ba09e..0f458fe0b 100644 --- a/server/tck/src/test/java/io/smallrye/graphql/test/apps/batch/api/BatchApi.java +++ b/server/tck/src/test/java/io/smallrye/graphql/test/apps/batch/api/BatchApi.java @@ -23,7 +23,7 @@ public List batchPojos() { return l; } - // Nornal Source + // Normal Source public String greeting(@Source BatchPojo batchPojo) { return "hello"; } @@ -57,4 +57,4 @@ public List businesses(@Source List batchPojos) throws Busine throw new BusinessException("Some businesses exception"); } -} \ No newline at end of file +}