Tham chiếu API

Notes

Ghi chú Markdown được lưu trữ cục bộ trên thiết bị. Hỗ trợ gắn thẻ, thùng rác/khôi phục và xuất.

Định nghĩa kiểu

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
}

Thao tác

query

notes

Tìm kiếm ghi chú (tiêu đề + nội dung). Để query trống để liệt kê tất cả ghi chú không trong thùng rác.

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

Đếm ghi chú khớp với một query.

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

note

Lấy một ghi chú duy nhất theo ID.

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

saveNote

Tạo hoặc cập nhật ghi chú. Truyền id trống để tạo; truyền id hiện có để cập nhật.

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

Chuyển ghi chú khớp với một query vào thùng rác.

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

restoreNotes

Khôi phục ghi chú đã xóa khớp với một query.

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

deleteNotes

Xóa vĩnh viễn ghi chú đã xóa khớp với một query. Chỉ hoạt động trên ghi chú đã trong thùng rác.

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

exportNotes

Tuần tự hóa ghi chú khớp với một query (bao gồm thẻ) dưới dạng chuỗi JSON để sao lưu/chuyển.

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