stacker.news/api/typeDefs/item.js

128 lines
3.4 KiB
JavaScript
Raw Normal View History

2021-04-12 18:05:09 +00:00
import { gql } from 'apollo-server-micro'
export default gql`
extend type Query {
2022-12-01 22:22:13 +00:00
items(sub: String, sort: String, type: String, cursor: String, name: String, within: String): Items
2023-05-01 20:58:30 +00:00
moreFlatComments(sub: String, sort: String!, cursor: String, name: String, within: String): Comments
moreBookmarks(cursor: String, name: String!): Items
2021-04-14 23:56:29 +00:00
item(id: ID!): Item
2021-12-21 21:29:42 +00:00
comments(id: ID!, sort: String): [Item!]!
2023-01-12 18:05:47 +00:00
pageTitleAndUnshorted(url: String!): TitleUnshorted
2021-10-28 20:49:51 +00:00
dupes(url: String!): [Item!]
2023-01-12 20:30:17 +00:00
related(cursor: String, title: String, id: ID, minMatch: String, limit: Int): Items
2022-01-25 19:34:51 +00:00
allItems(cursor: String): Items
2023-01-26 16:11:55 +00:00
getBountiesByUserName(name: String!, cursor: String, , limit: Int): Items
2023-05-01 20:58:30 +00:00
search(q: String, cursor: String, what: String, sort: String, when: String): Items
2022-02-17 17:23:43 +00:00
auctionPosition(sub: String, id: ID, bid: Int!): Int!
2022-08-10 15:06:31 +00:00
itemRepetition(parentId: ID): Int!
2022-09-22 18:44:50 +00:00
outlawedItems(cursor: String): Items
2022-09-22 20:42:04 +00:00
borderlandItems(cursor: String): Items
2022-09-27 21:19:15 +00:00
freebieItems(cursor: String): Items
2022-10-25 21:35:32 +00:00
topItems(cursor: String, sort: String, when: String): Items
topComments(cursor: String, sort: String, when: String): Comments
2021-04-12 18:05:09 +00:00
}
2023-01-12 18:05:47 +00:00
type TitleUnshorted {
title: String
unshorted: String
}
2021-09-10 21:13:52 +00:00
type ItemActResult {
vote: Int!
2021-09-10 21:13:52 +00:00
sats: Int!
}
2021-04-12 18:05:09 +00:00
extend type Mutation {
bookmarkItem(id: ID): Item
2023-01-12 23:53:09 +00:00
deleteItem(id: ID): Item
2023-05-01 20:58:30 +00:00
upsertLink(id: ID, sub: String, title: String!, url: String!, boost: Int, forward: String): Item!
upsertDiscussion(id: ID, sub: String, title: String!, text: String, boost: Int, forward: String): Item!
upsertBounty(id: ID, sub: String, title: String!, text: String, bounty: Int!, boost: Int, forward: String): Item!
upsertJob(id: ID, sub: String!, title: String!, company: String!, location: String, remote: Boolean,
2022-07-21 22:55:05 +00:00
text: String!, url: String!, maxBid: Int!, status: String, logo: Int): Item!
2023-05-01 20:58:30 +00:00
upsertPoll(id: ID, sub: String, title: String!, text: String, options: [String!]!, boost: Int, forward: String): Item!
2021-04-14 00:57:32 +00:00
createComment(text: String!, parentId: ID!): Item!
2021-08-10 22:59:06 +00:00
updateComment(id: ID!, text: String!): Item!
2022-09-21 19:57:36 +00:00
dontLikeThis(id: ID!): Boolean!
act(id: ID!, sats: Int): ItemActResult!
2022-07-30 13:25:46 +00:00
pollVote(id: ID!): ID!
}
type PollOption {
id: ID,
option: String!
count: Int!
meVoted: Boolean!
}
type Poll {
meVoted: Boolean!
count: Int!
options: [PollOption!]!
2021-04-12 18:05:09 +00:00
}
2021-06-22 17:47:49 +00:00
type Items {
cursor: String
items: [Item!]!
2022-01-07 16:32:31 +00:00
pins: [Item!]
2021-06-22 17:47:49 +00:00
}
2021-06-24 23:56:01 +00:00
type Comments {
cursor: String
comments: [Item!]!
}
2021-04-12 18:05:09 +00:00
type Item {
id: ID!
2021-04-14 00:57:32 +00:00
createdAt: String!
2022-01-25 19:34:51 +00:00
updatedAt: String!
2023-01-12 23:53:09 +00:00
deletedAt: String
2021-04-14 00:57:32 +00:00
title: String
2022-02-03 22:01:42 +00:00
searchTitle: String
2021-04-14 00:57:32 +00:00
url: String
2022-02-03 22:01:42 +00:00
searchText: String
2021-04-14 00:57:32 +00:00
text: String
2021-04-14 23:56:29 +00:00
parentId: Int
2021-07-08 00:15:27 +00:00
parent: Item
root: Item
2021-04-12 18:05:09 +00:00
user: User!
2022-01-27 19:18:48 +00:00
userId: Int!
fwdUserId: Int
2022-04-19 18:32:39 +00:00
fwdUser: User
2021-04-12 18:05:09 +00:00
depth: Int!
2021-11-27 18:01:02 +00:00
mine: Boolean!
boost: Int!
2023-01-26 16:11:55 +00:00
bounty: Int
2023-01-26 23:28:10 +00:00
bountyPaidTo: [Int]
sats: Int!
2022-09-01 21:06:11 +00:00
commentSats: Int!
lastCommentAt: String
upvotes: Int!
2022-10-28 15:58:31 +00:00
wvotes: Float!
2021-12-05 17:37:55 +00:00
meSats: Int!
2022-09-21 19:57:36 +00:00
meDontLike: Boolean!
meBookmark: Boolean!
2022-09-22 18:44:50 +00:00
outlawed: Boolean!
2022-09-27 21:19:15 +00:00
freebie: Boolean!
2022-08-18 18:15:24 +00:00
paidImgLink: Boolean
2021-04-14 23:56:29 +00:00
ncomments: Int!
2021-04-17 18:15:18 +00:00
comments: [Item!]!
path: String
2022-01-07 16:32:31 +00:00
position: Int
prior: Int
2022-02-17 17:23:43 +00:00
maxBid: Int
2022-09-29 20:42:33 +00:00
isJob: Boolean!
2022-07-30 13:25:46 +00:00
pollCost: Int
poll: Poll
2022-03-07 21:50:13 +00:00
company: String
location: String
remote: Boolean
2022-02-17 17:23:43 +00:00
sub: Sub
2023-05-05 17:38:56 +00:00
subName: String
2022-02-26 16:41:30 +00:00
status: String
2022-07-21 22:55:05 +00:00
uploadId: Int
2023-01-22 20:17:50 +00:00
otsHash: String
parentOtsHash: String
2021-04-12 18:05:09 +00:00
}
`