API 參考
收藏
透過 app.capabilities 判斷功能支援,透過 app.access 和主機權限判斷存取授權。範例使用合成值;呼叫前請替換路徑、ID、輸入和篩選條件。
型別定義
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
}操作
mutation
addFavoriteFolder
收藏資料夾以便快速存取,回傳更新後的全部收藏資料夾。
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
移除收藏資料夾,回傳更新後的剩餘資料夾。
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
設定或更新收藏資料夾的顯示別名;傳空字串可清除別名。
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
列出已儲存的收藏資料夾及其別名。
graphql
# List all favorite folders.
query favoriteFolders {
favoriteFolders { rootPath fullPath alias }
}