-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
73 lines (61 loc) · 1.24 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
scalar Date
enum STATUS {
ERROR
OK
}
enum STATUS_DIARY {
PUBLIC
PRIVATE
}
enum ROLE {
USER
ADMIN
}
type User {
userId: String!
username: String!
email: String!
password: String
role: ROLE!
createdAt: Date
updatedAt: Date
}
type Users {
data: [User]!
}
type Diary {
diaryId: String!
status_diary: STATUS_DIARY!
title: String!
content: String!
}
type Diaries {
data: [Diary]!
}
type Status {
status: STATUS!
message: String!
}
type Token {
accessToken: String
refreshToken: String
}
union Result = User | Users | Diary | Diaries | Status | Token
type Query {
dataUsers: Result
dataUser: Result
getUser(id: String): Result
getDiariesByUserId: Result
getDiaries: Result
getDiary(id: String): Result
}
type Mutation {
register(username: String!, email: String!, password: String!): Result
verifyUser(otp: String!): Status
login(usernameOrEmail: String!, password: String!): Result
refreshToken(token: String): Result
takeTheOtpAgain(usernameOrEmail: String!): Status
addDiary(status_diary: STATUS_DIARY!, title: String!, content: String!): Result
updateDiary(diaryId: String!, status_diary: STATUS_DIARY!, title: String!, content: String!): Result
deleteDiary(diaryId: String!): Result
}