API 参考

Notes

存储在设备上的 Markdown 笔记。支持标签、回收站/恢复和导出。

类型定义

bash
type Note {
  id: ID!
  title: String!
  content: String!            # Markdown body
  createdAt: String!          # ISO 8601
  updatedAt: String!
  trashed: Boolean!           # true when in trash
  tags: [Tag!]!
}

input NoteInput {
  title: String
  content: String
}

操作

query

notes

搜索笔记(标题 + 内容)。查询留空可列出所有未删除的笔记。

bash
query GetNotes($offset: Int!, $limit: Int!, $query: String!) {
  notes(offset: $offset, limit: $limit, query: $query) {
    id title content createdAt updatedAt trashed
    tags { id name }
  }
}
query

noteCount

统计匹配查询的笔记数量。

bash
query GetNoteCount($query: String!) {
  noteCount(query: $query)
}
query

note

按 ID 获取单个笔记。

bash
query GetNote($id: ID!) {
  note(id: $id) { id title content createdAt updatedAt trashed tags { id name } }
}
mutation

saveNote

创建或更新笔记。传入空 id 以创建;传入已有 id 以更新。

bash
mutation SaveNote($id: ID!, $input: NoteInput!) {
  saveNote(id: $id, input: $input) { id title updatedAt }
}
mutation

saveFeedEntriesToNotes

Bulk-save feed entries matching a query as notes (title = feed entry title, content = "# <title>\n\n<body>"). Returns the saved feed entry IDs.

bash
mutation SaveFeedEntriesToNotes($query: String!) {
  saveFeedEntriesToNotes(query: $query)
}
mutation

trashNotes

将匹配查询的笔记移至回收站。

bash
mutation TrashNotes($query: String!) {
  trashNotes(query: $query)
}
mutation

restoreNotes

恢复回收站中匹配查询的笔记。

bash
mutation RestoreNotes($query: String!) {
  restoreNotes(query: $query)
}
mutation

deleteNotes

永久删除回收站中匹配查询的笔记。仅对已在回收站中的笔记操作。

bash
mutation DeleteNotes($query: String!) {
  deleteNotes(query: $query)
}
mutation

exportNotes

将匹配查询的笔记(含标签)序列化为 JSON 字符串,用于备份/传输。

bash
mutation ExportNotes($query: String!) {
  exportNotes(query: $query)
}