2021-04-12 18:05:09 +00:00
|
|
|
import { gql } from 'apollo-server-micro'
|
|
|
|
|
|
|
|
export default gql`
|
|
|
|
extend type Query {
|
2021-12-16 23:05:31 +00:00
|
|
|
moreItems(sort: String!, cursor: String, name: String, within: String): Items
|
|
|
|
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!]
|
2021-04-12 18:05:09 +00:00
|
|
|
}
|
|
|
|
|
2021-09-09 15:46:20 +00:00
|
|
|
enum ItemAct {
|
|
|
|
VOTE
|
|
|
|
BOOST
|
|
|
|
TIP
|
|
|
|
}
|
|
|
|
|
2021-09-10 21:13:52 +00:00
|
|
|
type ItemActResult {
|
|
|
|
sats: Int!
|
|
|
|
act: ItemAct!
|
|
|
|
}
|
|
|
|
|
2021-04-12 18:05:09 +00:00
|
|
|
extend type Mutation {
|
2021-09-11 21:52:19 +00:00
|
|
|
createLink(title: String!, url: String, boost: Int): Item!
|
2021-08-11 20:13:10 +00:00
|
|
|
updateLink(id: ID!, title: String!, url: String): Item!
|
2021-09-11 21:52:19 +00:00
|
|
|
createDiscussion(title: String!, text: String, boost: Int): Item!
|
2021-08-11 20:13:10 +00:00
|
|
|
updateDiscussion(id: ID!, title: String!, text: 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!
|
2021-09-12 16:55:38 +00:00
|
|
|
act(id: ID!, act: ItemAct!, sats: Int, tipDefault: Boolean): 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!
|
|
|
|
title: String
|
|
|
|
url: String
|
|
|
|
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!
|
|
|
|
depth: Int!
|
2021-04-14 00:57:32 +00:00
|
|
|
sats: Int!
|
2021-04-27 21:30:58 +00:00
|
|
|
boost: Int!
|
2021-09-10 21:13:52 +00:00
|
|
|
tips: Int!
|
2021-11-27 18:01:02 +00:00
|
|
|
mine: Boolean!
|
2021-09-10 21:13:52 +00:00
|
|
|
meVote: Int!
|
2021-12-05 17:37:55 +00:00
|
|
|
meSats: Int!
|
2021-09-10 21:13:52 +00:00
|
|
|
meTip: Int!
|
2021-04-14 23:56:29 +00:00
|
|
|
ncomments: Int!
|
2021-04-17 18:15:18 +00:00
|
|
|
comments: [Item!]!
|
2021-08-17 23:07:52 +00:00
|
|
|
path: String
|
2022-01-07 16:32:31 +00:00
|
|
|
position: Int
|
2021-04-12 18:05:09 +00:00
|
|
|
}
|
|
|
|
`
|