stacker.news/api/typeDefs/item.js

36 lines
730 B
JavaScript
Raw Normal View History

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!
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!
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
}
`