-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtypeDefs.gql
More file actions
75 lines (68 loc) · 1.44 KB
/
Copy pathtypeDefs.gql
File metadata and controls
75 lines (68 loc) · 1.44 KB
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
type User {
_id: ID
username: String! @unique
email: String!
password: String!
avatar: String
joinDate: String
favorites: [Post]
}
type Post {
_id: ID
title: String!
imageUrl: String!
categories: [String]!
description: String!
createdDate: String
likes: Int
createdBy: User!
messages: [Message]
}
type Message {
_id: ID
messageBody: String!
messageDate: String
messageUser: User!
}
type Token {
token: String!
}
type PostsPage {
posts: [Post]
hasMore: Boolean
}
type LikesFavorites {
likes: Int
favorites: [Post]
}
type Query {
getPosts: [Post]
getPost(postId: ID!): Post!
getCurrentUser: User
infiniteScrollPosts(pageNum: Int!, pageSize: Int!): PostsPage
searchPosts(searchTerm: String!): [Post]
getUserPosts(userId: ID!): [Post]
}
type Mutation {
addPost(
title: String!
imageUrl: String!
categories: [String]!
description: String!
creatorId: ID!
): Post!
updateUserPost(
postId: ID!
userId: ID!
title: String!
imageUrl: String!
description: String!
categories: [String]!
): Post!
deleteUserPost(postId: ID!): Post!
likePost(postId: ID!, username: String!): LikesFavorites!
unlikePost(postId: ID!, username: String!): LikesFavorites!
addPostMessage(messageBody: String!, userId: ID!, postId: ID!): Message!
signupUser(username: String!, email: String!, password: String!): Token
signinUser(username: String!, password: String!): Token
}