-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.gql
More file actions
125 lines (108 loc) · 2.25 KB
/
schema.gql
File metadata and controls
125 lines (108 loc) · 2.25 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
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
# -----------------------------------------------
# !!! THIS FILE WAS GENERATED BY TYPE-GRAPHQL !!!
# !!! DO NOT MODIFY THIS FILE BY YOURSELF !!!
# -----------------------------------------------
input AddBookInput {
addedBy: String!
author: String!
categoryId: [String!]!
description: String!
name: String!
picture: Upload
publishDate: DateTime!
}
input AddBookRating {
addedBy: String!
bookId: String!
rating: Int!
review: String!
}
enum BOOK_STATUS {
FINISH
READ
READING
WANT_TO_READ
}
type Book {
_id: String!
author: String
category: [Category!]!
description: String
image: String
name: String!
publishDate: DateTime
totalRatingCount: Int
totalRatingValue: Float
}
type BookRating {
_id: String!
publishDate: DateTime!
rating: Int!
review: String!
totalTimeTaken: Int
user: User!
}
type Category {
_id: ID!
books: [Book!]!
name: String!
}
input CreateUserInput {
email: String!
name: String!
password: String!
}
"""
The javascript `Date` as string. Type represents date and time as the ISO Date string.
"""
scalar DateTime
input LoginUserInput {
email: String!
password: String!
}
type Mutation {
addBook(input: AddBookInput!, picture: Upload): Book!
addBookRating(input: AddBookRating!): [BookRating!]!
createCategory(name: String!): Category!
createUser(input: CreateUserInput!): User!
login(input: LoginUserInput!): String!
updateCategory(input: UpdateUserGenre!): User!
updateUserBooks(input: UpdateUserBooks!): User!
}
type Query {
getBookRating(id: String!): [BookRating!]!
getBooks(id: String): [Book!]!
getBooksByUser: [Book!]!
getCategories: [Category!]!
getCategoryById(id: String!): Category!
getUpdatedMe: User!
logout: Boolean!
me: User!
}
type Subscription {
newRating(bookId: String!): BookRating!
}
input UpdateUserBooks {
bookId: String!
status: BOOK_STATUS
}
input UpdateUserGenre {
categoryIds: [String!]!
}
"""The `Upload` scalar type represents a file upload."""
scalar Upload
type User {
_id: String!
category: [Category!]!
email: String!
name: String!
userBooks: [UserBooks!]!
}
type UserBooks {
book: Book
finish_time: String
read_time: String
reading_time: String
status: BOOK_STATUS!
want_to_read_time: String!
}