Tham chiếu API
Yêu thí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 {
addFavoriteFolder(rootPath: String!, fullPath: String!): [FavoriteFolder!]!
removeFavoriteFolder(fullPath: String!): [FavoriteFolder!]!
setFavoriteFolderAlias(fullPath: String!, alias: String!): [FavoriteFolder!]!
}
type Query {
favoriteFolders: [FavoriteFolder!]!
}
type FavoriteFolder {
rootPath: String!
fullPath: String!
alias: String
}Thao tác
mutation
addFavoriteFolder
Đánh dấu thư mục để truy cập nhanh. Trả về danh sách cập nhật của mọi thư mục được đánh dấu.
graphql
# Register a favorite folder and return the whole list.
mutation addFavoriteFolder($rootPath: String!, $fullPath: String!) {
addFavoriteFolder(rootPath: $rootPath, fullPath: $fullPath) { rootPath fullPath alias }
}mutation
removeFavoriteFolder
Bỏ thư mục được đánh dấu. Trả về danh sách cập nhật các thư mục còn lại.
graphql
# Remove the favorite folder identified by `fullPath` and return the
# whole list.
mutation removeFavoriteFolder($fullPath: String!) {
removeFavoriteFolder(fullPath: $fullPath) { rootPath fullPath alias }
}mutation
setFavoriteFolderAlias
Đặt hoặc cập nhật bí danh hiển thị cho thư mục được đánh dấu. Truyền chuỗi rỗng để xóa bí danh.
graphql
# Set the favorite folder's display alias and return the whole list; error if the favorite does not exist.
mutation setFavoriteFolderAlias($fullPath: String!, $alias: String!) {
setFavoriteFolderAlias(fullPath: $fullPath, alias: $alias) { rootPath fullPath alias }
}query
favoriteFolders
Liệt kê thư mục yêu thích đã lưu và bí danh.
graphql
# List all favorite folders.
query favoriteFolders {
favoriteFolders { rootPath fullPath alias }
}