2021-04-12 13:05:09 -05:00
|
|
|
import { gql } from 'apollo-server-micro'
|
|
|
|
|
|
|
|
export default gql`
|
|
|
|
extend type Query {
|
2021-12-16 17:05:31 -06:00
|
|
|
moreItems(sort: String!, cursor: String, name: String, within: String): Items
|
|
|
|
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!]
|
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 {
|
2021-09-11 16:52:19 -05:00
|
|
|
createLink(title: String!, url: String, boost: Int): Item!
|
2021-08-11 15:13:10 -05:00
|
|
|
updateLink(id: ID!, title: String!, url: String): Item!
|
2021-09-11 16:52:19 -05:00
|
|
|
createDiscussion(title: String!, text: String, boost: Int): Item!
|
2021-08-11 15:13:10 -05:00
|
|
|
updateDiscussion(id: ID!, title: String!, text: 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-01-20 17:04:12 -06:00
|
|
|
act(id: ID!, sats: Int): ItemActResult!
|
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!
|
|
|
|
title: String
|
|
|
|
url: String
|
|
|
|
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!
|
|
|
|
depth: Int!
|
2021-11-27 12:01:02 -06:00
|
|
|
mine: Boolean!
|
2022-01-20 17:04:12 -06:00
|
|
|
boost: Int!
|
|
|
|
sats: Int!
|
|
|
|
upvotes: Int!
|
2021-12-05 11:37:55 -06:00
|
|
|
meSats: Int!
|
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
|
2021-04-12 13:05:09 -05:00
|
|
|
}
|
|
|
|
`
|