Group

Model

See schema for more information about the schema.

type Group {
id: UUID!
name: String!
users: [User!]!
enableChat: Boolean!
ref: String
}

Queries

Get groups

Get a list of all groups in your organisation

query groups {
group {
ref
name
}
}

Get group

Get a single group in your organisation. You can use the ref of the group to get it.

query group {
group(ref: "group-ref") {
ref
name
}
}

Mutations

Create group

Create a new group in your organisation, you can pass your own custom ref.

mutation createGroup {
createGroup(group: {ref:"group-ref", name: "Test Group"}) {
group {
ref
name
}
}
}

Update group

Update a group using ref.

mutation updateGroup {
updateGroup(ref:"group-ref", group: {name:"New title"}) {
group {
ref
name
}
}
}

Add users to group

You can add multiple users to a group by using refs.

Note: This action isn't done instant, so it can take a few minutes to be done

mutation addUsersToGroup {
addUsersToGroup(groupRef: "group-ref", userRefs: ["user-ref", "user-2-ref"]) {
addedRefs # Refs of users that are removed
alreadyAddedRefs # Refs of users that are already in the group
failedRefs # Refs of users that are incorrect
}
}

Remove users from group

You can add remove users from a group by using refs.

Note: This action isn't done instant, so it can take a few minutes to be done

mutation removeUsersFromGroup {
removeUsersFromGroup(groupRef: "group-ref", userRefs: ["user-ref", "user-2-ref"]) {
removedRefs # Refs of users that are removed
alreadyRemovedRefs # Refs of users that are not in the group
failedRefs # Refs of users that were incorrect
}
}