Tham chiếu API

Ghi chú

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

graphql
type Mutation {
  createNote(input: NoteInput!): Note!
  deleteNotes(query: String!): ActionResult!
  restoreNotes(query: String!): ActionResult!
  saveFeedEntriesToNotes(query: String!): [ID!]!
  trashNotes(query: String!): ActionResult!
  updateNote(id: ID!, input: NoteInput!): Note!
}

type Query {
  exportNotes(query: String!): String!
  note(id: ID!): Note
  noteCount(query: String!): Int!
  notes(query: String!, offset: Int!, limit: Int!): [Note!]!
}

type ActionResult {
	affectedCount: Int!
}

enum DataType {
	DEFAULT
	AUDIO
	VIDEO
	IMAGE
	SMS
	CONTACT
	NOTE
	FEED_ENTRY
	CALL
	PACKAGE
	FILE
	APP_FILE
	DOC
}

scalar Instant

type Note {
	id: ID!
	title: String!
	content: String!
	deletedAt: Instant
	createdAt: Instant!
	updatedAt: Instant!
	tags: [Tag!]!
}

input NoteInput {
	title: String!
	content: String!
}

type Tag {
	id: ID!
	name: String!
	type: DataType!
	count: Int!
}

Thao tác

mutation

createNote

Tạo và lưu bền vững ghi chú từ đầu vào được cung cấp.

graphql
mutation createNote($input: NoteInput!) {
  createNote(input: $input) { id title content deletedAt createdAt updatedAt }
}
mutation

deleteNotes

Xóa vĩnh viễn ghi chú trong thùng rác khớp truy vấn. Chỉ thao tác trên ghi chú đã ở trong thùng rác.

graphql
mutation deleteNotes($query: String!) {
  deleteNotes(query: $query) { affectedCount }
}
mutation

restoreNotes

Khôi phục ghi chú trong thùng rác khớp truy vấn.

graphql
mutation restoreNotes($query: String!) {
  restoreNotes(query: $query) { affectedCount }
}
mutation

saveFeedEntriesToNotes

Lưu các mục nguồn tin khớp thành ghi chú và trả về ID ghi chú đã tạo.

graphql
mutation saveFeedEntriesToNotes($query: String!) {
  saveFeedEntriesToNotes(query: $query)
}
mutation

trashNotes

Chuyển ghi chú khớp truy vấn vào thùng rác.

graphql
mutation trashNotes($query: String!) {
  trashNotes(query: $query) { affectedCount }
}
mutation

updateNote

Cập nhật ghi chú đã lưu từ đầu vào được cung cấp.

graphql
mutation updateNote($id: ID!, $input: NoteInput!) {
  updateNote(id: $id, input: $input) { id title content deletedAt createdAt updatedAt }
}
query

exportNotes

Tuần tự hóa ghi chú khớp truy vấn (gồm thẻ) thành chuỗi JSON để sao lưu/chuyển giao.

graphql
query exportNotes($query: String!) {
  exportNotes(query: $query)
}
query

note

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

graphql
query note($id: ID!) {
  note(id: $id) { id title content deletedAt createdAt updatedAt }
}
query

noteCount

Đếm ghi chú khớp truy vấn.

graphql
query noteCount($query: String!) {
  noteCount(query: $query)
}
query

notes

Tìm ghi chú (tiêu đề + nội dung). Để query rỗng để liệt kê mọi ghi chú ngoài thùng rác.

graphql
query notes($query: String!, $offset: Int!, $limit: Int!) {
  notes(query: $query, offset: $offset, limit: $limit) { id title content deletedAt createdAt updatedAt }
}