-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
88 lines (79 loc) · 2.14 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
type Category {
createdAt: DateTime
description: String
id: String
name: String
}
type Comment {
children: [Comment]
content: String
createdAt: DateTime
id: String
parentId: String
postId: String
user: User
userId: String
}
"""
The `DateTime` scalar type represents a DateTime. The DateTime is serialized as an RFC 3339 quoted string
"""
scalar DateTime
type Mutation {
createCategory(name: String!, description: String!): Category
createComment(content: String!, userId: String!, postId: String!, parentId: String!): Comment
createPost(title: String!, content: String!, status: String!, userId: String!, categoryId: String!): Post
createPostTag(postId: String!, tagId: String!): PostTag
createTag(name: String!): Tag
createUser(username: String!, email: String!, password: String!, bio: String): User
deleteCategory(id: String!): Boolean
deleteComment(id: String!): Boolean
deletePost(id: String!): Boolean
deleteUser(id: String!): Boolean
removePostTag(postId: String!, tagId: String!): Boolean
updateCategory(name: String, description: String, id: String!): Category
updateComment(id: String!, content: String!): Comment
updatePost(id: String!, title: String, content: String, status: String, categoryId: String): Post
updateUser(email: String, bio: String, id: String!, username: String): User
}
type Post {
categoryId: String
comments(commentsLimit: Int): [Comment]
content: String
createdAt: DateTime
id: String
status: String
title: String
updatedAt: DateTime
user: User
userId: String
}
type PostTag {
postId: String
tagId: String
tags: [Tag]
}
type Query {
categories(limit: Int, offset: Int): [Category]
category(id: String): Category
comments(postId: String!): [Comment]
post(id: String): Post
posts(limit: Int, offset: Int): [Post]
tag(id: String): Tag
tags(limit: Int, offset: Int): [Tag]
user(email: String, id: String): User
users(offset: Int, limit: Int): [User]
}
type Tag {
id: String
name: String
posts(postsLimit: Int): [Post]
}
type User {
bio: String
createdAt: DateTime
email: String
id: String
password: String
posts: [Post]
username: String
}