ozon-task/graph/schema.graphqls
2024-06-25 02:34:10 +03:00

44 lines
639 B
GraphQL

type Post {
id: ID!
title: String!
author: String!
contents: String!
comments: [Comment!]!
allowComments: Boolean!
}
type Comment {
id: ID!
post: Post!
author: String!
contents: String!
replyTo: Comment
replies: [Comment!]!
}
type Query {
allPosts: [Post!]!
}
type Mutation {
addPost(input: PostInput): AddResult!
addComment(input: CommentInput): AddResult!
}
input PostInput {
title: String!
author: String!
contents: String!
allowComments: Boolean! = true
}
input CommentInput {
parentPostId: ID
parentCommentId: ID
author: String!
contents: String!
}
type AddResult {
itemId: ID!
}