-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
109 lines (93 loc) · 1.83 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
type Query {
posts(keyword: String): [Post!]!
users(keyword: String): [User!]!
comments: [Comment!]!
}
type Mutation {
loginUser( data: UserLoginData! ): AuthenticatedUser!
createUser( data: UserInputData! ): AuthenticatedUser!
updateUser( userID: ID!, data: UserUpdateData! ): User!
deleteUser( userID: ID! ): User!
createPost( data: PostInputData! ): Post!
updatePost( postID: ID!, data: PostUpdateData! ): Post!
deletePost( postID: ID! ): Post!
createComment( data: CommentInputData! ): Comment!
updateComment( commentID: ID!, data: CommentUpdateData! ): Comment!
deleteComment( commentID: ID! ): Comment!
}
type Subscription {
comment( postID: ID! ): CommentSubscriptionPayload!
post( userID: ID! ): PostSubscriptionPayload!
}
input UserLoginData{
email: String!
password: String!
}
input UserInputData {
name: String!
email: String!
password: String!
}
input UserUpdateData {
name: String
email: String
active: Boolean
}
input PostInputData {
title: String!
body: String!
published: Boolean!
}
input PostUpdateData{
title: String
body: String
published: Boolean
}
input CommentInputData {
text: String!
post: ID!
author: ID!
}
input CommentUpdateData{
text: String!
}
type AuthenticatedUser{
auth: String!
user: User!
}
type Post {
id: ID!
title: String!
body: String!
published: Boolean!
author: User!
comments: [Comment!]!
}
type User {
id: ID!
name: String!
email: String!
active: Boolean!
posts: [Post!]!
comments: [Comment!]!
}
type Comment {
id: ID!
text: String!
author: User!
post: Post!
}
enum MutationType {
CREATE
UPDATE
DELETE
}
type CommentSubscriptionPayload{
mutation: String!
data: Comment!
}
type PostSubscriptionPayload{
mutation: MutationType!
data: Post!
}
union Test = CommentSubscriptionPayload | PostSubscriptionPayload