omnivore/packages/web/lib/networking/mutations/articleReadingProgressMutation.ts

41 lines
1 KiB
TypeScript
Raw Permalink Normal View History

2022-02-11 17:24:33 +00:00
import { gql } from 'graphql-request'
import { gqlFetcher } from '../networkHelpers'
export type ArticleReadingProgressMutationInput = {
2022-02-11 17:24:33 +00:00
id: string
force?: boolean
readingProgressPercent?: number
2023-03-10 07:05:03 +00:00
readingProgressTopPercent?: number
readingProgressAnchorIndex?: number
2022-02-11 17:24:33 +00:00
}
2024-07-29 13:27:49 +00:00
// export async function articleReadingProgressMutation(
// input: ArticleReadingProgressMutationInput
// ): Promise<boolean> {
// const mutation = gql`
// mutation SaveArticleReadingProgress(
// $input: SaveArticleReadingProgressInput!
// ) {
// saveArticleReadingProgress(input: $input) {
// ... on SaveArticleReadingProgressSuccess {
// updatedArticle {
// id
// readingProgressPercent
// readingProgressAnchorIndex
// }
// }
// ... on SaveArticleReadingProgressError {
// errorCodes
// }
// }
// }
// `
2022-02-11 17:24:33 +00:00
2024-07-29 13:27:49 +00:00
// try {
// await gqlFetcher(mutation, { input })
// return true
// } catch {
// return false
// }
// }