Fetch all label and highlight info when doing library updates

This commit is contained in:
Jackson Harper 2023-04-21 12:33:23 +08:00
parent 4b87f1dd20
commit 52f302f5b0
4 changed files with 10 additions and 16 deletions

View file

@ -22,13 +22,10 @@ query Search($after: String, $first: Int, $query: String) {
originalArticleUrl
uploadFileId
labels {
id
name
color
...LabelFields
}
highlights {
id
type
...HighlightFields
}
pageId
shortId

View file

@ -24,13 +24,10 @@ query UpdatesSince($after: String, $first: Int, $since: Date!) {
originalArticleUrl
uploadFileId
labels {
id
name
color
...LabelFields
}
highlights {
id
type
...HighlightFields
}
pageId
shortId

View file

@ -76,9 +76,9 @@ suspend fun DataService.sync(since: String, cursor: String?, limit: Int = 20): S
for (item in syncResult.items) {
val itemLabels = (item.labels ?: listOf()).map {
SavedItemLabel(
savedItemLabelId = it.id,
name = it.name,
color = it.color,
savedItemLabelId = it.labelFields.id,
name = it.labelFields.name,
color = it.labelFields.color,
createdAt = null,
labelDescription = null
)

View file

@ -91,9 +91,9 @@ suspend fun Networker.search(
),
labels = (it.node.labels ?: listOf()).map { label ->
SavedItemLabel(
savedItemLabelId = label.id,
name = label.name,
color = label.color,
savedItemLabelId = label.labelFields.id,
name = label.labelFields.name,
color = label.labelFields.color,
createdAt = null,
labelDescription = null
)