stacker.news/api/typeDefs/item.js

76 lines
1.8 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-02-17 17:23:43 +00:00
items(sub: String, sort: String, cursor: String, name: String, within: String): Items
2021-12-16 23:05:31 +00:00
moreFlatComments(sort: String!, cursor: String, name: String, within: String): Comments
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!]!
2021-08-22 15:25:17 +00:00
pageTitle(url: String!): String
2021-10-28 20:49:51 +00:00
dupes(url: String!): [Item!]
2022-01-25 19:34:51 +00:00
allItems(cursor: String): Items
2022-02-17 17:23:43 +00:00
search(q: String, sub: String, cursor: String): Items
auctionPosition(sub: String, id: ID, bid: Int!): Int!
2021-04-12 18:05:09 +00:00
}
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 {
upsertLink(id: ID, title: String!, url: String!, boost: Int, forward: String): Item!
upsertDiscussion(id: ID, title: String!, text: String, boost: Int, forward: String): Item!
upsertJob(id: ID, sub: ID!, title: String!, company: String!, location: String, remote: Boolean, text: String!, url: String!, maxBid: Int!, status: 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!
act(id: ID!, sats: Int): ItemActResult!
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!
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!
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!
sats: Int!
upvotes: Int!
2021-12-05 17:37:55 +00:00
meSats: Int!
2022-04-15 16:51:49 +00:00
meComments: Int!
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-03-07 21:50:13 +00:00
company: String
location: String
remote: Boolean
2022-02-17 17:23:43 +00:00
sub: Sub
2022-02-26 16:41:30 +00:00
status: String
2021-04-12 18:05:09 +00:00
}
`