mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #737 from omnivore-app/chore/graphql-schema-update
Update gql schema and fix errors [Apple]
This commit is contained in:
commit
4e60a2d878
28 changed files with 17145 additions and 15090 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -24,16 +24,16 @@ extension DataService {
|
|||
|
||||
let selection = Selection<MutationResult, Unions.ArchiveLinkResult> {
|
||||
try $0.on(
|
||||
archiveLinkSuccess: .init { .success(linkId: try $0.linkId()) },
|
||||
archiveLinkError: .init { .error(errorCode: try $0.errorCodes().first ?? .badRequest) }
|
||||
archiveLinkError: .init { .error(errorCode: try $0.errorCodes().first ?? .badRequest) },
|
||||
archiveLinkSuccess: .init { .success(linkId: try $0.linkId()) }
|
||||
)
|
||||
}
|
||||
|
||||
let mutation = Selection.Mutation {
|
||||
try $0.setLinkArchived(
|
||||
input: InputObjects.ArchiveLinkInput(
|
||||
linkId: itemID,
|
||||
archived: archived
|
||||
archived: archived,
|
||||
linkId: itemID
|
||||
),
|
||||
selection: selection
|
||||
)
|
||||
|
|
|
|||
|
|
@ -40,22 +40,22 @@ extension DataService {
|
|||
|
||||
let selection = Selection<MutationResult, Unions.CreateHighlightResult> {
|
||||
try $0.on(
|
||||
createHighlightError: .init { .error(errorCode: try $0.errorCodes().first ?? .badData) },
|
||||
createHighlightSuccess: .init {
|
||||
.saved(highlight: try $0.highlight(selection: highlightSelection))
|
||||
},
|
||||
createHighlightError: .init { .error(errorCode: try $0.errorCodes().first ?? .badData) }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
let mutation = Selection.Mutation {
|
||||
try $0.createHighlight(
|
||||
input: InputObjects.CreateHighlightInput(
|
||||
id: highlight.id,
|
||||
shortId: highlight.shortId,
|
||||
annotation: OptionalArgument(highlight.annotation),
|
||||
articleId: articleId,
|
||||
id: highlight.id,
|
||||
patch: highlight.patch,
|
||||
quote: highlight.quote,
|
||||
annotation: OptionalArgument(highlight.annotation)
|
||||
shortId: highlight.shortId
|
||||
),
|
||||
selection: selection
|
||||
)
|
||||
|
|
|
|||
|
|
@ -34,17 +34,17 @@ extension DataService {
|
|||
|
||||
let selection = Selection<MutationResult, Unions.CreateLabelResult> {
|
||||
try $0.on(
|
||||
createLabelSuccess: .init { .saved(label: try $0.label(selection: feedItemLabelSelection)) },
|
||||
createLabelError: .init { .error(errorCode: try $0.errorCodes().first ?? .badRequest) }
|
||||
createLabelError: .init { .error(errorCode: try $0.errorCodes().first ?? .badRequest) },
|
||||
createLabelSuccess: .init { .saved(label: try $0.label(selection: feedItemLabelSelection)) }
|
||||
)
|
||||
}
|
||||
|
||||
let mutation = Selection.Mutation {
|
||||
try $0.createLabel(
|
||||
input: InputObjects.CreateLabelInput(
|
||||
name: label.name,
|
||||
color: label.color,
|
||||
description: OptionalArgument(label.labelDescription)
|
||||
description: OptionalArgument(label.labelDescription),
|
||||
name: label.name
|
||||
),
|
||||
selection: selection
|
||||
)
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@ public extension DataService {
|
|||
|
||||
let selection = Selection<MutationResult, Unions.CreateNewsletterEmailResult> {
|
||||
try $0.on(
|
||||
createNewsletterEmailError: .init {
|
||||
.error(errorCode: try $0.errorCodes().first ?? .badRequest)
|
||||
},
|
||||
createNewsletterEmailSuccess: .init {
|
||||
.saved(newsletterEmail: try $0.newsletterEmail(selection: Selection.NewsletterEmail {
|
||||
InternalNewsletterEmail(
|
||||
|
|
@ -20,9 +23,6 @@ public extension DataService {
|
|||
confirmationCode: try $0.confirmationCode()
|
||||
)
|
||||
}))
|
||||
},
|
||||
createNewsletterEmailError: .init {
|
||||
.error(errorCode: try $0.errorCodes().first ?? .badRequest)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,21 +37,21 @@ public extension DataService {
|
|||
|
||||
let selection = Selection<MutationResult, Unions.CreateReminderResult> {
|
||||
try $0.on(
|
||||
createReminderError: .init { .error(errorCode: try $0.errorCodes().first ?? .badRequest) },
|
||||
createReminderSuccess: .init {
|
||||
.complete(id: try $0.reminder(selection: Selection.Reminder { try $0.id() }))
|
||||
},
|
||||
createReminderError: .init { .error(errorCode: try $0.errorCodes().first ?? .badRequest) }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
let mutation = Selection.Mutation {
|
||||
try $0.createReminder(
|
||||
input: InputObjects.CreateReminderInput(
|
||||
linkId: OptionalArgument(reminderItemId.linkId),
|
||||
clientRequestId: OptionalArgument(reminderItemId.clientRequestId),
|
||||
archiveUntil: true,
|
||||
sendNotification: true,
|
||||
remindAt: DateTime(from: remindAt)
|
||||
clientRequestId: OptionalArgument(reminderItemId.clientRequestId),
|
||||
linkId: OptionalArgument(reminderItemId.linkId),
|
||||
remindAt: DateTime(from: remindAt),
|
||||
sendNotification: true
|
||||
),
|
||||
selection: selection
|
||||
)
|
||||
|
|
|
|||
|
|
@ -30,10 +30,10 @@ public extension DataService {
|
|||
|
||||
let selection = Selection<MutationResult, Unions.DeleteHighlightResult> {
|
||||
try $0.on(
|
||||
deleteHighlightError: .init { .error(errorCode: try $0.errorCodes().first ?? .unauthorized) },
|
||||
deleteHighlightSuccess: .init {
|
||||
.saved(id: try $0.highlight(selection: Selection.Highlight { try $0.id() }))
|
||||
},
|
||||
deleteHighlightError: .init { .error(errorCode: try $0.errorCodes().first ?? .unauthorized) }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ public extension DataService {
|
|||
|
||||
let selection = Selection<MutationResult, Unions.UnsubscribeResult> {
|
||||
try $0.on(
|
||||
unsubscribeSuccess: .init { .success(id: try $0.subscription(selection: Selection.Subscription { try $0.id() })) },
|
||||
unsubscribeError: .init { .error(errorMessage: (try $0.errorCodes().first ?? .unauthorized).rawValue) }
|
||||
unsubscribeError: .init { .error(errorMessage: (try $0.errorCodes().first ?? .unauthorized).rawValue) },
|
||||
unsubscribeSuccess: .init { .success(id: try $0.subscription(selection: Selection.Subscription { try $0.id() })) }
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ public extension DataService {
|
|||
|
||||
let selection = Selection<MutationResult, Unions.SetDeviceTokenResult> {
|
||||
try $0.on(
|
||||
setDeviceTokenError: .init { .error(errorCode: try $0.errorCodes().first ?? .badRequest) },
|
||||
setDeviceTokenSuccess: .init {
|
||||
.saved(id: try $0.deviceToken(selection: Selection.DeviceToken { try $0.id() }))
|
||||
},
|
||||
setDeviceTokenError: .init { .error(errorCode: try $0.errorCodes().first ?? .badRequest) }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,25 +46,25 @@ extension DataService {
|
|||
|
||||
let selection = Selection<MutationResult, Unions.MergeHighlightResult> {
|
||||
try $0.on(
|
||||
mergeHighlightError: .init { .error(errorCode: try $0.errorCodes().first ?? .badData) },
|
||||
mergeHighlightSuccess: .init {
|
||||
.saved(highlight: try $0.highlight(selection: highlightSelection))
|
||||
},
|
||||
mergeHighlightError: .init { .error(errorCode: try $0.errorCodes().first ?? .badData) }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
let mutation = Selection.Mutation {
|
||||
try $0.mergeHighlight(
|
||||
input: InputObjects.MergeHighlightInput(
|
||||
id: highlight.id,
|
||||
shortId: highlight.shortId,
|
||||
articleId: articleId,
|
||||
patch: highlight.patch,
|
||||
quote: highlight.quote,
|
||||
prefix: .absent(),
|
||||
suffix: .absent(),
|
||||
annotation: .absent(),
|
||||
overlapHighlightIdList: overlapHighlightIdList
|
||||
articleId: articleId,
|
||||
id: highlight.id,
|
||||
overlapHighlightIdList: overlapHighlightIdList,
|
||||
patch: highlight.patch,
|
||||
prefix: .absent(),
|
||||
quote: highlight.quote,
|
||||
shortId: highlight.shortId,
|
||||
suffix: .absent()
|
||||
),
|
||||
selection: selection
|
||||
)
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@ extension DataService {
|
|||
|
||||
let selection = Selection<MutationResult, Unions.DeleteLabelResult> {
|
||||
try $0.on(
|
||||
deleteLabelError: .init { .error(errorCode: try $0.errorCodes().first ?? .badRequest) },
|
||||
deleteLabelSuccess: .init {
|
||||
.success(labelID: try $0.label(selection: Selection.Label { try $0.id() }))
|
||||
},
|
||||
deleteLabelError: .init { .error(errorCode: try $0.errorCodes().first ?? .badRequest) }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,14 +24,14 @@ extension DataService {
|
|||
|
||||
let selection = Selection<MutationResult, Unions.SetBookmarkArticleResult> {
|
||||
try $0.on(
|
||||
setBookmarkArticleError: .init { .error(errorCode: try $0.errorCodes().first ?? .notFound) },
|
||||
setBookmarkArticleSuccess: .init {
|
||||
.success(
|
||||
linkId: try $0.bookmarkedArticle(selection: Selection.Article {
|
||||
try $0.id()
|
||||
})
|
||||
)
|
||||
},
|
||||
setBookmarkArticleError: .init { .error(errorCode: try $0.errorCodes().first ?? .notFound) }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ public extension Networker {
|
|||
|
||||
let selection = Selection<QueryResult, Unions.ArticleSavingRequestResult> {
|
||||
try $0.on(
|
||||
articleSavingRequestError: .init { .error(errorCode: (try? $0.errorCodes().first) ?? .notFound) },
|
||||
articleSavingRequestSuccess: .init {
|
||||
.saved(
|
||||
status: try $0.articleSavingRequest(
|
||||
|
|
@ -40,8 +41,7 @@ public extension Networker {
|
|||
}
|
||||
)
|
||||
)
|
||||
},
|
||||
articleSavingRequestError: .init { .error(errorCode: (try? $0.errorCodes().first) ?? .notFound) }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -102,15 +102,15 @@ public extension DataService {
|
|||
}()
|
||||
|
||||
let input = InputObjects.CreateArticleInput(
|
||||
url: pageScrapePayload.url,
|
||||
preparedDocument: OptionalArgument(preparedDocument),
|
||||
uploadFileId: uploadFileId != nil ? .present(uploadFileId!) : .null()
|
||||
uploadFileId: uploadFileId != nil ? .present(uploadFileId!) : .null(),
|
||||
url: pageScrapePayload.url
|
||||
)
|
||||
|
||||
let selection = Selection<MutationResult, Unions.CreateArticleResult> {
|
||||
try $0.on(
|
||||
createArticleSuccess: .init { .saved(created: try $0.created()) },
|
||||
createArticleError: .init { .error(errorCode: (try? $0.errorCodes().first) ?? .unableToParse) }
|
||||
createArticleError: .init { .error(errorCode: (try? $0.errorCodes().first) ?? .unableToParse) },
|
||||
createArticleSuccess: .init { .saved(created: try $0.created()) }
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -163,6 +163,7 @@ public extension DataService {
|
|||
|
||||
let selection = Selection<MutationResult, Unions.CreateArticleSavingRequestResult> {
|
||||
try $0.on(
|
||||
createArticleSavingRequestError: .init { .error(errorCode: (try? $0.errorCodes().first) ?? .badData) },
|
||||
createArticleSavingRequestSuccess: .init {
|
||||
.saved(
|
||||
status: try $0.articleSavingRequest(
|
||||
|
|
@ -174,8 +175,7 @@ public extension DataService {
|
|||
}
|
||||
)
|
||||
)
|
||||
},
|
||||
createArticleSavingRequestError: .init { .error(errorCode: (try? $0.errorCodes().first) ?? .badData) }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,14 +17,15 @@ public extension DataService {
|
|||
}
|
||||
|
||||
let input = InputObjects.UploadFileRequestInput(
|
||||
url: url,
|
||||
clientRequestId: OptionalArgument(id),
|
||||
contentType: "application/pdf",
|
||||
createPageEntry: OptionalArgument(true),
|
||||
clientRequestId: OptionalArgument(id)
|
||||
url: url
|
||||
)
|
||||
|
||||
let selection = Selection<MutationResult, Unions.UploadFileRequestResult> {
|
||||
try $0.on(
|
||||
uploadFileRequestError: .init { .error(errorCode: try? $0.errorCodes().first) },
|
||||
uploadFileRequestSuccess: .init {
|
||||
.success(
|
||||
payload: UploadFileRequestPayload(
|
||||
|
|
@ -33,8 +34,7 @@ public extension DataService {
|
|||
urlString: try $0.uploadSignedUrl()
|
||||
)
|
||||
)
|
||||
},
|
||||
uploadFileRequestError: .init { .error(errorCode: try? $0.errorCodes().first) }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -120,16 +120,16 @@ public extension DataService {
|
|||
}
|
||||
|
||||
let input = InputObjects.SaveFileInput(
|
||||
url: url,
|
||||
source: "ios-file",
|
||||
clientRequestId: requestId,
|
||||
uploadFileId: uploadFileId
|
||||
source: "ios-file",
|
||||
uploadFileId: uploadFileId,
|
||||
url: url
|
||||
)
|
||||
|
||||
let selection = Selection<MutationResult, Unions.SaveResult> {
|
||||
try $0.on(
|
||||
saveSuccess: .init { .saved(requestId: requestId, url: (try? $0.url()) ?? "") },
|
||||
saveError: .init { .error(errorCode: (try? $0.errorCodes().first) ?? .unknown) }
|
||||
saveError: .init { .error(errorCode: (try? $0.errorCodes().first) ?? .unknown) },
|
||||
saveSuccess: .init { .saved(requestId: requestId, url: (try? $0.url()) ?? "") }
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,19 +10,17 @@ public extension DataService {
|
|||
}
|
||||
|
||||
let input = InputObjects.SavePageInput(
|
||||
url: url,
|
||||
source: "ios-page",
|
||||
clientRequestId: id,
|
||||
originalContent: originalHtml,
|
||||
source: "ios-page",
|
||||
title: OptionalArgument(title),
|
||||
originalContent: originalHtml
|
||||
url: url
|
||||
)
|
||||
|
||||
let selection = Selection<MutationResult, Unions.SaveResult> {
|
||||
try $0.on(
|
||||
saveSuccess: .init { .saved(requestId: id, url: (try? $0.url()) ?? "") },
|
||||
saveError: .init {
|
||||
.error(errorCode: (try? $0.errorCodes().first) ?? .unknown)
|
||||
}
|
||||
saveError: .init { .error(errorCode: (try? $0.errorCodes().first) ?? .unknown) },
|
||||
saveSuccess: .init { .saved(requestId: id, url: (try? $0.url()) ?? "") }
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,15 +10,15 @@ public extension DataService {
|
|||
}
|
||||
|
||||
let input = InputObjects.SaveUrlInput(
|
||||
url: url,
|
||||
clientRequestId: id,
|
||||
source: "ios-url",
|
||||
clientRequestId: id
|
||||
url: url
|
||||
)
|
||||
|
||||
let selection = Selection<MutationResult, Unions.SaveResult> {
|
||||
try $0.on(
|
||||
saveSuccess: .init { .saved(requestId: id, url: (try? $0.url()) ?? "") },
|
||||
saveError: .init { .error(errorCode: (try? $0.errorCodes().first) ?? .unknown) }
|
||||
saveError: .init { .error(errorCode: (try? $0.errorCodes().first) ?? .unknown) },
|
||||
saveSuccess: .init { .saved(requestId: id, url: (try? $0.url()) ?? "") }
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,16 +32,16 @@ extension DataService {
|
|||
|
||||
let selection = Selection<MutationResult, Unions.SetLabelsResult> {
|
||||
try $0.on(
|
||||
setLabelsSuccess: .init { .saved(feedItem: try $0.labels(selection: feedItemLabelSelection.list)) },
|
||||
setLabelsError: .init { .error(errorCode: try $0.errorCodes().first ?? .badRequest) }
|
||||
setLabelsError: .init { .error(errorCode: try $0.errorCodes().first ?? .badRequest) },
|
||||
setLabelsSuccess: .init { .saved(feedItem: try $0.labels(selection: feedItemLabelSelection.list)) }
|
||||
)
|
||||
}
|
||||
|
||||
let mutation = Selection.Mutation {
|
||||
try $0.setLabels(
|
||||
input: InputObjects.SetLabelsInput(
|
||||
pageId: itemID,
|
||||
labelIds: labelIDs
|
||||
labelIds: labelIDs,
|
||||
pageId: itemID
|
||||
),
|
||||
selection: selection
|
||||
)
|
||||
|
|
|
|||
|
|
@ -33,12 +33,12 @@ extension DataService {
|
|||
|
||||
let selection = Selection<MutationResult, Unions.SaveArticleReadingProgressResult> {
|
||||
try $0.on(
|
||||
saveArticleReadingProgressError: .init { .error(errorCode: try $0.errorCodes().first ?? .badData) },
|
||||
saveArticleReadingProgressSuccess: .init {
|
||||
.saved(
|
||||
readingProgress: try $0.updatedArticle(selection: Selection.Article { try $0.readingProgressPercent() })
|
||||
)
|
||||
},
|
||||
saveArticleReadingProgressError: .init { .error(errorCode: try $0.errorCodes().first ?? .badData) }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -46,8 +46,8 @@ extension DataService {
|
|||
try $0.saveArticleReadingProgress(
|
||||
input: InputObjects.SaveArticleReadingProgressInput(
|
||||
id: itemID,
|
||||
readingProgressPercent: readingProgress,
|
||||
readingProgressAnchorIndex: anchorIndex
|
||||
readingProgressAnchorIndex: anchorIndex,
|
||||
readingProgressPercent: readingProgress
|
||||
),
|
||||
selection: selection
|
||||
)
|
||||
|
|
|
|||
|
|
@ -31,18 +31,18 @@ extension DataService {
|
|||
|
||||
let selection = Selection<MutationResult, Unions.UpdateHighlightResult> {
|
||||
try $0.on(
|
||||
updateHighlightError: .init { .error(errorCode: try $0.errorCodes().first ?? .badData) },
|
||||
updateHighlightSuccess: .init {
|
||||
.saved(highlight: try $0.highlight(selection: highlightSelection))
|
||||
},
|
||||
updateHighlightError: .init { .error(errorCode: try $0.errorCodes().first ?? .badData) }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
let mutation = Selection.Mutation {
|
||||
try $0.updateHighlight(
|
||||
input: InputObjects.UpdateHighlightInput(
|
||||
highlightId: highlightID,
|
||||
annotation: OptionalArgument(annotation),
|
||||
highlightId: highlightID,
|
||||
sharedAt: OptionalArgument(nil)
|
||||
),
|
||||
selection: selection
|
||||
|
|
|
|||
|
|
@ -125,17 +125,17 @@ extension DataService {
|
|||
|
||||
let selection = Selection<QueryResult, Unions.ArticleResult> {
|
||||
try $0.on(
|
||||
articleSuccess: .init {
|
||||
QueryResult.success(result: try $0.article(selection: articleContentSelection))
|
||||
},
|
||||
articleError: .init {
|
||||
QueryResult.error(error: try $0.errorCodes().description)
|
||||
},
|
||||
articleSuccess: .init {
|
||||
QueryResult.success(result: try $0.article(selection: articleContentSelection))
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
let query = Selection.Query {
|
||||
try $0.article(username: username, slug: itemID, selection: selection)
|
||||
try $0.article(slug: itemID, username: username, selection: selection)
|
||||
}
|
||||
|
||||
let path = appEnvironment.graphqlPath
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@ public extension DataService {
|
|||
|
||||
let selection = Selection<QueryResult, Unions.LabelsResult> {
|
||||
try $0.on(
|
||||
labelsSuccess: .init {
|
||||
QueryResult.success(result: try $0.labels(selection: feedItemLabelSelection.list))
|
||||
},
|
||||
labelsError: .init {
|
||||
QueryResult.error(error: try $0.errorCodes().description)
|
||||
},
|
||||
labelsSuccess: .init {
|
||||
QueryResult.success(result: try $0.labels(selection: feedItemLabelSelection.list))
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@ public extension DataService {
|
|||
|
||||
let selection = Selection<QueryResult, Unions.ArticlesResult> {
|
||||
try $0.on(
|
||||
articlesError: .init {
|
||||
QueryResult.error(error: try $0.errorCodes().description)
|
||||
},
|
||||
articlesSuccess: .init {
|
||||
QueryResult.success(
|
||||
result: InternalHomeFeedData(
|
||||
|
|
@ -33,25 +36,23 @@ public extension DataService {
|
|||
})
|
||||
)
|
||||
)
|
||||
},
|
||||
articlesError: .init {
|
||||
QueryResult.error(error: try $0.errorCodes().description)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
let query = Selection.Query {
|
||||
try $0.articles(
|
||||
after: OptionalArgument(cursor),
|
||||
first: OptionalArgument(limit),
|
||||
includePending: OptionalArgument(true),
|
||||
query: OptionalArgument(searchQuery),
|
||||
sharedOnly: .present(false),
|
||||
sort: OptionalArgument(
|
||||
InputObjects.SortParams(
|
||||
order: .present(.descending), by: .updatedTime
|
||||
by: .updatedTime,
|
||||
order: .present(.descending)
|
||||
)
|
||||
),
|
||||
after: OptionalArgument(cursor),
|
||||
first: OptionalArgument(limit),
|
||||
query: OptionalArgument(searchQuery),
|
||||
includePending: OptionalArgument(true),
|
||||
selection: selection
|
||||
)
|
||||
}
|
||||
|
|
@ -117,18 +118,18 @@ public extension DataService {
|
|||
|
||||
let selection = Selection<QueryResult, Unions.ArticleResult> {
|
||||
try $0.on(
|
||||
articleSuccess: .init {
|
||||
QueryResult.success(result: try $0.article(selection: articleSelection))
|
||||
},
|
||||
articleError: .init {
|
||||
QueryResult.error(error: try $0.errorCodes().description)
|
||||
},
|
||||
articleSuccess: .init {
|
||||
QueryResult.success(result: try $0.article(selection: articleSelection))
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
let query = Selection.Query {
|
||||
// backend has a hack that allows us to pass in itemID in place of slug
|
||||
try $0.article(username: username, slug: itemID, selection: selection)
|
||||
try $0.article(slug: itemID, username: username, selection: selection)
|
||||
}
|
||||
|
||||
let path = appEnvironment.graphqlPath
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@ extension DataService {
|
|||
|
||||
let selection = Selection<QueryResult, Unions.SearchResult> {
|
||||
try $0.on(
|
||||
searchError: .init {
|
||||
QueryResult.error(error: try $0.errorCodes().description)
|
||||
},
|
||||
searchSuccess: .init {
|
||||
QueryResult.success(
|
||||
result: LinkedItemIDFetchResult(
|
||||
|
|
@ -29,9 +32,6 @@ extension DataService {
|
|||
})
|
||||
)
|
||||
)
|
||||
},
|
||||
searchError: .init {
|
||||
QueryResult.error(error: try $0.errorCodes().description)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,11 +20,11 @@ public extension DataService {
|
|||
|
||||
let selection = Selection<QueryResult, Unions.NewsletterEmailsResult> {
|
||||
try $0.on(
|
||||
newsletterEmailsSuccess: .init {
|
||||
QueryResult.success(result: try $0.newsletterEmails(selection: newsletterEmailSelection.list))
|
||||
},
|
||||
newsletterEmailsError: .init {
|
||||
QueryResult.error(error: try $0.errorCodes().description)
|
||||
},
|
||||
newsletterEmailsSuccess: .init {
|
||||
QueryResult.success(result: try $0.newsletterEmails(selection: newsletterEmailSelection.list))
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,11 +26,11 @@ public extension DataService {
|
|||
|
||||
let selection = Selection<QueryResult, Unions.SubscriptionsResult> {
|
||||
try $0.on(
|
||||
subscriptionsSuccess: .init {
|
||||
QueryResult.success(result: try $0.subscriptions(selection: subsciptionSelection.list))
|
||||
},
|
||||
subscriptionsError: .init {
|
||||
QueryResult.error(error: try $0.errorCodes().description)
|
||||
},
|
||||
subscriptionsSuccess: .init {
|
||||
QueryResult.success(result: try $0.subscriptions(selection: subsciptionSelection.list))
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,6 +121,7 @@ export type Article = {
|
|||
title: Scalars['String'];
|
||||
unsubHttpUrl?: Maybe<Scalars['String']>;
|
||||
unsubMailTo?: Maybe<Scalars['String']>;
|
||||
updatedAt: Scalars['Date'];
|
||||
uploadFileId?: Maybe<Scalars['ID']>;
|
||||
url: Scalars['String'];
|
||||
};
|
||||
|
|
@ -764,6 +765,7 @@ export type Link = {
|
|||
shareInfo: LinkShareInfo;
|
||||
shareStats: ShareStats;
|
||||
slug: Scalars['String'];
|
||||
updatedAt: Scalars['Date'];
|
||||
url: Scalars['String'];
|
||||
};
|
||||
|
||||
|
|
@ -1181,6 +1183,7 @@ export type Page = {
|
|||
readableHtml: Scalars['String'];
|
||||
title: Scalars['String'];
|
||||
type: PageType;
|
||||
updatedAt: Scalars['Date'];
|
||||
url: Scalars['String'];
|
||||
};
|
||||
|
||||
|
|
@ -1522,6 +1525,7 @@ export type SearchItem = {
|
|||
title: Scalars['String'];
|
||||
unsubHttpUrl?: Maybe<Scalars['String']>;
|
||||
unsubMailTo?: Maybe<Scalars['String']>;
|
||||
updatedAt: Scalars['Date'];
|
||||
uploadFileId?: Maybe<Scalars['ID']>;
|
||||
url: Scalars['String'];
|
||||
};
|
||||
|
|
@ -3038,6 +3042,7 @@ export type ArticleResolvers<ContextType = ResolverContext, ParentType extends R
|
|||
title?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
|
||||
unsubHttpUrl?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
unsubMailTo?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
updatedAt?: Resolver<ResolversTypes['Date'], ParentType, ContextType>;
|
||||
uploadFileId?: Resolver<Maybe<ResolversTypes['ID']>, ParentType, ContextType>;
|
||||
url?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
|
|
@ -3501,6 +3506,7 @@ export type LinkResolvers<ContextType = ResolverContext, ParentType extends Reso
|
|||
shareInfo?: Resolver<ResolversTypes['LinkShareInfo'], ParentType, ContextType>;
|
||||
shareStats?: Resolver<ResolversTypes['ShareStats'], ParentType, ContextType>;
|
||||
slug?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
|
||||
updatedAt?: Resolver<ResolversTypes['Date'], ParentType, ContextType>;
|
||||
url?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
};
|
||||
|
|
@ -3642,6 +3648,7 @@ export type PageResolvers<ContextType = ResolverContext, ParentType extends Reso
|
|||
readableHtml?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
|
||||
title?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
|
||||
type?: Resolver<ResolversTypes['PageType'], ParentType, ContextType>;
|
||||
updatedAt?: Resolver<ResolversTypes['Date'], ParentType, ContextType>;
|
||||
url?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
};
|
||||
|
|
@ -3808,6 +3815,7 @@ export type SearchItemResolvers<ContextType = ResolverContext, ParentType extend
|
|||
title?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
|
||||
unsubHttpUrl?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
unsubMailTo?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
updatedAt?: Resolver<ResolversTypes['Date'], ParentType, ContextType>;
|
||||
uploadFileId?: Resolver<Maybe<ResolversTypes['ID']>, ParentType, ContextType>;
|
||||
url?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ type Article {
|
|||
title: String!
|
||||
unsubHttpUrl: String
|
||||
unsubMailTo: String
|
||||
updatedAt: Date!
|
||||
uploadFileId: ID
|
||||
url: String!
|
||||
}
|
||||
|
|
@ -675,6 +676,7 @@ type Link {
|
|||
shareInfo: LinkShareInfo!
|
||||
shareStats: ShareStats!
|
||||
slug: String!
|
||||
updatedAt: Date!
|
||||
url: String!
|
||||
}
|
||||
|
||||
|
|
@ -840,6 +842,7 @@ type Page {
|
|||
readableHtml: String!
|
||||
title: String!
|
||||
type: PageType!
|
||||
updatedAt: Date!
|
||||
url: String!
|
||||
}
|
||||
|
||||
|
|
@ -1085,6 +1088,7 @@ type SearchItem {
|
|||
title: String!
|
||||
unsubHttpUrl: String
|
||||
unsubMailTo: String
|
||||
updatedAt: Date!
|
||||
uploadFileId: ID
|
||||
url: String!
|
||||
}
|
||||
|
|
|
|||
|
|
@ -270,6 +270,7 @@ const schema = gql`
|
|||
slug: String!
|
||||
savedBy: User!
|
||||
savedAt: Date!
|
||||
updatedAt: Date!
|
||||
savedByViewer: Boolean!
|
||||
postedByViewer: Boolean!
|
||||
|
||||
|
|
@ -308,6 +309,7 @@ const schema = gql`
|
|||
originalHtml: String!
|
||||
readableHtml: String!
|
||||
createdAt: Date!
|
||||
updatedAt: Date!
|
||||
}
|
||||
|
||||
type Article {
|
||||
|
|
@ -327,6 +329,7 @@ const schema = gql`
|
|||
originalHtml: String
|
||||
createdAt: Date!
|
||||
savedAt: Date!
|
||||
updatedAt: Date!
|
||||
publishedAt: Date
|
||||
readingProgressPercent: Float!
|
||||
readingProgressAnchorIndex: Int!
|
||||
|
|
@ -1449,6 +1452,7 @@ const schema = gql`
|
|||
pageType: PageType!
|
||||
contentReader: ContentReader!
|
||||
createdAt: Date!
|
||||
updatedAt: Date!
|
||||
isArchived: Boolean!
|
||||
readingProgressPercent: Float
|
||||
readingProgressAnchorIndex: Int
|
||||
|
|
|
|||
Loading…
Reference in a new issue