stacker.news/fragments/comments.js
SatsAllDay 4596681fbc
Toast on delete bot directive usage (#620)
* Toast on successful delete bot directive

* refactor duplicate code into a reusable function

* restore empty spacing lines to clean up the diff

* perf optimization, only query for deleteScheduledAt for your own items

* Issue a warning toast if the delete bot was mentioned but the item was not scheduled for deletion

* use bs-secondary color for warning

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-11-19 15:09:47 -06:00

86 lines
1.4 KiB
JavaScript

import { gql } from '@apollo/client'
export const COMMENT_FIELDS = gql`
fragment CommentFields on Item {
id
parentId
createdAt
deletedAt
deleteScheduledAt
text
user {
id
name
optional {
streak
}
meMute
}
sats
meAnonSats @client
upvotes
wvotes
boost
meSats
meDontLike
meBookmark
meSubscription
outlawed
freebie
path
commentSats
mine
otsHash
ncomments
imgproxyUrls
}
`
export const COMMENTS_ITEM_EXT_FIELDS = gql`
fragment CommentItemExtFields on Item {
text
root {
id
title
bounty
bountyPaidTo
subName
user {
name
optional {
streak
}
id
}
}
}`
// we only get the first COMMENT_DEPTH_LIMIT comments
export const COMMENTS = gql`
${COMMENT_FIELDS}
fragment CommentsRecursive on Item {
...CommentFields
comments {
...CommentFields
comments {
...CommentFields
comments {
...CommentFields
comments {
...CommentFields
comments {
...CommentFields
comments {
...CommentFields
comments {
...CommentFields
}
}
}
}
}
}
}
}`