-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
109 lines (95 loc) · 2.29 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
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
type Author {
firstName: String!
lastName: String!
middleName: String
}
input AuthorInput {
firstName: String!
lastName: String!
middleName: String!
}
type Book {
Id: ID!
title: String!
author: Author!
price: Float!
subtitle: String
description: String
isbn: String
bookFormat: String
rating: Float
asyncUpdateRequired: Boolean
createdOn: String
lastUpdatedOn: String
}
type BookCreateResponse {
errorMessage: String
success: Boolean!
result: Book
recordId: ID!
}
type BookDeleteResponse {
errorMessage: String
success: Boolean!
result: Book
recordId: ID!
}
type BookGetResponse {
errorMessage: String
success: Boolean!
result: Book
}
type BookUpdateResponse {
errorMessage: String
success: Boolean!
result: Book
recordId: ID!
}
"""Date with time (isoformat)"""
scalar DateTime
type Mutation {
createBook(title: String!, author: AuthorInput!, price: Float!, subtitle: String!, description: String!, isbn: String!, bookFormat: String!): BookCreateResponse!
updateBook(bookId: String!, title: String!, author: AuthorInput!, price: Float!, subtitle: String!, description: String!, isbn: String!, bookFormat: String!, rating: Float!): BookUpdateResponse!
deleteBook(bookId: String!): BookDeleteResponse!
createReview(bookId: String!, reviewerId: String!, rating: Float!, reviewComments: String!): ReviewCreateResponse!
updateReview(reviewId: String!, rating: Float!, reviewComments: String!): ReviewUpdateResponse!
deleteReview(reviewId: String!): ReviewDeleteResponse!
}
type Query {
getBookById(bookId: String!): BookGetResponse!
getBookByIsbn(isbn: String!): BookGetResponse!
getReviewById(reviewId: String!): ReviewGetResponse!
getReviewByBookId(bookId: String!): ReviewGetResponse!
}
type Review {
Id: ID!
bookId: String!
reviewerId: String!
rating: Float!
reviewComments: String!
createdOn: DateTime!
lastUpdatedOn: DateTime
}
type ReviewCreateResponse {
errorMessage: String
success: Boolean!
result: Review
recordId: ID!
}
type ReviewDeleteResponse {
errorMessage: String
success: Boolean!
result: Review
recordId: ID!
}
type ReviewGetResponse {
errorMessage: String
success: Boolean!
result: Review
}
type ReviewUpdateResponse {
errorMessage: String
success: Boolean!
result: Review
recordId: ID!
}