Pomodoro
Kiểm tra app.capabilities để biết tính năng và app.access cùng quyền máy chủ để xác định quyền truy cập. Thay giá trị mẫu trước khi gọi.
Định nghĩa kiểu
type Subscription {
pomodoroSettingsChanged: Boolean!
pomodoroAction: PomodoroAction!
}
type Mutation {
pausePomodoro: PomodoroToday!
setPomodoroRemainingTime(remainingSec: Int!): PomodoroToday!
startPomodoro(durationSec: Int!): PomodoroToday!
stopPomodoro: PomodoroToday!
}
type Query {
pomodoroSettings: PomodoroSettings!
pomodoroToday: PomodoroToday!
}
scalar Instant
type PomodoroAction {
today: PomodoroToday!
completedState: PomodoroState
}
type PomodoroSettings {
workDurationMin: Int!
shortBreakDurationMin: Int!
longBreakDurationMin: Int!
pomodorosBeforeLongBreak: Int!
showNotification: Boolean!
playSoundOnComplete: Boolean!
soundPath: String!
originalSoundName: String!
}
enum PomodoroState {
WORK
SHORT_BREAK
LONG_BREAK
}
type PomodoroToday {
date: Instant!
completedCount: Int!
currentRound: Int!
timeLeftSec: Int!
totalTimeSec: Int!
isRunning: Boolean!
isPaused: Boolean!
state: PomodoroState!
}Thao tác
pomodoroSettingsChanged
Nhận tín hiệu khi cài đặt Pomodoro thay đổi.
subscription pomodoroSettingsChanged {
pomodoroSettingsChanged
}pomodoroAction
Nhận cập nhật hành động bộ đếm Pomodoro.
subscription pomodoroAction {
pomodoroAction { completedState }
}pausePomodoro
Tạm dừng bộ đếm Pomodoro đang chạy.
mutation pausePomodoro {
pausePomodoro { date completedCount currentRound timeLeftSec totalTimeSec isRunning isPaused state }
}setPomodoroRemainingTime
Đặt thời gian còn lại theo giây của bộ đếm đang chạy hoặc tạm dừng, từ không đến độ dài vòng hiện tại.
mutation setPomodoroRemainingTime($remainingSec: Int!) {
setPomodoroRemainingTime(remainingSec: $remainingSec) { date completedCount currentRound timeLeftSec totalTimeSec isRunning isPaused state }
}startPomodoro
Bắt đầu bộ đếm Pomodoro với thời lượng giây được cung cấp.
mutation startPomodoro($durationSec: Int!) {
startPomodoro(durationSec: $durationSec) { date completedCount currentRound timeLeftSec totalTimeSec isRunning isPaused state }
}stopPomodoro
Dừng bộ đếm Pomodoro và đặt lại vòng hiện tại.
mutation stopPomodoro {
stopPomodoro { date completedCount currentRound timeLeftSec totalTimeSec isRunning isPaused state }
}pomodoroSettings
Lấy cài đặt Pomodoro đã lưu (thời lượng, cờ tự bắt đầu, vòng).
query pomodoroSettings {
pomodoroSettings { workDurationMin shortBreakDurationMin longBreakDurationMin pomodorosBeforeLongBreak showNotification playSoundOnComplete soundPath originalSoundName }
}pomodoroToday
Lấy thông tin hoạt động hôm nay: vòng hoàn tất, giai đoạn hiện tại, thời gian còn lại và trạng thái chạy.
query pomodoroToday {
pomodoroToday { date completedCount currentRound timeLeftSec totalTimeSec isRunning isPaused state }
}