taskcafe/internal/graph/schema.graphqls

667 lines
12 KiB
GraphQL
Raw Normal View History

2020-04-10 04:40:22 +02:00
scalar Time
scalar UUID
2020-06-13 00:21:58 +02:00
scalar Upload
2020-04-10 04:40:22 +02:00
enum RoleCode {
owner
admin
member
observer
}
2020-04-21 01:04:27 +02:00
type ProjectLabel {
2020-05-27 02:53:31 +02:00
id: ID!
2020-04-21 01:04:27 +02:00
createdDate: Time!
2020-05-27 23:18:50 +02:00
labelColor: LabelColor!
2020-04-21 01:04:27 +02:00
name: String
}
2020-05-27 23:18:50 +02:00
type LabelColor {
id: ID!
name: String!
position: Float!
colorHex: String!
}
2020-04-20 05:02:55 +02:00
type TaskLabel {
2020-05-27 02:53:31 +02:00
id: ID!
2020-05-31 06:11:19 +02:00
projectLabel: ProjectLabel!
2020-04-21 01:04:27 +02:00
assignedDate: Time!
2020-04-20 05:02:55 +02:00
}
type ProfileIcon {
url: String
initials: String
2020-04-21 01:04:27 +02:00
bgColor: String
2020-04-20 05:02:55 +02:00
}
2020-07-12 09:06:11 +02:00
type OwnersList {
projects: [UUID!]!
teams: [UUID!]!
}
type Member {
2020-05-27 02:53:31 +02:00
id: ID!
role: Role!
2020-06-13 00:21:58 +02:00
fullName: String!
username: String!
2020-04-20 05:02:55 +02:00
profileIcon: ProfileIcon!
owned: OwnedList!
member: MemberList!
2020-04-20 05:02:55 +02:00
}
2020-04-10 04:40:22 +02:00
type RefreshToken {
2020-05-27 02:53:31 +02:00
id: ID!
2020-04-10 04:40:22 +02:00
userId: UUID!
expiresAt: Time!
createdAt: Time!
}
type Role {
code: String!
name: String!
}
type OwnedList {
teams: [Team!]!
projects: [Project!]!
}
type MemberList {
teams: [Team!]!
projects: [Project!]!
}
2020-04-10 04:40:22 +02:00
type UserAccount {
2020-05-27 02:53:31 +02:00
id: ID!
2020-04-10 04:40:22 +02:00
email: String!
createdAt: Time!
2020-06-13 00:21:58 +02:00
fullName: String!
initials: String!
role: Role!
2020-04-10 04:40:22 +02:00
username: String!
2020-04-20 05:02:55 +02:00
profileIcon: ProfileIcon!
owned: OwnedList!
member: MemberList!
2020-04-10 04:40:22 +02:00
}
type Team {
2020-05-27 02:53:31 +02:00
id: ID!
2020-04-10 04:40:22 +02:00
createdAt: Time!
name: String!
members: [Member!]!
2020-04-10 04:40:22 +02:00
}
type Project {
2020-05-27 02:53:31 +02:00
id: ID!
2020-04-10 04:40:22 +02:00
createdAt: Time!
name: String!
2020-04-20 05:02:55 +02:00
team: Team!
2020-04-10 04:40:22 +02:00
taskGroups: [TaskGroup!]!
members: [Member!]!
2020-04-21 01:04:27 +02:00
labels: [ProjectLabel!]!
2020-04-10 04:40:22 +02:00
}
type TaskGroup {
2020-05-27 02:53:31 +02:00
id: ID!
2020-04-10 04:40:22 +02:00
projectID: String!
createdAt: Time!
name: String!
position: Float!
tasks: [Task!]!
}
2020-06-19 01:12:15 +02:00
type ChecklistBadge {
complete: Int!
total: Int!
}
type TaskBadges {
checklist: ChecklistBadge
}
2020-04-10 04:40:22 +02:00
type Task {
2020-05-27 02:53:31 +02:00
id: ID!
taskGroup: TaskGroup!
2020-04-10 04:40:22 +02:00
createdAt: Time!
name: String!
position: Float!
2020-04-20 05:02:55 +02:00
description: String
2020-06-16 00:36:59 +02:00
dueDate: Time
2020-06-19 01:12:15 +02:00
complete: Boolean!
assigned: [Member!]!
2020-04-20 05:02:55 +02:00
labels: [TaskLabel!]!
2020-06-19 01:12:15 +02:00
checklists: [TaskChecklist!]!
badges: TaskBadges!
2020-04-10 04:40:22 +02:00
}
type Organization {
id: ID!
name: String!
2020-04-20 05:02:55 +02:00
}
type TaskChecklistItem {
id: ID!
name: String!
taskChecklistID: UUID!
complete: Boolean!
position: Float!
dueDate: Time!
}
type TaskChecklist {
id: ID!
name: String!
position: Float!
items: [TaskChecklistItem!]!
}
enum RoleLevel {
ADMIN
MEMBER
}
enum ActionLevel {
ORG
TEAM
PROJECT
}
enum ObjectType {
ORG
TEAM
PROJECT
TASK
}
directive @hasRole(roles: [RoleLevel!]!, level: ActionLevel!, type: ObjectType!) on FIELD_DEFINITION
2020-04-10 04:40:22 +02:00
type Query {
organizations: [Organization!]!
2020-04-10 04:40:22 +02:00
users: [UserAccount!]!
findUser(input: FindUser!): UserAccount!
findProject(input: FindProject!): Project!
2020-04-20 05:02:55 +02:00
findTask(input: FindTask!): Task!
2020-04-10 04:40:22 +02:00
projects(input: ProjectsFilter): [Project!]!
findTeam(input: FindTeam!): Team!
teams: [Team!]!
2020-05-27 23:18:50 +02:00
labelColors: [LabelColor!]!
2020-04-10 04:40:22 +02:00
taskGroups: [TaskGroup!]!
me: MePayload!
2020-04-10 04:40:22 +02:00
}
type Mutation
type TeamRole {
teamID: UUID!
roleCode: RoleCode!
}
type ProjectRole {
projectID: UUID!
roleCode: RoleCode!
}
type MePayload {
user: UserAccount!
teamRoles: [TeamRole!]!
projectRoles: [ProjectRole!]!
}
input ProjectsFilter {
teamID: UUID
}
input FindUser {
2020-04-10 04:40:22 +02:00
userId: String!
}
input FindProject {
projectID: UUID!
2020-04-10 04:40:22 +02:00
}
input FindTask {
taskID: UUID!
2020-04-10 04:40:22 +02:00
}
input FindTeam {
2020-04-20 05:02:55 +02:00
teamID: UUID!
2020-04-10 04:40:22 +02:00
}
extend type Mutation {
createProject(input: NewProject!): Project! @hasRole(roles: [ADMIN], level: TEAM, type: TEAM)
deleteProject(input: DeleteProject!):
DeleteProjectPayload! @hasRole(roles: [ADMIN], level: PROJECT, type: PROJECT)
updateProjectName(input: UpdateProjectName):
Project! @hasRole(roles: [ADMIN], level: PROJECT, type: PROJECT)
2020-04-10 04:40:22 +02:00
}
input NewProject {
userID: UUID!
teamID: UUID!
2020-04-10 04:40:22 +02:00
name: String!
}
input UpdateProjectName {
projectID: UUID!
name: String!
2020-04-10 04:40:22 +02:00
}
input DeleteProject {
projectID: UUID!
2020-04-10 04:40:22 +02:00
}
type DeleteProjectPayload {
ok: Boolean!
project: Project!
2020-04-10 04:40:22 +02:00
}
extend type Mutation {
createProjectLabel(input: NewProjectLabel!):
ProjectLabel! @hasRole(roles: [ADMIN], level: PROJECT, type: PROJECT)
deleteProjectLabel(input: DeleteProjectLabel!):
ProjectLabel! @hasRole(roles: [ADMIN], level: PROJECT, type: PROJECT)
updateProjectLabel(input: UpdateProjectLabel!):
ProjectLabel! @hasRole(roles: [ADMIN], level: PROJECT, type: PROJECT)
updateProjectLabelName(input: UpdateProjectLabelName!):
ProjectLabel! @hasRole(roles: [ADMIN], level: PROJECT, type: PROJECT)
updateProjectLabelColor(input: UpdateProjectLabelColor!):
ProjectLabel! @hasRole(roles: [ADMIN], level: PROJECT, type: PROJECT)
2020-04-11 21:24:45 +02:00
}
input NewProjectLabel {
projectID: UUID!
labelColorID: UUID!
name: String
2020-04-11 21:24:45 +02:00
}
input DeleteProjectLabel {
projectLabelID: UUID!
2020-06-19 01:12:15 +02:00
}
input UpdateProjectLabelName {
projectLabelID: UUID!
2020-06-19 01:12:15 +02:00
name: String!
}
input UpdateProjectLabel {
projectLabelID: UUID!
labelColorID: UUID!
2020-06-19 01:12:15 +02:00
name: String!
}
input UpdateProjectLabelColor {
projectLabelID: UUID!
labelColorID: UUID!
2020-04-20 05:02:55 +02:00
}
extend type Mutation {
createProjectMember(input: CreateProjectMember!):
CreateProjectMemberPayload! @hasRole(roles: [ADMIN], level: PROJECT, type: PROJECT)
deleteProjectMember(input: DeleteProjectMember!):
DeleteProjectMemberPayload! @hasRole(roles: [ADMIN], level: PROJECT, type: PROJECT)
updateProjectMemberRole(input: UpdateProjectMemberRole!):
UpdateProjectMemberRolePayload! @hasRole(roles: [ADMIN], level: PROJECT, type: PROJECT)
}
input CreateProjectMember {
projectID: UUID!
2020-04-21 01:04:27 +02:00
userID: UUID!
}
type CreateProjectMemberPayload {
ok: Boolean!
member: Member!
2020-04-20 05:02:55 +02:00
}
input DeleteProjectMember {
projectID: UUID!
userID: UUID!
2020-04-20 05:02:55 +02:00
}
type DeleteProjectMemberPayload {
ok: Boolean!
member: Member!
projectID: UUID!
2020-04-20 05:02:55 +02:00
}
input UpdateProjectMemberRole {
2020-04-21 01:04:27 +02:00
projectID: UUID!
userID: UUID!
roleCode: RoleCode!
2020-04-21 01:04:27 +02:00
}
type UpdateProjectMemberRolePayload {
ok: Boolean!
member: Member!
}
extend type Mutation {
createTask(input: NewTask!): Task!
deleteTask(input: DeleteTaskInput!): DeleteTaskPayload!
updateTaskDescription(input: UpdateTaskDescriptionInput!): Task!
updateTaskLocation(input: NewTaskLocation!): UpdateTaskLocationPayload!
updateTaskName(input: UpdateTaskName!): Task!
setTaskComplete(input: SetTaskComplete!): Task!
updateTaskDueDate(input: UpdateTaskDueDate!): Task!
assignTask(input: AssignTaskInput): Task!
unassignTask(input: UnassignTaskInput): Task!
}
input NewTask {
taskGroupID: String!
name: String!
position: Float!
}
input AssignTaskInput {
2020-05-31 06:11:19 +02:00
taskID: UUID!
userID: UUID!
2020-05-31 06:11:19 +02:00
}
input UnassignTaskInput {
taskID: UUID!
userID: UUID!
2020-05-31 06:11:19 +02:00
}
input UpdateTaskDescriptionInput {
taskID: UUID!
description: String!
2020-05-31 06:11:19 +02:00
}
type UpdateTaskLocationPayload {
previousTaskGroupID: UUID!
task: Task!
}
2020-06-13 00:21:58 +02:00
2020-06-16 00:36:59 +02:00
input UpdateTaskDueDate {
taskID: UUID!
dueDate: Time
}
2020-06-19 01:12:15 +02:00
input SetTaskComplete {
taskID: UUID!
complete: Boolean!
}
input NewTaskLocation {
taskID: UUID!
taskGroupID: UUID!
position: Float!
}
input DeleteTaskInput {
taskID: String!
}
type DeleteTaskPayload {
taskID: String!
}
input UpdateTaskName {
taskID: String!
name: String!
}
extend type Mutation {
createTaskChecklist(input: CreateTaskChecklist!): TaskChecklist!
deleteTaskChecklist(input: DeleteTaskChecklist!): DeleteTaskChecklistPayload!
updateTaskChecklistName(input: UpdateTaskChecklistName!): TaskChecklist!
createTaskChecklistItem(input: CreateTaskChecklistItem!): TaskChecklistItem!
updateTaskChecklistItemName(input: UpdateTaskChecklistItemName!): TaskChecklistItem!
setTaskChecklistItemComplete(input: SetTaskChecklistItemComplete!): TaskChecklistItem!
deleteTaskChecklistItem(input: DeleteTaskChecklistItem!): DeleteTaskChecklistItemPayload!
2020-07-12 09:06:11 +02:00
updateTaskChecklistLocation(input: UpdateTaskChecklistLocation!): UpdateTaskChecklistLocationPayload!
updateTaskChecklistItemLocation(input: UpdateTaskChecklistItemLocation!): UpdateTaskChecklistItemLocationPayload!
}
input UpdateTaskChecklistItemLocation {
checklistID: UUID!
checklistItemID: UUID!
position: Float!
}
type UpdateTaskChecklistItemLocationPayload {
checklistID: UUID!
prevChecklistID: UUID!
checklistItem: TaskChecklistItem!
}
input UpdateTaskChecklistLocation {
checklistID: UUID!
position: Float!
}
type UpdateTaskChecklistLocationPayload {
checklist: TaskChecklist!
}
2020-06-19 01:12:15 +02:00
input CreateTaskChecklist {
taskID: UUID!
name: String!
position: Float!
}
type DeleteTaskChecklistItemPayload {
ok: Boolean!
taskChecklistItem: TaskChecklistItem!
}
2020-06-19 01:12:15 +02:00
input CreateTaskChecklistItem {
taskChecklistID: UUID!
name: String!
position: Float!
}
input SetTaskChecklistItemComplete {
taskChecklistItemID: UUID!
complete: Boolean!
}
2020-06-19 01:12:15 +02:00
input DeleteTaskChecklistItem {
taskChecklistItemID: UUID!
}
input UpdateTaskChecklistItemName {
taskChecklistItemID: UUID!
name: String!
}
input UpdateTaskChecklistName {
taskChecklistID: UUID!
name: String!
}
input DeleteTaskChecklist {
taskChecklistID: UUID!
}
type DeleteTaskChecklistPayload {
ok: Boolean!
taskChecklist: TaskChecklist!
}
extend type Mutation {
createTaskGroup(input: NewTaskGroup!): TaskGroup!
updateTaskGroupLocation(input: NewTaskGroupLocation!): TaskGroup!
updateTaskGroupName(input: UpdateTaskGroupName!): TaskGroup!
deleteTaskGroup(input: DeleteTaskGroupInput!): DeleteTaskGroupPayload!
}
input NewTaskGroupLocation {
taskGroupID: UUID!
position: Float!
}
input UpdateTaskGroupName {
taskGroupID: UUID!
name: String!
}
input DeleteTaskGroupInput {
taskGroupID: UUID!
}
type DeleteTaskGroupPayload {
ok: Boolean!
affectedRows: Int!
taskGroup: TaskGroup!
}
input NewTaskGroup {
projectID: String!
name: String!
position: Float!
}
input AddTaskLabelInput {
taskID: UUID!
projectLabelID: UUID!
}
input RemoveTaskLabelInput {
taskLabelID: UUID!
}
input ToggleTaskLabelInput {
taskID: UUID!
projectLabelID: UUID!
}
type ToggleTaskLabelPayload {
active: Boolean!
task: Task!
}
extend type Mutation {
addTaskLabel(input: AddTaskLabelInput): Task!
removeTaskLabel(input: RemoveTaskLabelInput): Task!
toggleTaskLabel(input: ToggleTaskLabelInput!): ToggleTaskLabelPayload!
}
extend type Mutation {
deleteTeam(input: DeleteTeam!):
DeleteTeamPayload! @hasRole(roles:[ ADMIN], level: TEAM, type: TEAM)
createTeam(input: NewTeam!):
Team! @hasRole(roles: [ADMIN], level: ORG, type: ORG)
}
input NewTeam {
name: String!
organizationID: UUID!
}
input DeleteTeam {
teamID: UUID!
}
type DeleteTeamPayload {
ok: Boolean!
team: Team!
projects: [Project!]!
}
extend type Mutation {
createTeamMember(input: CreateTeamMember!): CreateTeamMemberPayload! @hasRole(roles: [ADMIN], level: TEAM, type: TEAM)
updateTeamMemberRole(input: UpdateTeamMemberRole!):
UpdateTeamMemberRolePayload! @hasRole(roles: [ADMIN], level: TEAM, type: TEAM)
deleteTeamMember(input: DeleteTeamMember!): DeleteTeamMemberPayload! @hasRole(roles: [ADMIN], level: TEAM, type: TEAM)
}
input DeleteTeamMember {
teamID: UUID!
userID: UUID!
2020-07-12 09:06:11 +02:00
newOwnerID: UUID
}
type DeleteTeamMemberPayload {
teamID: UUID!
userID: UUID!
2020-07-12 09:06:11 +02:00
affectedProjects: [Project!]!
}
input CreateTeamMember {
userID: UUID!
teamID: UUID!
}
type CreateTeamMemberPayload {
team: Team!
teamMember: Member!
}
input UpdateTeamMemberRole {
teamID: UUID!
userID: UUID!
roleCode: RoleCode!
}
type UpdateTeamMemberRolePayload {
ok: Boolean!
teamID: UUID!
member: Member!
}
extend type Mutation {
createRefreshToken(input: NewRefreshToken!): RefreshToken!
createUserAccount(input: NewUserAccount!):
UserAccount! @hasRole(roles: [ADMIN], level: ORG, type: ORG)
deleteUserAccount(input: DeleteUserAccount!):
DeleteUserAccountPayload! @hasRole(roles: [ADMIN], level: ORG, type: ORG)
logoutUser(input: LogoutUser!): Boolean!
2020-06-13 00:21:58 +02:00
clearProfileAvatar: UserAccount!
2020-07-12 09:06:11 +02:00
2020-07-16 01:20:08 +02:00
updateUserPassword(input: UpdateUserPassword!): UpdateUserPasswordPayload!
updateUserRole(input: UpdateUserRole!):
UpdateUserRolePayload! @hasRole(roles: [ADMIN], level: ORG, type: ORG)
2020-07-12 09:06:11 +02:00
}
2020-07-16 01:20:08 +02:00
input UpdateUserPassword {
userID: UUID!
password: String!
}
type UpdateUserPasswordPayload {
ok: Boolean!
user: UserAccount!
}
2020-07-12 09:06:11 +02:00
input UpdateUserRole {
userID: UUID!
roleCode: RoleCode!
}
type UpdateUserRolePayload {
user: UserAccount!
}
2020-04-11 21:24:45 +02:00
input NewRefreshToken {
userId: String!
}
2020-04-11 21:24:45 +02:00
input NewUserAccount {
username: String!
email: String!
fullName: String!
initials: String!
password: String!
roleCode: String!
}
2020-04-20 05:02:55 +02:00
input LogoutUser {
userID: String!
}
2020-06-19 01:12:15 +02:00
input DeleteUserAccount {
userID: UUID!
2020-07-18 04:55:38 +02:00
newOwnerID: UUID
}
2020-04-11 21:24:45 +02:00
type DeleteUserAccountPayload {
ok: Boolean!
userAccount: UserAccount!
2020-04-10 04:40:22 +02:00
}