2021-04-12 18:05:09 +00:00
|
|
|
import { gql } from 'apollo-server-micro'
|
|
|
|
|
|
|
|
export default gql`
|
|
|
|
extend type Query {
|
|
|
|
items: [Item!]!
|
2021-04-24 21:05:07 +00:00
|
|
|
recent: [Item!]!
|
2021-04-14 23:56:29 +00:00
|
|
|
item(id: ID!): Item
|
2021-04-22 22:14:32 +00:00
|
|
|
userItems(userId: ID!): [Item!]
|
|
|
|
userComments(userId: ID!): [Item!]
|
2021-04-15 19:41:02 +00:00
|
|
|
root(id: ID!): Item
|
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!
|
|
|
|
createDiscussion(title: String!, text: String): Item!
|
|
|
|
createComment(text: String!, parentId: ID!): Item!
|
2021-04-26 21:55:15 +00:00
|
|
|
vote(id: ID!, sats: Int): Int!
|
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-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-04-12 18:05:09 +00:00
|
|
|
}
|
|
|
|
`
|