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