API 참조
포모도로
기능 지원은 app.capabilities, 인가는 app.access와 호스트 권한으로 확인하세요. 예제는 합성 값을 사용합니다. 호출 전에 경로, ID, 입력, 필터를 바꾸세요.
타입 정의
graphql
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!
}작업
subscription
pomodoroSettingsChanged
포모도로 설정 변경 시 변경 신호를 받습니다.
graphql
subscription pomodoroSettingsChanged {
pomodoroSettingsChanged
}subscription
pomodoroAction
포모도로 타이머 작업 업데이트를 받습니다.
graphql
subscription pomodoroAction {
pomodoroAction { completedState }
}mutation
pausePomodoro
실행 중인 포모도로 타이머를 일시 중지합니다.
graphql
mutation pausePomodoro {
pausePomodoro { date completedCount currentRound timeLeftSec totalTimeSec isRunning isPaused state }
}mutation
setPomodoroRemainingTime
실행 중이거나 일시 중지된 타이머의 남은 시간을 0부터 현재 라운드 길이 사이의 초 단위 값으로 설정합니다.
graphql
mutation setPomodoroRemainingTime($remainingSec: Int!) {
setPomodoroRemainingTime(remainingSec: $remainingSec) { date completedCount currentRound timeLeftSec totalTimeSec isRunning isPaused state }
}mutation
startPomodoro
제공된 초 단위 길이로 포모도로 타이머를 시작합니다.
graphql
mutation startPomodoro($durationSec: Int!) {
startPomodoro(durationSec: $durationSec) { date completedCount currentRound timeLeftSec totalTimeSec isRunning isPaused state }
}mutation
stopPomodoro
포모도로 타이머를 중지하고 현재 라운드를 초기화합니다.
graphql
mutation stopPomodoro {
stopPomodoro { date completedCount currentRound timeLeftSec totalTimeSec isRunning isPaused state }
}query
pomodoroSettings
저장된 포모도로 설정(시간, 자동 시작 플래그, 라운드)을 가져옵니다.
graphql
query pomodoroSettings {
pomodoroSettings { workDurationMin shortBreakDurationMin longBreakDurationMin pomodorosBeforeLongBreak showNotification playSoundOnComplete soundPath originalSoundName }
}query
pomodoroToday
오늘의 실행 정보인 완료 라운드, 현재 단계, 남은 시간, 실행 상태를 가져옵니다.
graphql
query pomodoroToday {
pomodoroToday { date completedCount currentRound timeLeftSec totalTimeSec isRunning isPaused state }
}