You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by da...@apache.org on 2024/01/26 06:19:21 UTC
(causeway) 07/07: CAUSEWAY-3676: extends test domain
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 9aac5ab7507c975f83d230f2689c9ed619eafc91
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Jan 26 06:17:10 2024 +0000
CAUSEWAY-3676: extends test domain
---
.../viewer/graphql/model/domain/GqlvAction.java | 31 +-
.../model/domain/GqlvActionParamValidate.java | 96 +++++
.../graphql/viewer/test/domain/Department.java | 55 +++
.../graphql/viewer/test/domain/StaffMember.java | 2 +-
.../viewer/test/domain/StaffMemberRepository.java | 7 +
.../test/e2e/Schema_IntegTest.schema.approved.json | 444 +++++++++++++++++++++
...chema_IntegTest.schema_types_name.approved.json | 18 +
.../graphql/test/src/test/resources/schema.gql | 54 +++
8 files changed, 699 insertions(+), 8 deletions(-)
diff --git a/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvAction.java b/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvAction.java
index 49ea67bad9..f0d9d6c10b 100644
--- a/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvAction.java
+++ b/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvAction.java
@@ -35,6 +35,7 @@ import graphql.schema.*;
import lombok.extern.log4j.Log4j2;
import lombok.val;
+import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
@@ -138,14 +139,30 @@ public class GqlvAction
final TypeMapper.InputContext inputContext,
final int upTo) {
- Can<ObjectActionParameter> parameters = objectAction.getParameters();
+ val parameters = objectAction.getParameters();
+ val arguments = parameters.stream()
+ .limit(upTo)
+ .map(OneToOneActionParameter.class::cast) // TODO: remove - we previously filter to ignore any actions that have collection parameters
+ .map(oneToOneActionParameter -> gqlArgumentFor(oneToOneActionParameter, inputContext))
+ .collect(Collectors.toList());
+ if (!arguments.isEmpty()) {
+ builder.arguments(arguments);
+ }
+ }
- if (parameters.isNotEmpty()) {
- builder.arguments(parameters.stream()
- .limit(upTo)
- .map(OneToOneActionParameter.class::cast) // we previously filter to ignore any actions that have collection parameters
- .map(oneToOneActionParameter -> gqlArgumentFor(oneToOneActionParameter, inputContext))
- .collect(Collectors.toList()));
+ static void addGqlArgument(
+ final ObjectAction objectAction,
+ final GraphQLFieldDefinition.Builder builder,
+ final TypeMapper.InputContext inputContext,
+ final int paramNum) {
+
+ val parameters = objectAction.getParameters();
+ val arguments = parameters.get(paramNum).stream()
+ .map(OneToOneActionParameter.class::cast) // TODO: remove - we previously filter to ignore any actions that have collection parameters
+ .map(oneToOneActionParameter -> gqlArgumentFor(oneToOneActionParameter, inputContext))
+ .collect(Collectors.toList());
+ if (!arguments.isEmpty()) {
+ builder.arguments(arguments);
}
}
diff --git a/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvActionParamValidate.java b/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvActionParamValidate.java
new file mode 100644
index 0000000000..f03f362ed5
--- /dev/null
+++ b/incubator/viewers/graphql/model/src/main/java/org/apache/causeway/viewer/graphql/model/domain/GqlvActionParamValidate.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.causeway.viewer.graphql.model.domain;
+
+import org.apache.causeway.core.metamodel.consent.InteractionInitiatedBy;
+import org.apache.causeway.core.metamodel.object.ManagedObject;
+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.ObjectActionParameterProvider;
+import org.apache.causeway.viewer.graphql.model.mmproviders.ObjectActionProvider;
+import org.apache.causeway.viewer.graphql.model.mmproviders.ObjectSpecificationProvider;
+import org.apache.causeway.viewer.graphql.model.types.TypeMapper;
+
+import lombok.val;
+import lombok.extern.log4j.Log4j2;
+
+import graphql.schema.DataFetchingEnvironment;
+import graphql.schema.GraphQLFieldDefinition;
+
+import static graphql.schema.GraphQLFieldDefinition.newFieldDefinition;
+
+import static org.apache.causeway.viewer.graphql.model.domain.GqlvAction.addGqlArgument;
+
+
+@Log4j2
+public class GqlvActionParamValidate {
+
+ private final Holder holder;
+ private final Context context;
+
+ private final GraphQLFieldDefinition field;
+
+ public GqlvActionParamValidate(
+ final Holder holder,
+ final Context context) {
+ this.holder = holder;
+ this.context = context;
+
+ val fieldBuilder = newFieldDefinition()
+ .name("validate")
+ .type(TypeMapper.scalarTypeFor(String.class));
+ addGqlArgument(holder.getObjectAction(), fieldBuilder, TypeMapper.InputContext.DISABLE, holder.getParamNum()+1);
+ this.field = holder.addField(fieldBuilder.build());
+ }
+
+
+ public void addDataFetcher() {
+ context.codeRegistryBuilder.dataFetcher(
+ holder.coordinatesFor(field),
+ this::disabled
+ );
+ }
+
+ private String disabled(final DataFetchingEnvironment dataFetchingEnvironment) {
+
+ val sourcePojo = BookmarkedPojo.sourceFrom(dataFetchingEnvironment);
+ val objectSpecification = context.specificationLoader.loadSpecification(sourcePojo.getClass());
+ if (objectSpecification == null) {
+ return "Disabled";
+ }
+
+ val objectAction = holder.getObjectAction();
+ val managedObject = ManagedObject.adaptSingular(objectSpecification, sourcePojo);
+ val actionInteractionHead = objectAction.interactionHead(managedObject);
+
+ val objectActionParameter = objectAction.getParameterById(holder.getObjectActionParameter().getId());
+ val argumentManagedObjects = GqlvAction.argumentManagedObjectsFor(dataFetchingEnvironment, objectAction, context.bookmarkService);
+
+ val usable = objectActionParameter.isUsable(actionInteractionHead, argumentManagedObjects, InteractionInitiatedBy.USER);
+ return usable.isVetoed() ? usable.getReasonAsString().orElse("Disabled") : null;
+ }
+
+ public interface Holder
+ extends GqlvHolder,
+ ObjectSpecificationProvider,
+ ObjectActionProvider,
+ ObjectActionParameterProvider {
+ GqlvActionParam.Holder getHolder();
+ }
+}
diff --git a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/domain/Department.java b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/domain/Department.java
index d2a0155e18..f5c90ec495 100644
--- a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/domain/Department.java
+++ b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/domain/Department.java
@@ -26,15 +26,20 @@ import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
+import org.apache.causeway.applib.annotation.Action;
+import org.apache.causeway.applib.annotation.ActionLayout;
import org.apache.causeway.applib.annotation.Bounding;
import org.apache.causeway.applib.annotation.Collection;
import org.apache.causeway.applib.annotation.DomainObject;
import org.apache.causeway.applib.annotation.Nature;
import org.apache.causeway.applib.annotation.Property;
+import org.apache.causeway.applib.annotation.SemanticsOf;
import lombok.Getter;
import lombok.NoArgsConstructor;
+import lombok.RequiredArgsConstructor;
import lombok.Setter;
+import lombok.val;
import java.util.Comparator;
import java.util.Set;
@@ -61,6 +66,27 @@ public class Department implements Comparable<Department> {
@Getter @Setter
private String name;
+ @Action(semantics = SemanticsOf.IDEMPOTENT)
+ public class changeName {
+
+ public Department act(final String newName){
+ setName(newName);
+ return Department.this;
+ }
+
+ public String default0Act(){
+ return getName();
+ }
+
+ public String validate0Act(String name) {
+ if (name.contains("!")) {
+ return "Name cannot contain '!' character";
+ }
+ return null;
+ }
+ }
+
+
@Getter @Setter
@Property
@@ -74,6 +100,35 @@ public class Department implements Comparable<Department> {
@OneToMany(mappedBy = "department")
private Set<StaffMember> staffMembers = new TreeSet<>();
+ @Action(semantics = SemanticsOf.IDEMPOTENT)
+ @ActionLayout(associateWith = "staffMembers")
+ public class addStaffMember {
+
+ public Department act(StaffMember staffMember) {
+ val department = Department.this;
+
+ department.getStaffMembers().add(staffMember);
+ staffMember.setDepartment(department);
+ return department;
+ }
+ }
+
+ @Action(semantics = SemanticsOf.IDEMPOTENT)
+ @ActionLayout(associateWith = "staffMembers")
+ @RequiredArgsConstructor
+ public class removeStaffMember {
+
+ public Department act(StaffMember staffMember) {
+ val department = Department.this;
+
+ department.getStaffMembers().add(staffMember);
+ staffMember.setDepartment(department);
+ return department;
+ }
+ public Set<StaffMember> choices0Act() {
+ return Department.this.getStaffMembers();
+ }
+ }
@Override
public int compareTo(final Department o) {
diff --git a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/domain/StaffMember.java b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/domain/StaffMember.java
index 547ac32a68..5116b2bb71 100644
--- a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/domain/StaffMember.java
+++ b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/domain/StaffMember.java
@@ -38,7 +38,7 @@ import org.apache.causeway.applib.annotation.Property;
)
@javax.inject.Named("university.dept.StaffMember")
@NoArgsConstructor
-@DomainObject(nature = Nature.ENTITY)
+@DomainObject(nature = Nature.ENTITY, autoCompleteRepository = StaffMemberRepository.class, autoCompleteMethod = "findByNameMatching")
public class StaffMember implements Comparable<StaffMember> {
public StaffMember(String name, Department department) {
diff --git a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/domain/StaffMemberRepository.java b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/domain/StaffMemberRepository.java
index 1eff43776e..0778503795 100644
--- a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/domain/StaffMemberRepository.java
+++ b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/domain/StaffMemberRepository.java
@@ -19,6 +19,7 @@
package org.apache.causeway.viewer.graphql.viewer.test.domain;
import java.util.List;
+import java.util.stream.Collectors;
import javax.inject.Inject;
@@ -53,4 +54,10 @@ public class StaffMemberRepository {
orElse(null);
}
+ public List<StaffMember> findByNameMatching(final String name){
+ return findAll().stream().
+ filter(dept -> dept.getName().contains(name)).
+ collect(Collectors.toList());
+ }
+
}
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 99079739df..5bb809b804 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
@@ -21485,6 +21485,313 @@
},
"isDeprecated" : false,
"deprecationReason" : null
+ }, {
+ "name" : "changeName",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__changeName__gqlv_action",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "addStaffMember",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__addStaffMember__gqlv_action",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "removeStaffMember",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__removeStaffMember__gqlv_action",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ } ],
+ "inputFields" : null,
+ "interfaces" : [ ],
+ "enumValues" : null,
+ "possibleTypes" : null
+ }, {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__addStaffMember__gqlv_action",
+ "description" : null,
+ "fields" : [ {
+ "name" : "hidden",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "Boolean",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "disabled",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "String",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "validate",
+ "description" : null,
+ "args" : [ {
+ "name" : "staffMember",
+ "description" : null,
+ "type" : {
+ "kind" : "INPUT_OBJECT",
+ "name" : "university_dept_StaffMember__gqlv_input",
+ "ofType" : null
+ },
+ "defaultValue" : null
+ } ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "String",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "invokeIdempotent",
+ "description" : null,
+ "args" : [ {
+ "name" : "staffMember",
+ "description" : null,
+ "type" : {
+ "kind" : "NON_NULL",
+ "name" : null,
+ "ofType" : {
+ "kind" : "INPUT_OBJECT",
+ "name" : "university_dept_StaffMember__gqlv_input",
+ "ofType" : null
+ }
+ },
+ "defaultValue" : null
+ } ],
+ "type" : {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "params",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__addStaffMember__gqlv_action_params",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ } ],
+ "inputFields" : null,
+ "interfaces" : [ ],
+ "enumValues" : null,
+ "possibleTypes" : null
+ }, {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__addStaffMember__gqlv_action_params",
+ "description" : null,
+ "fields" : [ {
+ "name" : "staffMember",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__addStaffMember__staffMember__gqlv_action_parameter",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ } ],
+ "inputFields" : null,
+ "interfaces" : [ ],
+ "enumValues" : null,
+ "possibleTypes" : null
+ }, {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__addStaffMember__staffMember__gqlv_action_parameter",
+ "description" : null,
+ "fields" : [ {
+ "name" : "hidden",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "Boolean",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "disabled",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "String",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ } ],
+ "inputFields" : null,
+ "interfaces" : [ ],
+ "enumValues" : null,
+ "possibleTypes" : null
+ }, {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__changeName__gqlv_action",
+ "description" : null,
+ "fields" : [ {
+ "name" : "hidden",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "Boolean",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "disabled",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "String",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "validate",
+ "description" : null,
+ "args" : [ {
+ "name" : "newName",
+ "description" : null,
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "String",
+ "ofType" : null
+ },
+ "defaultValue" : null
+ } ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "String",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "invokeIdempotent",
+ "description" : null,
+ "args" : [ {
+ "name" : "newName",
+ "description" : null,
+ "type" : {
+ "kind" : "NON_NULL",
+ "name" : null,
+ "ofType" : {
+ "kind" : "SCALAR",
+ "name" : "String",
+ "ofType" : null
+ }
+ },
+ "defaultValue" : null
+ } ],
+ "type" : {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "params",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__changeName__gqlv_action_params",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ } ],
+ "inputFields" : null,
+ "interfaces" : [ ],
+ "enumValues" : null,
+ "possibleTypes" : null
+ }, {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__changeName__gqlv_action_params",
+ "description" : null,
+ "fields" : [ {
+ "name" : "newName",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__changeName__newName__gqlv_action_parameter",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ } ],
+ "inputFields" : null,
+ "interfaces" : [ ],
+ "enumValues" : null,
+ "possibleTypes" : null
+ }, {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__changeName__newName__gqlv_action_parameter",
+ "description" : null,
+ "fields" : [ {
+ "name" : "hidden",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "Boolean",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "disabled",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "String",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
} ],
"inputFields" : null,
"interfaces" : [ ],
@@ -21734,6 +22041,143 @@
"interfaces" : [ ],
"enumValues" : null,
"possibleTypes" : null
+ }, {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__removeStaffMember__gqlv_action",
+ "description" : null,
+ "fields" : [ {
+ "name" : "hidden",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "Boolean",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "disabled",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "String",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "validate",
+ "description" : null,
+ "args" : [ {
+ "name" : "staffMember",
+ "description" : null,
+ "type" : {
+ "kind" : "INPUT_OBJECT",
+ "name" : "university_dept_StaffMember__gqlv_input",
+ "ofType" : null
+ },
+ "defaultValue" : null
+ } ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "String",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "invokeIdempotent",
+ "description" : null,
+ "args" : [ {
+ "name" : "staffMember",
+ "description" : null,
+ "type" : {
+ "kind" : "NON_NULL",
+ "name" : null,
+ "ofType" : {
+ "kind" : "INPUT_OBJECT",
+ "name" : "university_dept_StaffMember__gqlv_input",
+ "ofType" : null
+ }
+ },
+ "defaultValue" : null
+ } ],
+ "type" : {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "params",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__removeStaffMember__gqlv_action_params",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ } ],
+ "inputFields" : null,
+ "interfaces" : [ ],
+ "enumValues" : null,
+ "possibleTypes" : null
+ }, {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__removeStaffMember__gqlv_action_params",
+ "description" : null,
+ "fields" : [ {
+ "name" : "staffMember",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__removeStaffMember__staffMember__gqlv_action_parameter",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ } ],
+ "inputFields" : null,
+ "interfaces" : [ ],
+ "enumValues" : null,
+ "possibleTypes" : null
+ }, {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__removeStaffMember__staffMember__gqlv_action_parameter",
+ "description" : null,
+ "fields" : [ {
+ "name" : "hidden",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "Boolean",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "disabled",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "String",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ } ],
+ "inputFields" : null,
+ "interfaces" : [ ],
+ "enumValues" : null,
+ "possibleTypes" : null
}, {
"kind" : "OBJECT",
"name" : "university_dept_Department__staffMembers__gqlv_collection",
diff --git a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Schema_IntegTest.schema_types_name.approved.json b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Schema_IntegTest.schema_types_name.approved.json
index 7b5fb5e9ef..cce375c1dc 100644
--- a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Schema_IntegTest.schema_types_name.approved.json
+++ b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Schema_IntegTest.schema_types_name.approved.json
@@ -761,6 +761,18 @@
"name" : "university_admin_AdminMenu__otherAdminAction__gqlv_action"
}, {
"name" : "university_dept_Department"
+ }, {
+ "name" : "university_dept_Department__addStaffMember__gqlv_action"
+ }, {
+ "name" : "university_dept_Department__addStaffMember__gqlv_action_params"
+ }, {
+ "name" : "university_dept_Department__addStaffMember__staffMember__gqlv_action_parameter"
+ }, {
+ "name" : "university_dept_Department__changeName__gqlv_action"
+ }, {
+ "name" : "university_dept_Department__changeName__gqlv_action_params"
+ }, {
+ "name" : "university_dept_Department__changeName__newName__gqlv_action_parameter"
}, {
"name" : "university_dept_Department__deptHead__gqlv_property"
}, {
@@ -769,6 +781,12 @@
"name" : "university_dept_Department__gqlv_meta"
}, {
"name" : "university_dept_Department__name__gqlv_property"
+ }, {
+ "name" : "university_dept_Department__removeStaffMember__gqlv_action"
+ }, {
+ "name" : "university_dept_Department__removeStaffMember__gqlv_action_params"
+ }, {
+ "name" : "university_dept_Department__removeStaffMember__staffMember__gqlv_action_parameter"
}, {
"name" : "university_dept_Department__staffMembers__gqlv_collection"
}, {
diff --git a/incubator/viewers/graphql/test/src/test/resources/schema.gql b/incubator/viewers/graphql/test/src/test/resources/schema.gql
index aa953469fe..546e870d59 100644
--- a/incubator/viewers/graphql/test/src/test/resources/schema.gql
+++ b/incubator/viewers/graphql/test/src/test/resources/schema.gql
@@ -2185,11 +2185,48 @@ type university_admin_AdminMenu__otherAdminAction__gqlv_action {
type university_dept_Department {
_gql_meta: university_dept_Department__gqlv_meta
+ addStaffMember: university_dept_Department__addStaffMember__gqlv_action
+ changeName: university_dept_Department__changeName__gqlv_action
deptHead: university_dept_Department__deptHead__gqlv_property
name: university_dept_Department__name__gqlv_property
+ removeStaffMember: university_dept_Department__removeStaffMember__gqlv_action
staffMembers: university_dept_Department__staffMembers__gqlv_collection
}
+type university_dept_Department__addStaffMember__gqlv_action {
+ disabled: String
+ hidden: Boolean
+ invokeIdempotent(staffMember: university_dept_StaffMember__gqlv_input!): university_dept_Department
+ params: university_dept_Department__addStaffMember__gqlv_action_params
+ validate(staffMember: university_dept_StaffMember__gqlv_input): String
+}
+
+type university_dept_Department__addStaffMember__gqlv_action_params {
+ staffMember: university_dept_Department__addStaffMember__staffMember__gqlv_action_parameter
+}
+
+type university_dept_Department__addStaffMember__staffMember__gqlv_action_parameter {
+ disabled: String
+ hidden: Boolean
+}
+
+type university_dept_Department__changeName__gqlv_action {
+ disabled: String
+ hidden: Boolean
+ invokeIdempotent(newName: String!): university_dept_Department
+ params: university_dept_Department__changeName__gqlv_action_params
+ validate(newName: String): String
+}
+
+type university_dept_Department__changeName__gqlv_action_params {
+ newName: university_dept_Department__changeName__newName__gqlv_action_parameter
+}
+
+type university_dept_Department__changeName__newName__gqlv_action_parameter {
+ disabled: String
+ hidden: Boolean
+}
+
type university_dept_Department__deptHead__gqlv_property {
disabled: String
get: university_dept_DeptHead
@@ -2212,6 +2249,23 @@ type university_dept_Department__name__gqlv_property {
validate(name: String): String
}
+type university_dept_Department__removeStaffMember__gqlv_action {
+ disabled: String
+ hidden: Boolean
+ invokeIdempotent(staffMember: university_dept_StaffMember__gqlv_input!): university_dept_Department
+ params: university_dept_Department__removeStaffMember__gqlv_action_params
+ validate(staffMember: university_dept_StaffMember__gqlv_input): String
+}
+
+type university_dept_Department__removeStaffMember__gqlv_action_params {
+ staffMember: university_dept_Department__removeStaffMember__staffMember__gqlv_action_parameter
+}
+
+type university_dept_Department__removeStaffMember__staffMember__gqlv_action_parameter {
+ disabled: String
+ hidden: Boolean
+}
+
type university_dept_Department__staffMembers__gqlv_collection {
disabled: String
get: [university_dept_StaffMember]