ln/app/server/graphql/schema.graphql
2025-05-17 17:16:26 +03:00

133 lines
1.8 KiB
GraphQL

scalar Void
type Query {
identity: Identity!
userOne(id: ID!): User!
workingMany(input: WorkingManyInput!): WorkingManyOutput!
}
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 WorkingManyInput {
filter: PaginationFilterInput!
type: WorkingType!
}
enum WorkingType {
book
notepad
}
enum WorkingProgressStatus {
inProgress
frozen
complete
}
type WorkingManyOutput {
items: [Working!]!
total: Int!
}
type Working {
id: ID!
title: String!
description: String!
author: User!
createdAt: String!
updatedAt: String!
type: WorkingType!
book: Book
notepad: Notepad
progressStatus: WorkingProgressStatus!
ratingTotal: Int!
reviewsTotal: Int!
}
type Book {
id: ID!
workingId: ID!
createdAt: String!
updatedAt: String!
wordsTotal: Int!
chaptersTotal: Int!
}
type BookChapter {
id: ID!
title: String!
createdAt: String!
updatedAt: String!
foreword: String!
footnote: String!
reviewsTotal: Int!
}
input BookChapterManyInput {
filter: PaginationFilterInput!
}
type BookChapterManyOutput {
items: [BookChapter!]!
total: Int!
}
type Notepad {
id: ID!
}
type Review {
id: ID!
author: User!
text: String!
ratingTotal: Int!
}
input ReviewManyInput {
filter: PaginationFilterInput!
}
type ReviewManyOutput {
items: [Review!]!
total: Int!
}