-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschemacopy.graphql
174 lines (146 loc) · 3.02 KB
/
schemacopy.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
input CreatePostRequest {
description: String!
mediaUrl: String!
title: String!
}
type DeletePostResponse {
id: String!
ok: Boolean!
}
union EditProfileProblemUnion =
EmailAlreadyUsedProblem
| PhoneAlreadyUsedProblem
input EditProfileRequest {
avatarUrl: String
# ex. 1996-09-23
birthDate: String
country: String
email: String!
firstName: String
gender: GenderType
lastName: String
middleName: String
phone: String
}
type EditProfileResponse {
problem: EditProfileProblemUnion
user: UserModel
}
type EmailAlreadyUsedProblem {
message: String!
}
type EmailOrPasswordIncorrectProblem {
message: String!
}
type FindFavouritePostsPaginationResponse {
data: [PostModel!]
pageInfo: PageAfterCursorInfo
}
input FindFavouritePostsRequest {
afterCursor: String
limit: Int = 10
}
type FindMyPostsPaginationResponse {
data: [PostModel!]
pageInfo: PageAfterCursorInfo
}
input FindMyPostsRequest {
afterCursor: String
limit: Int = 10
}
type FindPostsPaginationResponse {
data: [PostModel!]
pageInfo: PageAfterCursorInfo
}
input FindPostsRequest {
afterCursor: String
limit: Int = 10
type: PostFilterType!
}
enum GenderType {
FEMALE
MALE
}
type Mutation {
postCreate(input: CreatePostRequest!): PostModel!
postDelete(input: PostIdRequest!): DeletePostResponse!
postLike(input: PostIdRequest!): PostModel!
postUnlike(input: PostIdRequest!): PostModel!
userEditProfile(input: EditProfileRequest!): EditProfileResponse!
userSignIn(input: SignInRequest!): SignInResponse!
userSignUp(input: SignUpRequest!): SignUpResponse!
}
type PageAfterCursorInfo {
afterCursor: String
count: Float!
perPage: Float!
}
type PhoneAlreadyUsedProblem {
message: String!
}
enum PostFilterType {
NEW
TOP
}
input PostIdRequest {
# post id
id: String!
}
type PostModel {
author: UserModel!
authorId: String!
createdAt: String!
deletedAt: String
description: String!
# ex. 2cdc8ab1-6d50-49cc-ba14-54e4ac7ec231
id: String!
isLiked: Boolean!
likesCount: Float!
mediaUrl: String!
title: String!
updatedAt: String!
}
type Query {
favouritePosts(
input: FindFavouritePostsRequest!
): FindFavouritePostsPaginationResponse!
myPosts(input: FindMyPostsRequest!): FindMyPostsPaginationResponse!
post(input: PostIdRequest!): PostModel!
posts(input: FindPostsRequest!): FindPostsPaginationResponse!
userMe: UserModel!
}
input SignInRequest {
email: String!
password: String!
}
type SignInResponse {
problem: EmailOrPasswordIncorrectProblem
token: String
user: UserModel
}
input SignUpRequest {
email: String!
password: String!
passwordConfirm: String!
}
type SignUpResponse {
problem: EmailAlreadyUsedProblem
token: String
user: UserModel
}
type UserModel {
avatarUrl: String
birthDate: String
country: String
createdAt: String!
deletedAt: String
email: String!
firstName: String
gender: String
# ex. 2cdc8ab1-6d50-49cc-ba14-54e4ac7ec231
id: String!
lastName: String
middleName: String
phone: String
updatedAt: String!
}