A member is an individual user in your organization. Members have permissions that can be configured at the organization-level or the project-level. Use the roles query to get the id for each role.
Add members at project-level
Use the setProjectMembership
mutation to add a member to a project and select their role.
Field | Type | Description |
---|---|---|
userId | String | ID of the user to add to the project |
projectId | String | ID of the project to add the member to |
roleId | String | Admin: cjlvi91a41aab0714677xp87h Team manager: cjlvi919q1aa80714b7z3xuku Project-based: cjmb6xy80f5vz0780u3mw2rj4 Reviewer: cjlvi919b1aa50714k75euii5 Labeler: cjlvi914y1aa20714372uvzjv |
mutation SetProjectMembership {
setProjectMembership (
data: {
userId: "<USER_ID>"
projectId: "<PROJECT_ID>"
roleId: "<ROLE_ID>"
}
) {
user { email }
project { name }
role { name }
}
}
Get available roles
Use the roles
query to get the IDs for all of the member roles. Use the first
argument to specify how many objects to return and the skip
argument to specify how many objects to skip.
Field | Type | Definition |
---|---|---|
name | String | Role name |
id | ID | Role ID |
permissions | PermissionFlag | All available permissions for that role |
query GetAvailableRoles {
roles (
first: 10
skip: 1
){
name
id
permissions
}
}
List member projects
Use the users
query to get a list of all the projects a member is associated with.
query GetUserProjects {
users ( where: {email:"<USER-EMAIL>"}) {
id
projects {
name
id
}
}
}
Remove members
Use this setProjectMembership
mutation to remove project-based members.
Field | Type | Description |
---|---|---|
userId | ID | Member ID |
roleId | ID | Set cjmb6xy80f5vz0780u3mw2rj4 as the roleId to set role to None . |
projectId | ID | Project ID |
mutation RemoveMemberFromProject {
setProjectMembership (data: {
userId:"<USER_ID>"
roleId: "cjmb6xy80f5vz0780u3mw2rj4"
projectId:"<PROJECT_ID>"
}) {
id
}
}