130 lines
3.5 KiB
JavaScript
Raw Normal View History

import { gql } from 'apollo-server-micro'
2021-04-12 13:05:09 -05:00
export default gql`
extend type Query {
items(sub: String, sort: String, type: String, cursor: String, name: String, within: String): Items
moreFlatComments(sub: String, sort: String!, cursor: String, name: String, within: String): Comments
moreBookmarks(cursor: String, name: String!): Items
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!]!
2023-01-12 12:05:47 -06:00
pageTitleAndUnshorted(url: String!): TitleUnshorted
2021-10-28 15:49:51 -05:00
dupes(url: String!): [Item!]
2023-01-12 14:30:17 -06:00
related(cursor: String, title: String, id: ID, minMatch: String, limit: Int): Items
allItems(cursor: String): Items
getBountiesByUserName(name: String!, cursor: String, , limit: Int): Items
search(q: 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!
outlawedItems(cursor: String): Items
borderlandItems(cursor: String): Items
freebieItems(cursor: String): Items
topItems(cursor: String, sub: String, sort: String, when: String): Items
topComments(cursor: String, sub: String, sort: String, when: String): Comments
2021-04-12 13:05:09 -05:00
}
2023-01-12 12:05:47 -06:00
type TitleUnshorted {
title: String
unshorted: String
}
2021-09-10 16:13:52 -05:00
type ItemActResult {
vote: Int!
2021-09-10 16:13:52 -05:00
sats: Int!
}
2021-04-12 13:05:09 -05:00
extend type Mutation {
bookmarkItem(id: ID): Item
subscribeItem(id: ID): Item
2023-01-12 17:53:09 -06:00
deleteItem(id: ID): Item
2023-05-01 15:58:30 -05: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 17:55:05 -05:00
text: String!, url: String!, maxBid: Int!, status: String, logo: Int): Item!
2023-05-01 15:58:30 -05:00
upsertPoll(id: ID, sub: String, 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!
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!
2023-01-12 17:53:09 -06:00
deletedAt: 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!
fwdUserId: 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!
boost: Int!
2023-01-26 10:11:55 -06:00
bounty: Int
2023-01-26 17:28:10 -06:00
bountyPaidTo: [Int]
sats: Int!
2022-09-01 16:06:11 -05:00
commentSats: Int!
lastCommentAt: String
upvotes: Int!
2022-10-28 10:58:31 -05:00
wvotes: Float!
2021-12-05 11:37:55 -06:00
meSats: Int!
2022-09-21 14:57:36 -05:00
meDontLike: Boolean!
meBookmark: Boolean!
meSubscription: 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!]!
path: String
2022-01-07 10:32:31 -06:00
position: Int
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
2023-05-05 12:38:56 -05:00
subName: String
2022-02-26 10:41:30 -06:00
status: String
2022-07-21 17:55:05 -05:00
uploadId: Int
2023-01-22 14:17:50 -06:00
otsHash: String
parentOtsHash: String
2021-04-12 13:05:09 -05:00
}
`