36 lines
730 B
JavaScript
Raw Normal View History

2021-04-12 13:05:09 -05:00
import { gql } from 'apollo-server-micro'
export default gql`
extend type Query {
items: [Item!]!
2021-04-24 16:05:07 -05:00
recent: [Item!]!
2021-04-14 18:56:29 -05:00
item(id: ID!): Item
2021-04-22 17:14:32 -05:00
userItems(userId: ID!): [Item!]
userComments(userId: ID!): [Item!]
2021-04-15 14:41:02 -05:00
root(id: ID!): Item
2021-04-12 13:05:09 -05:00
}
extend type Mutation {
2021-04-13 19:57:32 -05:00
createLink(title: String!, url: String): Item!
createDiscussion(title: String!, text: String): Item!
createComment(text: String!, parentId: ID!): Item!
vote(id: ID!, sats: Int): Int!
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-04-12 13:05:09 -05:00
user: User!
depth: Int!
2021-04-13 19:57:32 -05:00
sats: Int!
2021-04-27 16:30:58 -05:00
boost: Int!
meSats: Int!
2021-04-14 18:56:29 -05:00
ncomments: Int!
2021-04-17 13:15:18 -05:00
comments: [Item!]!
2021-04-12 13:05:09 -05:00
}
`