GraphQL API support add/remove participant member list

Is GraphQL support the add/removal of a member/members in participant ? ( I looked in GraphQL api documentation of workflowgen but cannot find )
If possible, what is the GraphQL api ?

Regards,
Audrey

Hello Audrey,

GraphQL does support the addition and removal of participant members. These actions can be performed with a mutation.

Here is a simplified update mutation:

mutation {
  updateLocalProcessParticipant(input: {
    id: "TG9jYWxQcm9jZXNzUGFydGljaXBhbnQ6MTI=",
    userIds: ["VXNlcjox", "VXNlcjoy"],
    groupIds: ["R3JvdXA6MQ=="],
    directoryIds: ["RGlyZWN0b3J5OjE="],
    coordinatorIds: ["VXNlcjoy"]
  }) {
    localProcessParticipant {
      id
      name
    }
  }
}

Be careful, since updateLocalProcessParticpant will change all current members to the one specified in the mutation. So if there are current members that you want to keep, you need to specify them in the mutation query.

To retrieve a localProcessParticipant ID, you can run the following GraphQL query:

query localProcessParticipant{
  localProcessParticipant(
    name:"participantName",
    processName:"Simple_approval",
    processVersion:1
  ){
    id
  }
}

The documentation for the updateLocalProcessParticipant mutation is available here.

A small explanation of the update mutation:

userIds: [“VXNlcjox”, “VXNlcjoy”]
This represents the users in participant: image

groupIds: [“R3JvdXA6MQ==”]
This represents the groups in participant: image

directoryIds: [“RGlyZWN0b3J5OjE=”]
This represents the directory in participant: image

coordinatorIds: [“VXNlcjoy”]
This represents the coordinator in participant: image

By using the update mutation in the documentation you will be able to add and remove members. To do this, you will need to know the ID of the user, group, directory, or coordinator you want to add. To retrieve that ID, you can make a GraphQL query.

Here is a GraphQL example to retrieve a user ID:

query user{
  user(userName:"user1") {
    id
  }
}

Regards,
Lynn