Manage Space Membership
Add Members to Space
addSpaceMembers
mutation is used add a members to a space.
It takes spaceId
and AddSpaceMemberInput
as inputs.
- GraphQL
- JS Client
mutation {
addSpaceMembers(spaceId: "0CXG3DhjnlRZ", input: {memberId: "adfaSF3432"}) {
member {
email
}
}
}
client.mutation({
name: 'addSpaceMembers',
args: {
variables: {
spaceId: '0CXG3DhjnlRZ',
input: [
{
memberId: 'adfaSF3432',
roleId: 'Kni0OF7HtE',
},
],
},
fields: {
member: 'basic',
},
},
})
You can also bulk add users to a space by passing an array to the input
.
Remove Members from Space
removeSpaceMembers
mutation is used to remove members from a space.
It takes spaceId
and membersIds
as inputs.
- GraphQL
- JS Client
mutation {
removeSpaceMembers(spaceId: "0CXG3DhjnlRZ", memberIds: ["adfaSF3432"]) {
status
}
}
client.mutation({
name: 'removeSpaceMembers',
args: {
variables: {
spaceId: '0CXG3DhjnlRZ',
memberIds: ['adfaSF3432'],
},
fields: 'basic',
},
})