diff --git a/server/implementation/src/main/java/io/smallrye/graphql/execution/datafetcher/helper/ArgumentHelper.java b/server/implementation/src/main/java/io/smallrye/graphql/execution/datafetcher/helper/ArgumentHelper.java index a209037f7..35bbaa1b2 100644 --- a/server/implementation/src/main/java/io/smallrye/graphql/execution/datafetcher/helper/ArgumentHelper.java +++ b/server/implementation/src/main/java/io/smallrye/graphql/execution/datafetcher/helper/ArgumentHelper.java @@ -423,7 +423,7 @@ private List handleList(List list, Field field) { if (item instanceof Map) { result.add(includeNullCreatorParameters((Map) item, field)); } else { - // can this ever happen? + result.add(item); } }); return result; diff --git a/server/integration-tests-jdk16/src/test/java/io/smallrye/graphql/tests/records/RecordTest.java b/server/integration-tests-jdk16/src/test/java/io/smallrye/graphql/tests/records/RecordTest.java index 512361e02..ab61b0389 100644 --- a/server/integration-tests-jdk16/src/test/java/io/smallrye/graphql/tests/records/RecordTest.java +++ b/server/integration-tests-jdk16/src/test/java/io/smallrye/graphql/tests/records/RecordTest.java @@ -18,6 +18,7 @@ import javax.json.bind.annotation.JsonbCreator; import java.net.URL; +import java.util.Set; import static io.smallrye.graphql.client.core.Argument.arg; import static io.smallrye.graphql.client.core.Argument.args; @@ -68,14 +69,23 @@ public void testSimpleRecordWithFactory() throws Exception { Document query = document(operation( field("simpleWithFactory", args(arg("input", - inputObject(prop("a", "a"), prop("b", "b")))), + inputObject(prop("a", "a"), + prop("b", "b"), + prop("c", new String[] { "c", "cc" }), + prop("d", new String[] { "d", "dd" })))), field("a"), - field("b")))); + field("b"), + field("c"), + field("d")))); Response response = client.executeSync(query); System.out.println(response); System.out.println("query.build() = " + query.build()); assertEquals("a", response.getData().getJsonObject("simpleWithFactory").getString("a")); assertEquals("b", response.getData().getJsonObject("simpleWithFactory").getString("b")); + assertEquals("c", response.getData().getJsonObject("simpleWithFactory").getJsonArray("c").getString(0)); + assertEquals("cc", response.getData().getJsonObject("simpleWithFactory").getJsonArray("c").getString(1)); + assertEquals("dd", response.getData().getJsonObject("simpleWithFactory").getJsonArray("d").getString(0)); + assertEquals("d", response.getData().getJsonObject("simpleWithFactory").getJsonArray("d").getString(1)); } } @@ -106,11 +116,11 @@ public record SimpleRecord(String a, String b) { } - public record SimpleRecordWithFactory(String a, String b) { + public record SimpleRecordWithFactory(String a, String b, String[] c, Set d) { @JsonbCreator - public static SimpleRecordWithFactory build(String a, String b) { - return new SimpleRecordWithFactory(a, b); + public static SimpleRecordWithFactory build(String a, String b, String[] c, Set d) { + return new SimpleRecordWithFactory(a, b, c, d); } }