stacker.news/api/typeDefs/item.js

120 lines
3.2 KiB
JavaScript
Raw Normal View History

import { gql } from 'graphql-tag'
2021-04-12 18:05:09 +00:00
export default gql`
extend type Query {
items(sub: String, sort: String, type: String, cursor: String, name: String, when: String, by: String, limit: Int): Items
2021-04-14 23:56:29 +00:00
item(id: ID!): 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
search(q: String, sub: 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!
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
subscribeItem(id: ID): Item
2023-01-12 23:53:09 +00:00
deleteItem(id: ID): Item
upsertLink(id: ID, sub: String, title: String!, url: String!, boost: Int, forward: String, invoiceHash: String, invoiceHmac: String): Item!
upsertDiscussion(id: ID, sub: String, title: String!, text: String, boost: Int, forward: String, invoiceHash: String, invoiceHmac: String): Item!
2023-05-01 20:58:30 +00:00
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!
upsertPoll(id: ID, sub: String, title: String!, text: String, options: [String!]!, boost: Int, forward: String, invoiceHash: String, invoiceHmac: String): Item!
createComment(text: String!, parentId: ID!, invoiceHash: String, invoiceHmac: String): 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, invoiceHash: String, invoiceHmac: String): 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!
2023-07-27 00:18:42 +00:00
createdAt: Date!
updatedAt: Date!
deletedAt: Date
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!
2023-07-27 00:18:42 +00:00
lastCommentAt: Date
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!
meSubscription: 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!
2023-07-26 00:45:35 +00:00
comments(sort: String): [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
}
`