omnivore/packages/web/lib/networking/fragments/highlightFragment.ts
2023-02-27 10:34:12 +08:00

53 lines
883 B
TypeScript

import { gql } from 'graphql-request'
import { Label } from './labelFragment'
export const highlightFragment = gql`
fragment HighlightFields on Highlight {
id
shortId
quote
prefix
suffix
patch
annotation
createdByMe
createdAt
updatedAt
sharedAt
highlightPositionPercent
highlightPositionAnchorIndex
labels {
id
name
color
createdAt
}
}
`
export type Highlight = {
id: string
shortId: string
quote: string
prefix?: string
suffix?: string
patch: string
annotation?: string
createdByMe: boolean
createdAt: string
updatedAt: string
sharedAt: string
labels?: Label[]
highlightPositionPercent?: number
highlightPositionAnchorIndex?: number
}
export type User = {
id: string
name: string
profile: {
id: string
pictureUrl?: string
username: string
}
}