Справочник API

Ленты (RSS)

Подписывайтесь на RSS/Atom-ленты, получайте записи и сохраняйте статьи в заметки. Поддерживает импорт/экспорт OPML.

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

bash
type Feed {
  id: ID!
  url: String!                # RSS/Atom URL
  name: String!               # display name (defaults to feed title)
  fetchContent: Boolean!      # when true, the server fetches the full article body
  updatedAt: String!
}

type FeedCount {
  feedId: ID!
  count: Int!                 # total entries
  unreadCount: Int!
}

type FeedEntry {
  id: ID!
  feedId: ID!
  title: String!
  description: String!        # short summary
  content: String!            # full article body (may be empty until fetched)
  url: String!                # canonical article URL
  publishedAt: String!        # ISO 8601
  read: Boolean!
  favorite: Boolean!
  tags: [Tag!]!
}

Операции

query

feeds

Список всех подписанных лент.

bash
query GetFeeds {
  feeds { id url name fetchContent updatedAt }
}
query

feedsCount

Общее количество записей и количество непрочитанных на ленту.

bash
query GetFeedsCount {
  feedsCount { feedId count unreadCount }
}
query

feedEntries

Поиск записей ленты (заголовок + описание). Оставьте запрос пустым, чтобы перечислить все.

bash
query GetFeedEntries($offset: Int!, $limit: Int!, $query: String!) {
  feedEntries(offset: $offset, limit: $limit, query: $query) {
    id feedId title description content url publishedAt read favorite
    tags { id name }
  }
}
query

feedEntryCount

Подсчитайте записи ленты, соответствующие запросу.

bash
query GetFeedEntryCount($query: String!) {
  feedEntryCount(query: $query)
}
query

feedEntry

Получите одну запись ленты по ID.

bash
query GetFeedEntry($id: ID!) {
  feedEntry(id: $id) { id feedId title description content url publishedAt read favorite }
}
mutation

createFeed

Подпишитесь на новую ленту. Сервер получает RSS-канал для заполнения имени, затем запускает одноразовую синхронизацию.

bash
mutation CreateFeed($url: String!, $fetchContent: Boolean!) {
  createFeed(url: $url, fetchContent: $fetchContent) { id url name fetchContent updatedAt }
}
mutation

updateFeed

Обновите отображаемое имя ленты или флаг fetchContent.

bash
mutation UpdateFeed($id: ID!, $name: String!, $fetchContent: Boolean!) {
  updateFeed(id: $id, name: $name, fetchContent: $fetchContent) { id url name fetchContent updatedAt }
}
mutation

deleteFeed

Отпишитесь от ленты и удалите все её записи (и их связи тегов).

bash
mutation DeleteFeed($id: ID!) {
  deleteFeed(id: $id)
}
mutation

syncFeeds

Запустите одноразовый воркер синхронизации лент. Передайте id для синхронизации одной ленты; передайте null или пусто для синхронизации всех.

bash
mutation SyncFeeds($id: ID) {
  syncFeeds(id: $id)
}
mutation

syncFeedEntryContent

Fetch the full article body for a single feed entry. Returns the updated entry.

bash
mutation SyncFeedEntryContent($id: ID!) {
  syncFeedEntryContent(id: $id) { id content }
}
mutation

deleteFeedEntries

Удалите записи ленты, соответствующие запросу (и их связи тегов).

bash
mutation DeleteFeedEntries($query: String!) {
  deleteFeedEntries(query: $query)
}
mutation

importFeeds

Импортируйте OPML-документ (как строку) в базу лент.

bash
mutation ImportFeeds($content: String!) {
  importFeeds(content: $content)
}
mutation

exportFeeds

Экспортируйте все подписанные ленты как OPML-строку.

bash
mutation ExportFeeds {
  exportFeeds
}