-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.gql
48 lines (45 loc) · 774 Bytes
/
schema.gql
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
type Book {
bookId: ID!
workId: Int
title: String!
originalTitle: String
isbn: String!
isbn13: Int
authors: [String]
publicationYear: Int
languageCode: String
avgRating: Float
ratingsCount: Int
workRatingsCount: Int
workTextReviewsCount: Int
ratings1: Int
ratings2: Int
ratings3: Int
ratings4: Int
ratings5: Int
coverURL: String
smallCoverURL: String
description: String
reviews: [Review]!
}
type Review {
_id: ID!
bookId: ID!
rate: Float!
text: String
likes: Int
}
type Query {
books(pageSize: Int, page: Int): [Book]
book(bookId: ID): Book
reviews: [Review]
}
type Mutation {
createReview(
bookId: ID!
username: String!
rate: Float!
text: String!
): Review!
likeReview(id: ID): Review
}