2021-04-12 18:05:09 +00:00
|
|
|
import { gql } from 'apollo-server-micro'
|
|
|
|
|
|
|
|
export default gql`
|
|
|
|
extend type Query {
|
2021-06-22 17:47:49 +00:00
|
|
|
moreItems(sort: String!, cursor: String, userId: ID): Items
|
2021-06-24 23:56:01 +00:00
|
|
|
moreFlatComments(cursor: String, userId: ID): Comments
|
2021-04-14 23:56:29 +00:00
|
|
|
item(id: ID!): Item
|
2021-04-22 22:14:32 +00:00
|
|
|
userComments(userId: ID!): [Item!]
|
2021-08-22 15:25:17 +00:00
|
|
|
pageTitle(url: String!): String
|
2021-04-12 18:05:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extend type Mutation {
|
2021-04-14 00:57:32 +00:00
|
|
|
createLink(title: String!, url: String): Item!
|
2021-08-11 20:13:10 +00:00
|
|
|
updateLink(id: ID!, title: String!, url: String): Item!
|
2021-04-14 00:57:32 +00:00
|
|
|
createDiscussion(title: String!, text: String): 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-04-26 21:55:15 +00:00
|
|
|
vote(id: ID!, sats: Int): Int!
|
2021-04-12 18:05:09 +00:00
|
|
|
}
|
|
|
|
|
2021-06-22 17:47:49 +00:00
|
|
|
type Items {
|
|
|
|
cursor: String
|
|
|
|
items: [Item!]!
|
|
|
|
}
|
|
|
|
|
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-04-26 21:55:15 +00:00
|
|
|
meSats: 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
|
2021-04-12 18:05:09 +00:00
|
|
|
}
|
|
|
|
`
|