stacker.news/api/typeDefs/item.js

46 lines
928 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 {
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
notifications: [Item!]!
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-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
}
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-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
}
`