stacker.news/fragments/items.js

53 lines
730 B
JavaScript
Raw Normal View History

2021-04-22 22:14:32 +00:00
import { gql } from '@apollo/client'
export const ITEM_FIELDS = gql`
fragment ItemFields on Item {
id
parentId
createdAt
title
url
user {
name
2021-08-10 22:59:06 +00:00
id
2021-04-22 22:14:32 +00:00
}
sats
2021-04-27 21:30:58 +00:00
boost
meSats
2021-04-22 22:14:32 +00:00
ncomments
2021-07-08 00:15:27 +00:00
root {
id
title
}
2021-04-22 22:14:32 +00:00
}`
2021-06-22 17:47:49 +00:00
export const MORE_ITEMS = gql`
${ITEM_FIELDS}
query MoreItems($sort: String!, $cursor: String, $userId: ID) {
moreItems(sort: $sort, cursor: $cursor, userId: $userId) {
cursor
items {
...ItemFields
}
}
} `
2021-04-22 22:14:32 +00:00
export const ITEMS_FEED = gql`
${ITEM_FIELDS}
{
items {
...ItemFields
}
}`
2021-04-24 21:05:07 +00:00
export const ITEMS_RECENT = gql`
${ITEM_FIELDS}
{
items: recent {
...ItemFields
}
}`