Избранное
Поддержку функций проверяйте через app.capabilities, доступ — через app.access и разрешения хоста. Замените тестовые значения перед вызовом.
Определения типов
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
}Операции
addFavoriteFolder
Добавляет папку в закладки для быстрого доступа. Возвращает обновлённый список всех папок в закладках.
# Register a favorite folder and return the whole list.
mutation addFavoriteFolder($rootPath: String!, $fullPath: String!) {
addFavoriteFolder(rootPath: $rootPath, fullPath: $fullPath) { rootPath fullPath alias }
}removeFavoriteFolder
Удаляет папку из закладок. Возвращает обновлённый список оставшихся папок.
# Remove the favorite folder identified by `fullPath` and return the
# whole list.
mutation removeFavoriteFolder($fullPath: String!) {
removeFavoriteFolder(fullPath: $fullPath) { rootPath fullPath alias }
}setFavoriteFolderAlias
Задаёт или обновляет псевдоним папки в закладках. Передайте пустую строку, чтобы убрать псевдоним.
# 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 }
}favoriteFolders
Перечисляет сохранённые избранные папки и их псевдонимы.
# List all favorite folders.
query favoriteFolders {
favoriteFolders { rootPath fullPath alias }
}