From dc5cd6ac5496b8cccfb46861b48ac820c27e7b28 Mon Sep 17 00:00:00 2001 From: Kaan Arik Date: Mon, 2 Feb 2026 12:15:31 +1300 Subject: [PATCH 1/4] bug Support record types implementing sealed interfaces --- .../graphql/builder/TypeBuilder.java | 39 ++++++++++-------- .../phocassoftware/graphql/builder/.DS_Store | Bin 0 -> 6148 bytes .../graphql/builder/RecordTest.java | 18 +++++++- .../builder/record/AnimalInterface.java | 24 +++++++++++ .../graphql/builder/record/CatRecord.java | 13 ++++++ .../graphql/builder/record/DogRecord.java | 14 +++++++ .../graphql/builder/record/Queries.java | 13 +++++- 7 files changed, 101 insertions(+), 20 deletions(-) create mode 100644 graphql-builder/src/test/java/com/phocassoftware/graphql/builder/.DS_Store create mode 100644 graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/AnimalInterface.java create mode 100644 graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/CatRecord.java create mode 100644 graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/DogRecord.java diff --git a/graphql-builder/src/main/java/com/phocassoftware/graphql/builder/TypeBuilder.java b/graphql-builder/src/main/java/com/phocassoftware/graphql/builder/TypeBuilder.java index a57e1af2..27f14c69 100644 --- a/graphql-builder/src/main/java/com/phocassoftware/graphql/builder/TypeBuilder.java +++ b/graphql-builder/src/main/java/com/phocassoftware/graphql/builder/TypeBuilder.java @@ -197,34 +197,37 @@ public Record(EntityProcessor entityProcessor, TypeMeta meta) { @Override protected void processFields(String typeName, Builder graphType, graphql.schema.GraphQLInterfaceType.Builder interfaceBuilder) { var type = meta.getType(); - - var methods = Arrays - .stream(type.getDeclaredFields()) + + var fieldsByName = Arrays.stream(type.getDeclaredFields()) .filter(field -> !field.isSynthetic()) - .filter(field -> !field.getDeclaringClass().equals(Object.class)) - .filter(field -> !field.isAnnotationPresent(GraphQLIgnore.class)) - .filter(field -> !Modifier.isAbstract(field.getModifiers())) - .filter(field -> !field.getDeclaringClass().isInterface()) .filter(field -> !Modifier.isStatic(field.getModifiers())) - .toList(); + .collect(java.util.stream.Collectors.toMap(f -> f.getName(), f -> f, (a, b) -> a)); var duplicateMethodNames = new HashSet(); - methods.forEach(field -> { - try { - var method = type.getMethod(field.getName()); - if (method.isAnnotationPresent(GraphQLIgnore.class)) return; - var name = EntityUtil.getName(field.getName(), field, method); + Arrays.stream(type.getMethods()) + .filter(method -> !method.isSynthetic()) + .filter(method -> !method.getDeclaringClass().equals(Object.class)) + .filter(method -> !method.isAnnotationPresent(GraphQLIgnore.class)) + .filter(method -> !Modifier.isStatic(method.getModifiers())) + .filter(method -> method.getParameterCount() == 0) + .filter(method -> !method.getReturnType().equals(void.class)) + .filter(method -> !method.getName().startsWith("get") && !method.getName().startsWith("is")) + .forEach(method -> { + var field = fieldsByName.get(method.getName()); + if (field != null && field.isAnnotationPresent(GraphQLIgnore.class)) { + return; + } + var name = field != null + ? EntityUtil.getName(field.getName(), field, method) + : method.getName(); if (!duplicateMethodNames.add(name)) { - throw new DuplicateMethodNameException(typeName, name); + return; } var f = entityProcessor.getMethodProcessor().process(null, FieldCoordinates.coordinates(typeName, name), meta, method); graphType.field(f); interfaceBuilder.field(f); - } catch (NoSuchMethodException e) { - throw new RuntimeException("Failed to process method " + field, e); - } - }); + }); } } } diff --git a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/.DS_Store b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..ed2f4996cb54d29c31ac1d4f40ae742d5369d89e GIT binary patch literal 6148 zcmeHK%}&BV5S|5;A~E5h3CAX0Ndy!VkIiLK94iI zi;;i_FUH7BGW*TWPdEFu+35m+a3?_npaK9EDq*gK!y2JD>5Alxhft_zNC@B@#?Xgk zC7T_8kpX&lJ1~SEq%eRl@6VqmBR`Tp#^3x=6eelC{w{L)!q#@tDq3ah!5he_mv+-h z;&#V(G`p5E@)vg3zX^NOPG#>x#%VWPgGAMOI$)KoQm0a# z&04KS%|33n<~4hE+N`5}bTXfpto?(-v#ZWiG>qkoCRE_Jr)1aQ0$$NrySHa=97i(l zV|-D&s9|IVm;q*B6BsaOpH<$3&GH_Z0cPMw4AA*tqY^p>GmYx#z=3`rDPABXL7VOp zgtkG)V5SixC_QZ5@7($n$-!^%U!Azqr2ccHR=a`j+xuFQPI{Iyu4#LsMBQwAZ zEHjYT(+c(f%kS_1%SAk62AF|=#egWZy|#;6GQD+WbJS~X)JIej%F8r response.getErrors().toString()); + Map>> data = response.getData(); + var results = data.get("recordInheritanceTest"); + assertEquals(2, results.size()); + assertEquals(Map.of("name", "Lola", "somethingToDoWithDogs", "LikesBones", "type", "Dog"), results.get(0)); + assertEquals(Map.of("name", "Mavi", "somethingToDoWithCats", "LikesCheese", "type", "Cat"), results.get(1)); + } + + @Test public void testEntireContext() { - var type = Map.of("name", "foo", "age", 4); + var type = Map.of( + "name", "foo", + "age", 4 + ); Map> response = execute( "query passthrough($type: InputTypeInput!){passthrough(type: $type) {name age weight}} ", Map.of("type", type) diff --git a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/AnimalInterface.java b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/AnimalInterface.java new file mode 100644 index 00000000..bbf2d4f3 --- /dev/null +++ b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/AnimalInterface.java @@ -0,0 +1,24 @@ +package com.phocassoftware.graphql.builder.record; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.Optional; + +import com.fasterxml.jackson.annotation.JsonSubTypes; + + +@JsonSubTypes({ + @JsonSubTypes.Type(value = CatRecord.class, name = "Cat"), + @JsonSubTypes.Type(value = DogRecord.class, name = "Dog"), +}) +public sealed interface AnimalInterface + permits CatRecord, DogRecord { + + String name(); + Optional description(); + AnimalType type(); + + enum AnimalType { + @JsonProperty("Cat") Cat, + @JsonProperty("Dog") Dog + } +} diff --git a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/CatRecord.java b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/CatRecord.java new file mode 100644 index 00000000..c0357151 --- /dev/null +++ b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/CatRecord.java @@ -0,0 +1,13 @@ +package com.phocassoftware.graphql.builder.record; + +import java.util.Optional; + +public record CatRecord( + String name, + String somethingToDoWithCats, + Optional description +) implements AnimalInterface { + public AnimalType type() { + return AnimalType.Cat; + } +} \ No newline at end of file diff --git a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/DogRecord.java b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/DogRecord.java new file mode 100644 index 00000000..3ff4ad2f --- /dev/null +++ b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/DogRecord.java @@ -0,0 +1,14 @@ +package com.phocassoftware.graphql.builder.record; + +import java.util.Optional; + +public record DogRecord( + String name, + String somethingToDoWithDogs, + Optional description +) implements AnimalInterface { + @Override + public AnimalType type() { + return AnimalType.Dog; + } +} \ No newline at end of file diff --git a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/Queries.java b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/Queries.java index 51ba846c..272e05e9 100644 --- a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/Queries.java +++ b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/Queries.java @@ -14,6 +14,8 @@ import com.phocassoftware.graphql.builder.annotations.GraphQLDescription; import com.phocassoftware.graphql.builder.annotations.InnerNullable; import com.phocassoftware.graphql.builder.annotations.Query; +import com.phocassoftware.graphql.builder.annotations.Union; + import java.util.List; import java.util.Optional; import javax.annotation.Nullable; @@ -48,6 +50,15 @@ public static List> nullableInnerArrayTest(List recordInheritanceTest() { + return List.of(new DogRecord("Lola", "LikesBones", Optional.of("fluffy")), new CatRecord("Mavi", "LikesCheese", Optional.of("Angry"))); + } + @GraphQLDescription("record Type") - static final record InputType(@GraphQLDescription("the name") String name, int age, Optional weight) {} + static final record InputType( + @GraphQLDescription("the name") String name, + int age, + Optional weight) {} } From c5818f437d2c2441760019dd7f0e5ece3bd3ed38 Mon Sep 17 00:00:00 2001 From: Kaan Arik Date: Mon, 2 Feb 2026 12:16:50 +1300 Subject: [PATCH 2/4] format --- .../graphql/builder/TypeBuilder.java | 8 +++--- .../graphql/builder/RecordTest.java | 18 ++++++++----- .../builder/record/AnimalInterface.java | 26 +++++++++++-------- .../graphql/builder/record/CatRecord.java | 12 ++++----- .../graphql/builder/record/DogRecord.java | 14 +++++----- .../graphql/builder/record/Queries.java | 5 ++-- 6 files changed, 47 insertions(+), 36 deletions(-) diff --git a/graphql-builder/src/main/java/com/phocassoftware/graphql/builder/TypeBuilder.java b/graphql-builder/src/main/java/com/phocassoftware/graphql/builder/TypeBuilder.java index 27f14c69..c840a4ff 100644 --- a/graphql-builder/src/main/java/com/phocassoftware/graphql/builder/TypeBuilder.java +++ b/graphql-builder/src/main/java/com/phocassoftware/graphql/builder/TypeBuilder.java @@ -197,15 +197,17 @@ public Record(EntityProcessor entityProcessor, TypeMeta meta) { @Override protected void processFields(String typeName, Builder graphType, graphql.schema.GraphQLInterfaceType.Builder interfaceBuilder) { var type = meta.getType(); - - var fieldsByName = Arrays.stream(type.getDeclaredFields()) + + var fieldsByName = Arrays + .stream(type.getDeclaredFields()) .filter(field -> !field.isSynthetic()) .filter(field -> !Modifier.isStatic(field.getModifiers())) .collect(java.util.stream.Collectors.toMap(f -> f.getName(), f -> f, (a, b) -> a)); var duplicateMethodNames = new HashSet(); - Arrays.stream(type.getMethods()) + Arrays + .stream(type.getMethods()) .filter(method -> !method.isSynthetic()) .filter(method -> !method.getDeclaringClass().equals(Object.class)) .filter(method -> !method.isAnnotationPresent(GraphQLIgnore.class)) diff --git a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/RecordTest.java b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/RecordTest.java index 1ed4a071..0a6a562c 100644 --- a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/RecordTest.java +++ b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/RecordTest.java @@ -30,10 +30,12 @@ //does not test all of records as needs newer version of java. But Classes that look like records public class RecordTest { - @Test public void testRecordInheritance() { - var response = execute("query { recordInheritanceTest { ... on CatRecord { name, somethingToDoWithCats, type } ... on DogRecord { name, somethingToDoWithDogs, type } } }", null); + var response = execute( + "query { recordInheritanceTest { ... on CatRecord { name, somethingToDoWithCats, type } ... on DogRecord { name, somethingToDoWithDogs, type } } }", + null + ); assertTrue(response.getErrors().isEmpty(), () -> response.getErrors().toString()); Map>> data = response.getData(); var results = data.get("recordInheritanceTest"); @@ -42,13 +44,15 @@ public void testRecordInheritance() { assertEquals(Map.of("name", "Mavi", "somethingToDoWithCats", "LikesCheese", "type", "Cat"), results.get(1)); } - @Test public void testEntireContext() { - var type = Map.of( - "name", "foo", - "age", 4 - ); + var type = Map + .of( + "name", + "foo", + "age", + 4 + ); Map> response = execute( "query passthrough($type: InputTypeInput!){passthrough(type: $type) {name age weight}} ", Map.of("type", type) diff --git a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/AnimalInterface.java b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/AnimalInterface.java index bbf2d4f3..fcb1c908 100644 --- a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/AnimalInterface.java +++ b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/AnimalInterface.java @@ -1,24 +1,28 @@ package com.phocassoftware.graphql.builder.record; + import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Optional; import com.fasterxml.jackson.annotation.JsonSubTypes; - @JsonSubTypes({ - @JsonSubTypes.Type(value = CatRecord.class, name = "Cat"), - @JsonSubTypes.Type(value = DogRecord.class, name = "Dog"), + @JsonSubTypes.Type(value = CatRecord.class, name = "Cat"), + @JsonSubTypes.Type(value = DogRecord.class, name = "Dog"), }) public sealed interface AnimalInterface - permits CatRecord, DogRecord { + permits CatRecord, DogRecord { + + String name(); + + Optional description(); - String name(); - Optional description(); - AnimalType type(); + AnimalType type(); - enum AnimalType { - @JsonProperty("Cat") Cat, - @JsonProperty("Dog") Dog - } + enum AnimalType { + @JsonProperty("Cat") + Cat, + @JsonProperty("Dog") + Dog + } } diff --git a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/CatRecord.java b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/CatRecord.java index c0357151..7da917a4 100644 --- a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/CatRecord.java +++ b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/CatRecord.java @@ -3,11 +3,11 @@ import java.util.Optional; public record CatRecord( - String name, - String somethingToDoWithCats, - Optional description + String name, + String somethingToDoWithCats, + Optional description ) implements AnimalInterface { - public AnimalType type() { - return AnimalType.Cat; - } + public AnimalType type() { + return AnimalType.Cat; + } } \ No newline at end of file diff --git a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/DogRecord.java b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/DogRecord.java index 3ff4ad2f..5a20020f 100644 --- a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/DogRecord.java +++ b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/DogRecord.java @@ -3,12 +3,12 @@ import java.util.Optional; public record DogRecord( - String name, - String somethingToDoWithDogs, - Optional description + String name, + String somethingToDoWithDogs, + Optional description ) implements AnimalInterface { - @Override - public AnimalType type() { - return AnimalType.Dog; - } + @Override + public AnimalType type() { + return AnimalType.Dog; + } } \ No newline at end of file diff --git a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/Queries.java b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/Queries.java index 272e05e9..37078e52 100644 --- a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/Queries.java +++ b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/Queries.java @@ -59,6 +59,7 @@ public static List recordInheritanceTest() { @GraphQLDescription("record Type") static final record InputType( @GraphQLDescription("the name") String name, - int age, - Optional weight) {} + int age, + Optional weight + ) {} } From 58a2d0d12e58c9989aee606987bf9ed338d430cb Mon Sep 17 00:00:00 2001 From: Kaan Arik Date: Mon, 2 Feb 2026 12:18:50 +1300 Subject: [PATCH 3/4] licence --- .../graphql/builder/record/AnimalInterface.java | 11 +++++++++++ .../graphql/builder/record/CatRecord.java | 11 +++++++++++ .../graphql/builder/record/DogRecord.java | 11 +++++++++++ 3 files changed, 33 insertions(+) diff --git a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/AnimalInterface.java b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/AnimalInterface.java index fcb1c908..5ee5ca87 100644 --- a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/AnimalInterface.java +++ b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/AnimalInterface.java @@ -1,3 +1,14 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ package com.phocassoftware.graphql.builder.record; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/CatRecord.java b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/CatRecord.java index 7da917a4..4bd0f2ea 100644 --- a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/CatRecord.java +++ b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/CatRecord.java @@ -1,3 +1,14 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ package com.phocassoftware.graphql.builder.record; import java.util.Optional; diff --git a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/DogRecord.java b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/DogRecord.java index 5a20020f..52fb36de 100644 --- a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/DogRecord.java +++ b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/DogRecord.java @@ -1,3 +1,14 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ package com.phocassoftware.graphql.builder.record; import java.util.Optional; From 3cc500336817cd3294229f36119758b2474d651b Mon Sep 17 00:00:00 2001 From: Kaan Arik Date: Mon, 2 Feb 2026 17:53:08 +1300 Subject: [PATCH 4/4] review changes --- .../java/com/phocassoftware/graphql/builder/TypeBuilder.java | 3 +-- .../java/com/phocassoftware/graphql/builder/RecordTest.java | 4 ++-- .../com/phocassoftware/graphql/builder/record/CatRecord.java | 4 ++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/graphql-builder/src/main/java/com/phocassoftware/graphql/builder/TypeBuilder.java b/graphql-builder/src/main/java/com/phocassoftware/graphql/builder/TypeBuilder.java index c840a4ff..f787200b 100644 --- a/graphql-builder/src/main/java/com/phocassoftware/graphql/builder/TypeBuilder.java +++ b/graphql-builder/src/main/java/com/phocassoftware/graphql/builder/TypeBuilder.java @@ -212,7 +212,6 @@ protected void processFields(String typeName, Builder graphType, graphql.schema. .filter(method -> !method.getDeclaringClass().equals(Object.class)) .filter(method -> !method.isAnnotationPresent(GraphQLIgnore.class)) .filter(method -> !Modifier.isStatic(method.getModifiers())) - .filter(method -> method.getParameterCount() == 0) .filter(method -> !method.getReturnType().equals(void.class)) .filter(method -> !method.getName().startsWith("get") && !method.getName().startsWith("is")) .forEach(method -> { @@ -224,7 +223,7 @@ protected void processFields(String typeName, Builder graphType, graphql.schema. ? EntityUtil.getName(field.getName(), field, method) : method.getName(); if (!duplicateMethodNames.add(name)) { - return; + throw new DuplicateMethodNameException(typeName, name); } var f = entityProcessor.getMethodProcessor().process(null, FieldCoordinates.coordinates(typeName, name), meta, method); graphType.field(f); diff --git a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/RecordTest.java b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/RecordTest.java index 0a6a562c..165cc659 100644 --- a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/RecordTest.java +++ b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/RecordTest.java @@ -33,7 +33,7 @@ public class RecordTest { @Test public void testRecordInheritance() { var response = execute( - "query { recordInheritanceTest { ... on CatRecord { name, somethingToDoWithCats, type } ... on DogRecord { name, somethingToDoWithDogs, type } } }", + "query { recordInheritanceTest { ... on CatRecord { name, somethingToDoWithCats, type, greet(greeting: \"Hello\") } ... on DogRecord { name, somethingToDoWithDogs, type } } }", null ); assertTrue(response.getErrors().isEmpty(), () -> response.getErrors().toString()); @@ -41,7 +41,7 @@ public void testRecordInheritance() { var results = data.get("recordInheritanceTest"); assertEquals(2, results.size()); assertEquals(Map.of("name", "Lola", "somethingToDoWithDogs", "LikesBones", "type", "Dog"), results.get(0)); - assertEquals(Map.of("name", "Mavi", "somethingToDoWithCats", "LikesCheese", "type", "Cat"), results.get(1)); + assertEquals(Map.of("name", "Mavi", "somethingToDoWithCats", "LikesCheese", "type", "Cat", "greet", "Hello Mavi"), results.get(1)); } @Test diff --git a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/CatRecord.java b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/CatRecord.java index 4bd0f2ea..35ce3bb8 100644 --- a/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/CatRecord.java +++ b/graphql-builder/src/test/java/com/phocassoftware/graphql/builder/record/CatRecord.java @@ -21,4 +21,8 @@ public record CatRecord( public AnimalType type() { return AnimalType.Cat; } + + public String greet(String greeting) { + return greeting + " " + name; + } } \ No newline at end of file