プロジェクト内のtodoリストを管理する - リストの作成、編集、削除、およびクエリ
概要
Blueのリストは、プロジェクト内のtodoを整理するためのコンテナです。各リストは複数のtodoを保持でき、作業を論理的なグループに構造化するのに役立ちます。リストは、位置付け、ロック、および役割ベースのアクセス制御をサポートしています。
主要概念
- 各プロジェクトには最大50リストを持つことができます
- リストは位置(昇順)で順序付けられます
- リストは変更を防ぐためにロックできます
- リストはプロジェクトレベルおよび役割ベースの権限を尊重します
- 削除されたリストはゴミ箱に移動されます(ソフト削除)
クエリ
単一リストの取得
IDによって特定のtodoリストを取得します。
query GetTodoList($id: String!) {
todoList(id: $id) {
id
uid
title
position
isDisabled
isLocked
createdAt
updatedAt
project {
id
name
}
createdBy {
id
username
}
}
}
プロジェクト内のすべてのリストの取得
特定のプロジェクトのすべてのtodoリストを取得します。
query GetProjectLists($projectId: String!) {
todoLists(projectId: $projectId) {
id
uid
title
position
isDisabled
isLocked
createdAt
updatedAt
}
}
高度なリストクエリ
フィルタリング、ソート、およびページネーションを使用してリストをクエリします。
query SearchTodoLists($filter: TodoListsFilterInput!, $sort: [TodoListsSort!], $skip: Int, $take: Int) {
todoListQueries {
todoLists(filter: $filter, sort: $sort, skip: $skip, take: $take) {
items {
id
uid
title
position
isDisabled
isLocked
createdAt
updatedAt
project {
id
name
}
}
pageInfo {
hasNextPage
hasPreviousPage
total
}
}
}
}
ミューテーション
リストの作成
プロジェクト内に新しいtodoリストを作成します。
mutation CreateTodoList($input: CreateTodoListInput!) {
createTodoList(input: $input) {
id
uid
title
position
isDisabled
isLocked
createdAt
project {
id
name
}
}
}
例:
mutation {
createTodoList(input: {
projectId: "project-123"
title: "Sprint 1 Tasks"
position: 1.0
}) {
id
title
}
}
リストの編集
既存のtodoリストのプロパティを更新します。
mutation EditTodoList($input: EditTodoListInput!) {
editTodoList(input: $input) {
id
title
position
isLocked
updatedAt
}
}
例:
mutation {
editTodoList(input: {
todoListId: "list-123"
title: "Sprint 1 - In Progress"
position: 2.0
isLocked: true
}) {
id
title
isLocked
}
}
リストの削除
todoリストを削除します(ゴミ箱に移動します)。
mutation DeleteTodoList($input: DeleteTodoListInput!) {
deleteTodoList(input: $input) {
success
}
}
例:
mutation {
deleteTodoList(input: {
projectId: "project-123"
todoListId: "list-123"
}) {
success
}
}
リストを完了/未完了としてマーク
リスト内のすべてのtodoを完了または未完了としてマークします。
# Mark as done
mutation MarkListDone($todoListId: String!, $filter: TodosFilter) {
markTodoListAsDone(todoListId: $todoListId, filter: $filter)
}
# Mark as undone
mutation MarkListUndone($todoListId: String!, $filter: TodosFilter) {
markTodoListAsUndone(todoListId: $todoListId, filter: $filter)
}
入力タイプ
CreateTodoListInput
パラメータ | タイプ | 必須 | 説明 |
---|---|---|---|
projectId |
String! | ✅ はい | リストが作成されるプロジェクトのID |
title |
String! | ✅ はい | リストの名前 |
position |
Float! | ✅ はい | リストの位置(順序付け用) |
EditTodoListInput
パラメータ | タイプ | 必須 | 説明 |
---|---|---|---|
todoListId |
String! | ✅ はい | 編集するリストのID |
title |
String | いいえ | リストの新しいタイトル |
position |
Float | いいえ | リストの新しい位置 |
isLocked |
Boolean | いいえ | リストをロックするかどうか |
DeleteTodoListInput
パラメータ | タイプ | 必須 | 説明 |
---|---|---|---|
projectId |
String! | ✅ はい | プロジェクトのID(確認用) |
todoListId |
String! | ✅ はい | 削除するリストのID |
TodoListsFilterInput
パラメータ | タイプ | 必須 | 説明 |
---|---|---|---|
companyIds |
[String!]! | ✅ はい | 会社IDでフィルタリング |
projectIds |
[String!] | いいえ | 特定のプロジェクトIDでフィルタリング |
ids |
[String!] | いいえ | 特定のリストIDでフィルタリング |
titles |
[String!] | いいえ | リストタイトルでフィルタリング |
search |
String | いいえ | タイトルでリストを検索 |
TodoListsSort 値
値 | 説明 |
---|---|
title_ASC |
タイトルを昇順でソート |
title_DESC |
タイトルを降順でソート |
createdAt_ASC |
作成日を昇順でソート |
createdAt_DESC |
作成日を降順でソート |
updatedAt_ASC |
更新日を昇順でソート |
updatedAt_DESC |
更新日を降順でソート |
position_ASC |
位置を昇順でソート(デフォルト) |
position_DESC |
位置を降順でソート |
レスポンスタイプ
TodoList タイプ
フィールド | タイプ | 説明 |
---|---|---|
id |
ID! | 一意の識別子 |
uid |
String! | ユーザーフレンドリーな識別子 |
position |
Float! | 順序付け用のリスト位置 |
title |
String! | リスト名 |
isDisabled |
Boolean! | リストが無効かどうか |
isLocked |
Boolean | リストがロックされているかどうか |
createdAt |
DateTime! | 作成タイムスタンプ |
updatedAt |
DateTime! | 最後の更新タイムスタンプ |
activity |
Activity | 関連するアクティビティログ |
createdBy |
User | リストを作成したユーザー |
project |
Project! | 親プロジェクト |
todos |
[Todo!]! | このリスト内のtodos |
todosCount |
Int! | todosの数 |
TodoListsPagination タイプ
フィールド | タイプ | 説明 |
---|---|---|
items |
[TodoList!]! | todoリストの配列 |
pageInfo |
PageInfo! | ページネーション情報 |
必要な権限
クエリ権限
操作 | 必要な権限 |
---|---|
todoList |
Must be authenticated |
todoLists |
Must be authenticated and in company |
todoListQueries.todoLists |
Must be authenticated and in company |
ミューテーション権限
操作 | プロジェクトレベルの役割の許可 |
---|---|
createTodoList |
OWNER, ADMIN, MEMBER |
editTodoList |
OWNER, ADMIN, MEMBER, CLIENT |
deleteTodoList |
OWNER, ADMIN, MEMBER |
markTodoListAsDone |
OWNER, ADMIN, MEMBER |
markTodoListAsUndone |
OWNER, ADMIN, MEMBER |
注意: CLIENT役割を持つユーザーはリストを編集できますが、作成または削除することはできません。VIEW_ONLYまたはCOMMENT_ONLY役割を持つユーザーはリストを作成、編集、または削除することはできません。
エラーレスポンス
TodoListNotFoundError
{
"errors": [{
"message": "Todo list was not found.",
"extensions": {
"code": "TODO_LIST_NOT_FOUND"
}
}]
}
ProjectNotFoundError
{
"errors": [{
"message": "Project was not found.",
"extensions": {
"code": "PROJECT_NOT_FOUND"
}
}]
}
最大リストエラー
{
"errors": [{
"message": "You have reached the maximum number of todo lists for this project.",
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
}
}]
}
UnauthorizedError
{
"errors": [{
"message": "Unauthorized",
"extensions": {
"code": "UNAUTHORIZED"
}
}]
}
重要な注意事項
- リスト制限: 各プロジェクトには最大50リストを持つことができます
- ソフト削除: 削除されたリストはゴミ箱に移動され、回復可能です
- 位置管理: リストを作成する際は、位置が競合しないようにしてください。リストの間に挿入できるように、増分値(1.0、2.0、3.0)を使用してください
- 役割ベースのアクセス: リストはProjectUserRoleTodoList権限を使用して特定の役割から隠すことができます
- Webhook: リストの作成、更新、削除は、設定されている場合にWebhookをトリガーします
- アクティビティトラッキング: すべてのリスト操作はアクティビティフィードに記録されます
- リアルタイム更新: リストの変更は、リアルタイム更新のためにサブスクリプションを通じて公開されます
関連操作
todos
クエリを使用してリスト内のtodosを取得しますcreateTodo
ミューテーションを使用してリストにtodosを追加しますmoveTodo
ミューテーションを使用してリスト間でtodosを移動しますsubscribeToTodoList
サブスクリプションを使用してリストの変更を購読します