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 |
---|---|---|
| String | ID of the user to add to the project |
| String | ID of the project to add the member to |
| String | Admin: Team manager: Project-based: Reviewer: Labeler: |
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 |
---|---|---|
| String | Role name |
| ID | Role ID |
| 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 |
---|---|---|
| ID | Member ID |
| ID | Set |
| ID | Project ID |
mutation RemoveMemberFromProject {
setProjectMembership (data: {
userId:"<USER_ID>"
roleId: "cjmb6xy80f5vz0780u3mw2rj4"
projectId:"<PROJECT_ID>"
}) {
id
}
}