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

commit 183f9fecd9116fb379b4b14acb6fa94e187098f6
Author: danhaywood <[email protected]>
AuthorDate: Fri Jan 26 10:01:01 2024 +0000

    CAUSEWAY-3676: property autocomplete
---
 .../model/domain/GqlvActionParamAutoComplete.java  | 10 ++-
 .../viewer/graphql/model/domain/GqlvProperty.java  | 20 ++++-
 ...yChoices.java => GqlvPropertyAutoComplete.java} | 49 +++++++----
 .../graphql/model/domain/GqlvPropertyChoices.java  | 13 ++-
 ...ind_department_and_edit_head_autocomplete._.gql | 15 ++++
 ...rtment_and_edit_head_autocomplete.approved.json | 21 +++++
 ..._and_edit_head_autocomplete_none_matching._.gql | 15 ++++
 ...t_head_autocomplete_none_matching.approved.json | 13 +++
 .../graphql/viewer/test/e2e/Domain_IntegTest.java  | 16 ++++
 .../test/e2e/Schema_IntegTest.schema.approved.json | 98 +++++++++++++++++-----
 .../graphql/test/src/test/resources/schema.gql     | 15 ++--
 11 files changed, 231 insertions(+), 54 deletions(-)

diff --git 
a/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvActionParamAutoComplete.java
 
b/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvActionParamAutoComplete.java
index cd5927147c..8f0d0cc7da 100644
--- 
a/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvActionParamAutoComplete.java
+++ 
b/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvActionParamAutoComplete.java
@@ -34,6 +34,8 @@ package org.apache.causeway.viewer.graphql.model.domain;
  import 
org.apache.causeway.viewer.graphql.model.mmproviders.ObjectSpecificationProvider;
  import org.apache.causeway.viewer.graphql.model.types.TypeMapper;
 
+ import static graphql.schema.GraphQLNonNull.nonNull;
+
  import static 
org.apache.causeway.viewer.graphql.model.domain.GqlvAction.addGqlArguments;
 
  import graphql.schema.GraphQLArgument;
@@ -75,7 +77,7 @@ package org.apache.causeway.viewer.graphql.model.domain;
              addGqlArguments(holder.getObjectAction(), fieldBuilder, 
TypeMapper.InputContext.AUTOCOMPLETE, holder.getParamNum());
              fieldBuilder.argument(GraphQLArgument.newArgument()
                      .name(SEARCH_PARAM_NAME)
-                     .type(TypeMapper.scalarTypeFor(String.class)))
+                     .type(nonNull(TypeMapper.scalarTypeFor(String.class))))
                      .build();
              this.field = holder.addField(fieldBuilder.build());
          } else {
@@ -110,10 +112,10 @@ package org.apache.causeway.viewer.graphql.model.domain;
 
          val managedAction = ManagedAction.of(managedObject, objectAction, 
Where.ANYWHERE);
          val pendingArgs = ParameterNegotiationModel.of(managedAction, 
argumentManagedObjects);
-         String searchArg = 
dataFetchingEnvironment.getArgument(SEARCH_PARAM_NAME);
-         val autoCompleteChoices = 
objectActionParameter.getAutoComplete(pendingArgs, searchArg, 
InteractionInitiatedBy.USER);
+         val searchArg = 
dataFetchingEnvironment.<String>getArgument(SEARCH_PARAM_NAME);
+         val autoCompleteManagedObjects = 
objectActionParameter.getAutoComplete(pendingArgs, searchArg, 
InteractionInitiatedBy.USER);
 
-         return autoCompleteChoices.stream()
+         return autoCompleteManagedObjects.stream()
                     .map(ManagedObject::getPojo)
                     .collect(Collectors.toList());
      }
diff --git 
a/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvProperty.java
 
b/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvProperty.java
index 6312606612..140fda9278 100644
--- 
a/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvProperty.java
+++ 
b/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvProperty.java
@@ -26,6 +26,8 @@ import 
org.apache.causeway.viewer.graphql.model.types.TypeMapper;
 
 import graphql.schema.*;
 
+import lombok.val;
+
 import static graphql.schema.GraphQLFieldDefinition.newFieldDefinition;
 import static graphql.schema.GraphQLObjectType.newObject;
 
@@ -35,6 +37,7 @@ public class GqlvProperty
                    GqlvMemberDisabled.Holder<OneToOneAssociation>,
                    GqlvPropertyGet.Holder,
                    GqlvPropertyChoices.Holder,
+                   GqlvPropertyAutoComplete.Holder,
                    GqlvPropertyValidate.Holder,
                    GqlvPropertySet.Holder {
 
@@ -47,6 +50,10 @@ public class GqlvProperty
      * Populated iff there are choices
      */
     private final GqlvPropertyChoices choices;
+    /**
+     * Populated iff there is an autoComplete
+     */
+    private final GqlvPropertyAutoComplete autoComplete;
     private final GqlvPropertyValidate validate;
     private final GqlvPropertySet set;
 
@@ -62,7 +69,10 @@ public class GqlvProperty
         this.disabled = new GqlvMemberDisabled<>(this, context);
         this.get = new GqlvPropertyGet(this, context);
         this.validate = new GqlvPropertyValidate(this, context);
-        this.choices = new GqlvPropertyChoices(this, context);
+        val choices = new GqlvPropertyChoices(this, context);
+        this.choices = choices.hasChoices() ? choices : null;
+        val autoComplete = new GqlvPropertyAutoComplete(this, context);
+        this.autoComplete = autoComplete.hasAutoComplete() ? autoComplete : 
null;
         this.set = new GqlvPropertySet(this, context);
 
         this.gqlObjectType = gqlObjectTypeBuilder.build();
@@ -117,8 +127,14 @@ public class GqlvProperty
         hidden.addDataFetcher();
         disabled.addDataFetcher();
         get.addDataFetcher();
-        set.addDataFetcher();
+        if(choices != null) {
+            choices.addDataFetcher();
+        }
+        if(autoComplete != null) {
+            autoComplete.addDataFetcher();
+        }
         validate.addDataFetcher();
+        set.addDataFetcher();
     }
 
 
diff --git 
a/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvPropertyChoices.java
 
b/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvPropertyAutoComplete.java
similarity index 71%
copy from 
incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvPropertyChoices.java
copy to 
incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvPropertyAutoComplete.java
index 8ac620eccc..b9d18d3bf5 100644
--- 
a/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvPropertyChoices.java
+++ 
b/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvPropertyAutoComplete.java
@@ -19,57 +19,66 @@
 package org.apache.causeway.viewer.graphql.model.domain;
 
 import java.util.List;
-import java.util.Map;
 import java.util.stream.Collectors;
 
-import org.apache.causeway.commons.collections.Can;
-import org.apache.causeway.core.metamodel.consent.Consent;
 import org.apache.causeway.core.metamodel.consent.InteractionInitiatedBy;
 import org.apache.causeway.core.metamodel.object.ManagedObject;
-import org.apache.causeway.core.metamodel.spec.ObjectSpecification;
-import org.apache.causeway.core.metamodel.spec.feature.OneToOneAssociation;
 import org.apache.causeway.viewer.graphql.model.context.Context;
 import org.apache.causeway.viewer.graphql.model.fetcher.BookmarkedPojo;
 import 
org.apache.causeway.viewer.graphql.model.mmproviders.ObjectSpecificationProvider;
 import 
org.apache.causeway.viewer.graphql.model.mmproviders.OneToOneAssociationProvider;
 import org.apache.causeway.viewer.graphql.model.types.TypeMapper;
 
+import static graphql.schema.GraphQLNonNull.nonNull;
+
+import graphql.schema.GraphQLArgument;
+
 import graphql.schema.GraphQLList;
 
 import lombok.val;
 
 import graphql.schema.DataFetchingEnvironment;
 import graphql.schema.GraphQLFieldDefinition;
-import graphql.schema.GraphQLOutputType;
 
 import static graphql.schema.GraphQLFieldDefinition.newFieldDefinition;
-import static 
org.apache.causeway.viewer.graphql.model.domain.GqlvProperty.addGqlArgument;
 
-public class GqlvPropertyChoices {
+public class GqlvPropertyAutoComplete {
+
+    private static final String SEARCH_PARAM_NAME = "search";
 
-    final Holder holder;
+    private final Holder holder;
     private final Context context;
+    /**
+     * Populated iff there are choices for this property
+     */
     final GraphQLFieldDefinition field;
 
-    public GqlvPropertyChoices(
+    public GqlvPropertyAutoComplete(
             final Holder holder,
             final Context context) {
         this.holder = holder;
         this.context = context;
 
         val otoa = holder.getOneToOneAssociation();
-        if (otoa.hasChoices()) {
+        if (otoa.hasAutoComplete()) {
             val elementType = otoa.getElementType();
             val fieldBuilder = newFieldDefinition()
-                    .name("choices")
-                    .type(TypeMapper.outputTypeFor(elementType));
-            addGqlArgument(otoa, fieldBuilder, 
TypeMapper.InputContext.CHOICES);
+                    .name("autoComplete")
+                    
.type(GraphQLList.list(TypeMapper.outputTypeFor(elementType)));
+            fieldBuilder.argument(GraphQLArgument.newArgument()
+                            .name(SEARCH_PARAM_NAME)
+                            
.type(nonNull(TypeMapper.scalarTypeFor(String.class))))
+                    .build();
             this.field = holder.addField(fieldBuilder.build());
         } else {
             this.field = null;
         }
     }
 
+    boolean hasAutoComplete() {
+        return this.field != null;
+    }
+
     void addDataFetcher() {
 
         val association = holder.getOneToOneAssociation();
@@ -82,13 +91,13 @@ public class GqlvPropertyChoices {
             case ENTITY:
                 context.codeRegistryBuilder.dataFetcher(
                         holder.coordinatesFor(field),
-                        this::choices);
+                        this::autoComplete);
 
                 break;
         }
     }
 
-    List<Object> choices(final DataFetchingEnvironment 
dataFetchingEnvironment) {
+    List<Object> autoComplete(final DataFetchingEnvironment 
dataFetchingEnvironment) {
 
         val sourcePojo = BookmarkedPojo.sourceFrom(dataFetchingEnvironment);
 
@@ -100,8 +109,12 @@ public class GqlvPropertyChoices {
         val association = holder.getOneToOneAssociation();
         val managedObject = ManagedObject.adaptSingular(objectSpecification, 
sourcePojo);
 
-        val choicesManagedObject = association.getChoices(managedObject, 
InteractionInitiatedBy.USER);
-        return 
choicesManagedObject.stream().map(ManagedObject::getPojo).collect(Collectors.toList());
+        val searchArg = 
dataFetchingEnvironment.<String>getArgument(SEARCH_PARAM_NAME);
+        val autoCompleteManagedObjects = 
association.getAutoComplete(managedObject, searchArg, 
InteractionInitiatedBy.USER);
+
+        return autoCompleteManagedObjects.stream()
+                .map(ManagedObject::getPojo)
+                .collect(Collectors.toList());
     }
 
     public interface Holder
diff --git 
a/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvPropertyChoices.java
 
b/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvPropertyChoices.java
index 8ac620eccc..c63ad0aaa0 100644
--- 
a/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvPropertyChoices.java
+++ 
b/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvPropertyChoices.java
@@ -49,6 +49,9 @@ public class GqlvPropertyChoices {
 
     final Holder holder;
     private final Context context;
+    /**
+     * Populated iff there are choices for this property
+     */
     final GraphQLFieldDefinition field;
 
     public GqlvPropertyChoices(
@@ -62,7 +65,7 @@ public class GqlvPropertyChoices {
             val elementType = otoa.getElementType();
             val fieldBuilder = newFieldDefinition()
                     .name("choices")
-                    .type(TypeMapper.outputTypeFor(elementType));
+                    
.type(GraphQLList.list(TypeMapper.outputTypeFor(elementType)));
             addGqlArgument(otoa, fieldBuilder, 
TypeMapper.InputContext.CHOICES);
             this.field = holder.addField(fieldBuilder.build());
         } else {
@@ -70,6 +73,10 @@ public class GqlvPropertyChoices {
         }
     }
 
+    boolean hasChoices() {
+        return this.field != null;
+    }
+
     void addDataFetcher() {
 
         val association = holder.getOneToOneAssociation();
@@ -101,7 +108,9 @@ public class GqlvPropertyChoices {
         val managedObject = ManagedObject.adaptSingular(objectSpecification, 
sourcePojo);
 
         val choicesManagedObject = association.getChoices(managedObject, 
InteractionInitiatedBy.USER);
-        return 
choicesManagedObject.stream().map(ManagedObject::getPojo).collect(Collectors.toList());
+        return choicesManagedObject.stream()
+                    .map(ManagedObject::getPojo)
+                    .collect(Collectors.toList());
     }
 
     public interface Holder
diff --git 
a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.find_department_and_edit_head_autocomplete._.gql
 
b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.find_department_and_edit_head_autocomplete._.gql
new file mode 100644
index 0000000000..f39fe366c1
--- /dev/null
+++ 
b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.find_department_and_edit_head_autocomplete._.gql
@@ -0,0 +1,15 @@
+{
+  university_dept_Departments {
+    findByName {
+      invoke(name: "Classics") {
+        deptHead {
+          autoComplete(search: "Ho") {
+            name {
+              get
+            }
+          }
+        }
+      }
+    }
+  }
+}
diff --git 
a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.find_department_and_edit_head_autocomplete.approved.json
 
b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.find_department_and_edit_head_autocomplete.approved.json
new file mode 100644
index 0000000000..39bfdf9d09
--- /dev/null
+++ 
b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.find_department_and_edit_head_autocomplete.approved.json
@@ -0,0 +1,21 @@
+{
+  "data" : {
+    "university_dept_Departments" : {
+      "findByName" : {
+        "invoke" : {
+          "deptHead" : {
+            "autoComplete" : [ {
+              "name" : {
+                "get" : "Prof. Dicky Horwich"
+              }
+            }, {
+              "name" : {
+                "get" : "Dr. Susan Hopwood"
+              }
+            } ]
+          }
+        }
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git 
a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.find_department_and_edit_head_autocomplete_none_matching._.gql
 
b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.find_department_and_edit_head_autocomplete_none_matching._.gql
new file mode 100644
index 0000000000..e434f1c9b9
--- /dev/null
+++ 
b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.find_department_and_edit_head_autocomplete_none_matching._.gql
@@ -0,0 +1,15 @@
+{
+  university_dept_Departments {
+    findByName {
+      invoke(name: "Classics") {
+        deptHead {
+          autoComplete(search: "XXX") {
+            name {
+              get
+            }
+          }
+        }
+      }
+    }
+  }
+}
diff --git 
a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.find_department_and_edit_head_autocomplete_none_matching.approved.json
 
b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.find_department_and_edit_head_autocomplete_none_matching.approved.json
new file mode 100644
index 0000000000..09bcdfb019
--- /dev/null
+++ 
b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.find_department_and_edit_head_autocomplete_none_matching.approved.json
@@ -0,0 +1,13 @@
+{
+  "data" : {
+    "university_dept_Departments" : {
+      "findByName" : {
+        "invoke" : {
+          "deptHead" : {
+            "autoComplete" : [ ]
+          }
+        }
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git 
a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.java
 
b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.java
index c6dad99f71..93fab591d8 100644
--- 
a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.java
+++ 
b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.java
@@ -149,6 +149,22 @@ public class Domain_IntegTest extends 
CausewayViewerGraphqlTestModuleIntegTestAb
         Approvals.verify(submit(), jsonOptions());
     }
 
+    @Test
+    @UseReporter(DiffReporter.class)
+    void find_department_and_edit_head_autocomplete() throws Exception {
+
+        // when, then
+        Approvals.verify(submit(), jsonOptions());
+    }
+
+    @Test
+    @UseReporter(DiffReporter.class)
+    void find_department_and_edit_head_autocomplete_none_matching() throws 
Exception {
+
+        // when, then
+        Approvals.verify(submit(), jsonOptions());
+    }
+
     @Test
     @UseReporter(DiffReporter.class)
     void find_staff_member_by_name_and_edit() throws Exception {
diff --git 
a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Schema_IntegTest.schema.approved.json
 
b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Schema_IntegTest.schema.approved.json
index 17ad68f025..26275ba414 100644
--- 
a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Schema_IntegTest.schema.approved.json
+++ 
b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Schema_IntegTest.schema.approved.json
@@ -3603,9 +3603,13 @@
             "defaultValue" : null
           } ],
           "type" : {
-            "kind" : "SCALAR",
-            "name" : "String",
-            "ofType" : null
+            "kind" : "LIST",
+            "name" : null,
+            "ofType" : {
+              "kind" : "SCALAR",
+              "name" : "String",
+              "ofType" : null
+            }
           },
           "isDeprecated" : false,
           "deprecationReason" : null
@@ -8054,9 +8058,13 @@
             "defaultValue" : null
           } ],
           "type" : {
-            "kind" : "SCALAR",
-            "name" : "String",
-            "ofType" : null
+            "kind" : "LIST",
+            "name" : null,
+            "ofType" : {
+              "kind" : "SCALAR",
+              "name" : "String",
+              "ofType" : null
+            }
           },
           "isDeprecated" : false,
           "deprecationReason" : null
@@ -22882,9 +22890,13 @@
             "name" : "search",
             "description" : null,
             "type" : {
-              "kind" : "SCALAR",
-              "name" : "String",
-              "ofType" : null
+              "kind" : "NON_NULL",
+              "name" : null,
+              "ofType" : {
+                "kind" : "SCALAR",
+                "name" : "String",
+                "ofType" : null
+              }
             },
             "defaultValue" : null
           } ],
@@ -23072,9 +23084,13 @@
             "name" : "search",
             "description" : null,
             "type" : {
-              "kind" : "SCALAR",
-              "name" : "String",
-              "ofType" : null
+              "kind" : "NON_NULL",
+              "name" : null,
+              "ofType" : {
+                "kind" : "SCALAR",
+                "name" : "String",
+                "ofType" : null
+              }
             },
             "defaultValue" : null
           } ],
@@ -23359,6 +23375,34 @@
           },
           "isDeprecated" : false,
           "deprecationReason" : null
+        }, {
+          "name" : "autoComplete",
+          "description" : null,
+          "args" : [ {
+            "name" : "search",
+            "description" : null,
+            "type" : {
+              "kind" : "NON_NULL",
+              "name" : null,
+              "ofType" : {
+                "kind" : "SCALAR",
+                "name" : "String",
+                "ofType" : null
+              }
+            },
+            "defaultValue" : null
+          } ],
+          "type" : {
+            "kind" : "LIST",
+            "name" : null,
+            "ofType" : {
+              "kind" : "OBJECT",
+              "name" : "university_dept_DeptHead",
+              "ofType" : null
+            }
+          },
+          "isDeprecated" : false,
+          "deprecationReason" : null
         }, {
           "name" : "set",
           "description" : null,
@@ -23875,9 +23919,13 @@
             "name" : "search",
             "description" : null,
             "type" : {
-              "kind" : "SCALAR",
-              "name" : "String",
-              "ofType" : null
+              "kind" : "NON_NULL",
+              "name" : null,
+              "ofType" : {
+                "kind" : "SCALAR",
+                "name" : "String",
+                "ofType" : null
+              }
             },
             "defaultValue" : null
           } ],
@@ -24837,9 +24885,13 @@
             "defaultValue" : null
           } ],
           "type" : {
-            "kind" : "OBJECT",
-            "name" : "university_dept_Department",
-            "ofType" : null
+            "kind" : "LIST",
+            "name" : null,
+            "ofType" : {
+              "kind" : "OBJECT",
+              "name" : "university_dept_Department",
+              "ofType" : null
+            }
           },
           "isDeprecated" : false,
           "deprecationReason" : null
@@ -25431,9 +25483,13 @@
             "defaultValue" : null
           } ],
           "type" : {
-            "kind" : "OBJECT",
-            "name" : "university_dept_Department",
-            "ofType" : null
+            "kind" : "LIST",
+            "name" : null,
+            "ofType" : {
+              "kind" : "OBJECT",
+              "name" : "university_dept_Department",
+              "ofType" : null
+            }
           },
           "isDeprecated" : false,
           "deprecationReason" : null
diff --git a/incubator/viewers/graphql/test/src/test/resources/schema.gql 
b/incubator/viewers/graphql/test/src/test/resources/schema.gql
index 56be60a742..cc3f446855 100644
--- a/incubator/viewers/graphql/test/src/test/resources/schema.gql
+++ b/incubator/viewers/graphql/test/src/test/resources/schema.gql
@@ -291,7 +291,7 @@ type 
causeway_applib_UserMemento__authenticationCode__gqlv_property {
 }
 
 type causeway_applib_UserMemento__authenticationSource__gqlv_property {
-  choices(authenticationSource: String): String
+  choices(authenticationSource: String): [String]
   disabled: String
   get: String!
   hidden: Boolean
@@ -743,7 +743,7 @@ type causeway_feat_ApplicationTypeAction {
 }
 
 type causeway_feat_ApplicationTypeAction__actionSemantics__gqlv_property {
-  choices(actionSemantics: String): String
+  choices(actionSemantics: String): [String]
   disabled: String
   get: String!
   hidden: Boolean
@@ -2249,7 +2249,7 @@ type 
university_dept_Department__addStaffMember__gqlv_action_params {
 }
 
 type 
university_dept_Department__addStaffMember__staffMember__gqlv_action_parameter {
-  autoComplete(search: String): [university_dept_StaffMember]
+  autoComplete(search: String!): [university_dept_StaffMember]
   disabled(staffMember: university_dept_StaffMember__gqlv_input): String
   hidden: Boolean
   validity(staffMember: university_dept_StaffMember__gqlv_input): String
@@ -2268,7 +2268,7 @@ type 
university_dept_Department__changeDeptHead__gqlv_action_params {
 }
 
 type 
university_dept_Department__changeDeptHead__newDeptHead__gqlv_action_parameter {
-  autoComplete(search: String): [university_dept_DeptHead]
+  autoComplete(search: String!): [university_dept_DeptHead]
   default: university_dept_DeptHead
   disabled(newDeptHead: university_dept_DeptHead__gqlv_input): String
   hidden: Boolean
@@ -2295,6 +2295,7 @@ type 
university_dept_Department__changeName__newName__gqlv_action_parameter {
 }
 
 type university_dept_Department__deptHead__gqlv_property {
+  autoComplete(search: String!): [university_dept_DeptHead]
   disabled: String
   get: university_dept_DeptHead
   hidden: Boolean
@@ -2348,7 +2349,7 @@ type university_dept_Departments {
 }
 
 type 
university_dept_Departments__createDepartment__deptHead__gqlv_action_parameter {
-  autoComplete(name: String, search: String): [university_dept_DeptHead]
+  autoComplete(name: String, search: String!): [university_dept_DeptHead]
   disabled(deptHead: university_dept_DeptHead__gqlv_input, name: String): 
String
   hidden(name: String): Boolean
   validity(deptHead: university_dept_DeptHead__gqlv_input): String
@@ -2445,7 +2446,7 @@ type 
university_dept_DeptHead__changeName__newName__gqlv_action_parameter {
 }
 
 type university_dept_DeptHead__department__gqlv_property {
-  choices(department: university_dept_Department__gqlv_input): 
university_dept_Department
+  choices(department: university_dept_Department__gqlv_input): 
[university_dept_Department]
   disabled: String
   get: university_dept_Department
   hidden: Boolean
@@ -2510,7 +2511,7 @@ type university_dept_StaffMember {
 }
 
 type university_dept_StaffMember__department__gqlv_property {
-  choices(department: university_dept_Department__gqlv_input): 
university_dept_Department
+  choices(department: university_dept_Department__gqlv_input): 
[university_dept_Department]
   disabled: String
   get: university_dept_Department
   hidden: Boolean

Reply via email to