API リファレンス
Pomodoro
内蔵の Pomodoro タイマーを制御します: 設定の読み取り、今日の進捗の確認、現在のセッションの開始/一時停止/停止。
型定義
bash
type PomodoroSettings {
workDuration: Int! # minutes
shortBreak: Int! # minutes
longBreak: Int! # minutes
roundsBeforeLongBreak: Int!
autoStartBreaks: Boolean!
autoStartWork: Boolean!
}
type PomodoroToday {
date: String! # ISO date (YYYY-MM-DD)
completedCount: Int! # completed work rounds today
currentRound: Int!
timeLeft: Int! # seconds remaining in the current phase
totalTime: Int! # seconds elapsed in the current phase
isRunning: Boolean!
isPause: Boolean!
state: PomodoroState! # WORK | SHORT_BREAK | LONG_BREAK | PAUSED
}
enum PomodoroState {
WORK
SHORT_BREAK
LONG_BREAK
PAUSED
}操作
query
pomodoroSettings
保存された Pomodoro 設定 (時間、自動開始フラグ、ラウンド) を取得します。
bash
query GetPomodoroSettings {
pomodoroSettings {
workDuration shortBreak longBreak roundsBeforeLongBreak
autoStartBreaks autoStartWork
}
}query
pomodoroToday
今日のランタイム情報を取得します: 完了したラウンド数、現在のフェーズ、残り時間、実行状態。
bash
query GetPomodoroToday {
pomodoroToday {
date completedCount currentRound timeLeft totalTime isRunning isPause state
}
}mutation
startPomodoro
Pomodoro タイマーを開始します。timeLeft (秒) を渡すと一時停止状態から再開、0 を渡すと新しく開始します。
bash
mutation StartPomodoro($timeLeft: Int!) {
startPomodoro(timeLeft: $timeLeft)
}mutation
pausePomodoro
実行中の Pomodoro タイマーを一時停止します。
bash
mutation PausePomodoro {
pausePomodoro
}mutation
stopPomodoro
Pomodoro タイマーを停止し、現在のラウンドをリセットします。
bash
mutation StopPomodoro {
stopPomodoro
}