Lesezeichen
Funktionsunterstützung über app.capabilities prüfen, Autorisierung über app.access und Host-Berechtigungen. Die Beispiele verwenden synthetische Werte; vor dem Aufruf Pfade, IDs, Eingaben und Filter ersetzen.
Typdefinitionen
type Mutation {
addBookmarks(urls: [String!]!, groupId: ID!): [Bookmark!]!
createBookmarkGroup(name: String!): BookmarkGroup!
deleteBookmarkGroup(id: ID!): Boolean!
deleteBookmarks(ids: [ID!]!): ActionResult!
importBookmarks(content: String!): ActionResult!
recordBookmarkClick(id: ID!): Boolean!
updateBookmark(id: ID!, input: BookmarkInput!): Bookmark!
updateBookmarkGroup(id: ID!, name: String!, collapsed: Boolean!, sortOrder: Int!): BookmarkGroup!
}
type Query {
bookmark(id: ID!): Bookmark
bookmarkGroups: [BookmarkGroup!]!
bookmarks: [Bookmark!]!
pageMetadata(url: String!): PageMetadata!
}
type Subscription {
bookmarksUpdated: [Bookmark!]!
}
type ActionResult {
affectedCount: Int!
}
type Bookmark {
id: ID!
url: String!
title: String!
faviconPath: String!
groupId: ID!
pinned: Boolean!
clickCount: Int!
sortOrder: Int!
createdAt: Instant!
updatedAt: Instant!
lastClickedAt: Instant
}
type BookmarkGroup {
id: ID!
name: String!
collapsed: Boolean!
sortOrder: Int!
itemCount: Int!
createdAt: Instant!
updatedAt: Instant!
}
input BookmarkInput {
url: String!
title: String!
faviconUrl: String
groupId: ID!
pinned: Boolean!
sortOrder: Int!
}
scalar Instant
type PageMetadata {
title: String
faviconUrl: String
}Operationen
addBookmarks
Erstellt Lesezeichen für die übergebenen URLs in der angegebenen Gruppe.
mutation addBookmarks($urls: [String!]!, $groupId: ID!) {
addBookmarks(urls: $urls, groupId: $groupId) { id url title faviconPath groupId pinned clickCount sortOrder }
}createBookmarkGroup
Erstellt eine neue Lesezeichengruppe.
mutation createBookmarkGroup($name: String!) {
createBookmarkGroup(name: $name) { id name collapsed sortOrder itemCount createdAt updatedAt }
}deleteBookmarkGroup
Löscht eine Lesezeichengruppe. Die Lesezeichen bleiben erhalten und werden nur aus der Gruppe entfernt.
mutation deleteBookmarkGroup($id: ID!) {
deleteBookmarkGroup(id: $id)
}deleteBookmarks
Löscht ein oder mehrere Lesezeichen anhand ihrer IDs.
mutation deleteBookmarks($ids: [ID!]!) {
deleteBookmarks(ids: $ids) { affectedCount }
}importBookmarks
Importiert Lesezeichen aus dem übergebenen Dokumentinhalt und meldet deren Anzahl.
mutation importBookmarks($content: String!) {
importBookmarks(content: $content) { affectedCount }
}recordBookmarkClick
Erhöht den gespeicherten Besuchszähler eines Lesezeichens.
mutation recordBookmarkClick($id: ID!) {
recordBookmarkClick(id: $id)
}updateBookmark
Aktualisiert ein oder mehrere Felder eines vorhandenen Lesezeichens.
mutation updateBookmark($id: ID!, $input: BookmarkInput!) {
updateBookmark(id: $id, input: $input) { id url title faviconPath groupId pinned clickCount sortOrder }
}updateBookmarkGroup
Aktualisiert Name, eingeklappten Zustand oder Sortierreihenfolge einer Lesezeichengruppe.
mutation updateBookmarkGroup($id: ID!, $name: String!, $collapsed: Boolean!, $sortOrder: Int!) {
updateBookmarkGroup(id: $id, name: $name, collapsed: $collapsed, sortOrder: $sortOrder) { id name collapsed sortOrder itemCount createdAt updatedAt }
}bookmark
Liest ein gespeichertes Lesezeichen anhand seiner ID; gibt null zurück, wenn es fehlt.
query bookmark($id: ID!) {
bookmark(id: $id) { id url title faviconPath groupId pinned clickCount sortOrder }
}bookmarkGroups
Listet alle Lesezeichengruppen auf.
query bookmarkGroups {
bookmarkGroups { id name collapsed sortOrder itemCount createdAt updatedAt }
}bookmarks
Listet alle Lesezeichen auf.
query bookmarks {
bookmarks { id url title faviconPath groupId pinned clickCount sortOrder }
}pageMetadata
Ruft Titel und Favicon-URL einer Webseite ab, ohne ein Lesezeichen zu speichern.
query pageMetadata($url: String!) {
pageMetadata(url: $url) { title faviconUrl }
}bookmarksUpdated
Empfängt aktualisierte Lesezeichendatensätze.
subscription bookmarksUpdated {
bookmarksUpdated { id url title faviconPath groupId pinned clickCount sortOrder }
}