181 lines
2.9 KiB
GraphQL
181 lines
2.9 KiB
GraphQL
scalar Void
|
|
scalar JSON
|
|
|
|
type Query {
|
|
identity: Identity!
|
|
userOne(id: ID!): User!
|
|
bookOne(id: ID!): Book!
|
|
bookMany(input: BookManyInput!): BookManyOutput!
|
|
bookChapterOne(id: ID!): BookChapter!
|
|
bookChapterMany(input: BookChapterManyInput!): BookChapterManyOutput!
|
|
reviewMany(input: ReviewManyInput!): ReviewManyOutput!
|
|
}
|
|
|
|
type Mutation {
|
|
signUp(input: SignUpInput!): Void
|
|
login(input: LoginInput!): Session!
|
|
logout: Void
|
|
bookCreate(input: BookCreateInput!): Book!
|
|
bookChapterCreate(input: BookChapterCreateInput!): BookChapter!
|
|
bookChapterUpdate(input: BookChapterUpdateInput!): BookChapter!
|
|
bookChapterDelete(id: ID!): Book!
|
|
reviewCreate(input: ReviewCreateInput!): Review!
|
|
reviewUpdate(input: ReviewUpdateInput!): Review!
|
|
reviewDelete(id: ID!): Void
|
|
ratingSet(input: RatingSetInput!): Void
|
|
}
|
|
|
|
input SignUpInput {
|
|
email: String!
|
|
username: String!
|
|
password: String!
|
|
}
|
|
|
|
input LoginInput {
|
|
email: String!
|
|
password: String!
|
|
}
|
|
|
|
type Session {
|
|
userId: ID!
|
|
accessToken: String!
|
|
}
|
|
|
|
type Identity {
|
|
id: ID!
|
|
email: String!
|
|
isDarkTheme: Boolean!
|
|
user: User!
|
|
}
|
|
|
|
type User {
|
|
id: ID!
|
|
username: String!
|
|
description: String
|
|
createdAt: String!
|
|
updatedAt: String!
|
|
}
|
|
|
|
input PaginationFilterInput {
|
|
terms: String
|
|
offset: Int
|
|
size: Int
|
|
}
|
|
|
|
input BookCreateInput {
|
|
title: String!
|
|
description: String!
|
|
}
|
|
|
|
input BookManyInput {
|
|
filter: PaginationFilterInput!
|
|
}
|
|
|
|
enum WorkingProgressStatus {
|
|
inProgress
|
|
frozen
|
|
complete
|
|
}
|
|
|
|
type BookManyOutput {
|
|
items: [Book!]!
|
|
total: Int!
|
|
}
|
|
|
|
type Book {
|
|
id: ID!
|
|
title: String!
|
|
description: String!
|
|
author: User!
|
|
createdAt: String!
|
|
updatedAt: String!
|
|
progressStatus: WorkingProgressStatus!
|
|
wordsTotal: Int!
|
|
chaptersTotal: Int!
|
|
ratingTotal: Int!
|
|
reviewsTotal: Int!
|
|
personalRating: RatingType!
|
|
}
|
|
|
|
type BookChapter {
|
|
id: ID!
|
|
title: String!
|
|
createdAt: String!
|
|
updatedAt: String!
|
|
foreword: String
|
|
footnote: String
|
|
content: JSON!
|
|
sequenceNumber: Int!
|
|
reviewsTotal: Int!
|
|
previousChapterId: String
|
|
nextChapterId: String
|
|
book: Book!
|
|
personalRating: RatingType!
|
|
}
|
|
|
|
input BookChapterCreateInput {
|
|
bookId: ID!
|
|
title: String!
|
|
foreword: String
|
|
footnote: String
|
|
content: JSON!
|
|
}
|
|
|
|
input BookChapterUpdateInput {
|
|
id: ID!
|
|
title: String!
|
|
foreword: String
|
|
footnote: String
|
|
content: JSON!
|
|
}
|
|
|
|
input BookChapterManyInput {
|
|
bookId: String!
|
|
filter: PaginationFilterInput!
|
|
}
|
|
|
|
type BookChapterManyOutput {
|
|
items: [BookChapter!]!
|
|
total: Int!
|
|
}
|
|
|
|
type Review {
|
|
id: ID!
|
|
author: User!
|
|
text: String!
|
|
ratingTotal: Int!
|
|
}
|
|
|
|
input ReviewCreateInput {
|
|
bookId: ID
|
|
chapterId: ID
|
|
text: String!
|
|
}
|
|
|
|
input ReviewUpdateInput {
|
|
id: ID!
|
|
text: String!
|
|
}
|
|
|
|
input ReviewManyInput {
|
|
bookId: String
|
|
bookChapterId: String
|
|
filter: PaginationFilterInput!
|
|
}
|
|
|
|
type ReviewManyOutput {
|
|
items: [Review!]!
|
|
total: Int!
|
|
}
|
|
|
|
input RatingSetInput {
|
|
bookId: String
|
|
bookChapterId: String
|
|
ratingType: RatingType!
|
|
}
|
|
|
|
enum RatingType {
|
|
up
|
|
down
|
|
none
|
|
}
|