Справочник API

Избранное

Поддержку функций проверяйте через app.capabilities, доступ — через app.access и разрешения хоста. Замените тестовые значения перед вызовом.

Определения типов

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 }
}