-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.js
62 lines (54 loc) · 1.09 KB
/
schema.js
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
export default `
type Comment {
id: Int!
comment: String!
postId: Int!
creatorCommentId: Int!
creatorComment: User!
}
type Post {
id: Int!
post: String!
creatorPostId: Int!
comments: [Comment!]!
}
type User {
id: Int!
username: String!
email: String!
createdAt: String!
UpdatedAt: String!
posts: [Post!]!
comments: [Comment!]!
}
input GetUserInput {
id: Int
username: String
email: String
}
input CreateUserInput {
username: String!
email: String!
}
input UpdateUserInput {
id: Int!
email: String!
}
input DeleteUserInput {
id: Int!
}
type Query {
allUser: [User!]!
getUser(input: GetUserInput!): User!
searchUsername(username: String!): [User!]!
getUserPost(creatorPostId: Int!): [Post!]!
getUserComment(creatorCommentId: Int!): [Comment!]!
}
type Mutation {
createUser(input: CreateUserInput!): User
updateUser(input: UpdateUserInput!): [Int!]!
deleteUser(input: DeleteUserInput!): Int!
createUserPost(creatorPostId: Int!, post: String!): Post!
createUserComment(postId: Int!, creatorCommentId: Int!, comment: String!): Comment!
}
`;