This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-3676
in repository https://gitbox.apache.org/repos/asf/causeway.git


The following commit(s) were added to refs/heads/CAUSEWAY-3676 by this push:
     new 30dcca2a87 CAUSEWAY-3676: fleshing out GqlvServiceStructure (2)
30dcca2a87 is described below

commit 30dcca2a87904813f1a38a4bb58616dda53d0099
Author: danhaywood <[email protected]>
AuthorDate: Fri Jan 19 17:01:16 2024 +0000

    CAUSEWAY-3676: fleshing out GqlvServiceStructure (2)
---
 .../viewer/graphql/viewer/source/QueryFieldFactory.java       | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git 
a/incubator/viewers/graphql/viewer/src/main/java/org/apache/causeway/viewer/graphql/viewer/source/QueryFieldFactory.java
 
b/incubator/viewers/graphql/viewer/src/main/java/org/apache/causeway/viewer/graphql/viewer/source/QueryFieldFactory.java
index 34f406bc0a..43945ccbe8 100644
--- 
a/incubator/viewers/graphql/viewer/src/main/java/org/apache/causeway/viewer/graphql/viewer/source/QueryFieldFactory.java
+++ 
b/incubator/viewers/graphql/viewer/src/main/java/org/apache/causeway/viewer/graphql/viewer/source/QueryFieldFactory.java
@@ -94,12 +94,11 @@ public class QueryFieldFactory {
                 addAction(objectAction, serviceAsGraphQlType);
             });
 
-
             GraphQLObjectType graphQLObjectType = 
gqlvServiceStructure.buildObjectGqlType();
 
             objectActionList
             .forEach(objectAction -> {
-                addBehaviour(objectAction, graphQLObjectType, 
codeRegistryBuilder);
+                addBehaviour(gqlvServiceStructure, objectAction, 
codeRegistryBuilder);
             });
 
             gqlvServiceStructure.addTypeToTopLevelQuery();
@@ -114,7 +113,13 @@ public class QueryFieldFactory {
         }
     }
 
-    private void addBehaviour(ObjectAction objectAction, GraphQLObjectType 
graphQLObjectType, GraphQLCodeRegistry.Builder codeRegistryBuilder) {
+    private void addBehaviour(
+            final GqlvServiceStructure gqlvServiceStructure,
+            final ObjectAction objectAction,
+            final GraphQLCodeRegistry.Builder codeRegistryBuilder) {
+
+        final GraphQLObjectType graphQLObjectType = 
gqlvServiceStructure.getGqlObjectType();
+
         String fieldName = objectAction.getId();
         codeRegistryBuilder
         .dataFetcher(

Reply via email to