-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypeDefs.graphql
More file actions
61 lines (53 loc) · 1.29 KB
/
Copy pathtypeDefs.graphql
File metadata and controls
61 lines (53 loc) · 1.29 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
directive @unique on FIELD_DEFINITION
type Query {
getCurrentUser: User
getPosts: [Post]
searchPost(searchTerm: String): [Post]
getPost(postId: ID): Post!
infiniteScrollPosts(pageNum: Int!, pageSize: Int!): PostPage
}
type Token {
token: String!
}
type User {
_id: ID
username: String! @unique
email: String!
password: String!
avatar: String
joinDate: String
favorites: [Post]
}
type PostPage {
posts: [Post]
hasMore: Boolean
}
type LikesFaves {
likes: Int
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 Mutation {
likePost(postId: ID!, username: String!): LikesFaves!
unlikePost(postId: ID!, username: String!): LikesFaves!
addPostMessage(messageBody: String!, userId: ID!, postId: ID!): Message
addPost(title: String!, imageUrl: String!, categories: [String]!, description: String!, creatorId: ID!): Post!
signUpUser(username: String!, email: String!, password: String!): Token
signInUser(username: String!, password: String!): Token
}