120 lines
1.8 KiB
GraphQL
120 lines
1.8 KiB
GraphQL
scalar Void
|
|
|
|
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
|
|
}
|
|
|
|
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!
|
|
createdAt: String!
|
|
updatedAt: String!
|
|
}
|
|
|
|
input PaginationFilterInput {
|
|
terms: String
|
|
offset: Int
|
|
size: Int
|
|
}
|
|
|
|
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!
|
|
}
|
|
|
|
type BookChapter {
|
|
id: ID!
|
|
title: String!
|
|
createdAt: String!
|
|
updatedAt: String!
|
|
foreword: String!
|
|
footnote: String!
|
|
reviewsTotal: Int!
|
|
}
|
|
|
|
input BookChapterManyInput {
|
|
bookId: String!
|
|
filter: PaginationFilterInput!
|
|
}
|
|
|
|
type BookChapterManyOutput {
|
|
items: [BookChapter!]!
|
|
total: Int!
|
|
}
|
|
|
|
type Review {
|
|
id: ID!
|
|
author: User!
|
|
text: String!
|
|
ratingTotal: Int!
|
|
}
|
|
|
|
input ReviewManyInput {
|
|
bookId: String
|
|
bookChapterId: String
|
|
filter: PaginationFilterInput!
|
|
}
|
|
|
|
type ReviewManyOutput {
|
|
items: [Review!]!
|
|
total: Int!
|
|
}
|