Viewing:
# GraphQL schema example
#
# https://gqlgen.com/getting-started/
type User implements Node {
id: ID!
username: String
email: String
}
enum Role {
ANONYMOUS
VIEWER
BORROWER
LENDER
SERVER_ADMIN
ADD_BOOKS
EDIT_BOOKS
DELETE_BOOKS
ROLE_GRANTER
}
type RoleRequest {
role: Role
reason: String
denied: Boolean
denyReason: String
created: String
}
interface Node {
id: ID!
}
type Viewer {
user: User
roles: [Role!]
pendingRoles: [RoleRequest]
}
type Series implements Node {
id: ID!
title: String
synopsis: String
totalBookMembers: Int
totalSubseries: Int
created: String
updated: String
subseries(first: Int, after: ID!): SubseriesConnection
}
type SubseriesEdge {
cursor: String!
node: Subseries
}
type SubseriesConnection {
edges: [SubseriesEdge]
pageInfo: PageInfo
}
type Subseries {
id: ID!
title: String
synopsis: String
totalBookMembers: Int
seriesId: Int
created: String
updated: String
}
type PageInfo {
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: Boolean!
endCursor: Boolean!
}
type Book implements Node {
id: ID!
title: String
year: Int
synopsis: String
series: Series
}
type BookDetails implements Node {
id: ID!
title: String
year: Int
synopsis: String
# series: Series
seriesPart: String
subseriesPart: String
genre: [String!]!
creatorNames: [String!]!
creatorIds: [ID!]!
created: String
updated: String
}
type BooksConnection {
edges: [BookEdge]
pageInfo: PageInfo
}
type BookEdge {
cursor: String!
node: Book
}
type Creator implements Node {
id: ID!
firstname: String
lastname: String
}
type CreatorDetails implements Node {
id: ID!
firstname: String
lastname: String
birth: Int
death: Int
bio: String
created: String
updated: String
}
type CreatorsConnection {
edges: [CreatorEdge]
pageInfo: PageInfo
}
type CreatorEdge {
cursor: String!
node: Creator
}
type Genre implements Node {
id: ID!
genre: String
enum: String
}
type GenreEdge {
cursor: String!
node: Genre
}
type GenresConnection {
edges: [GenreEdge]
pageInfo: PageInfo
}
type Query {
viewer: Viewer
books(first: Int, after: ID!): BooksConnection
book(id: ID!): BookDetails
creator(id: ID!): CreatorDetails
creators(first: Int, after: ID!): CreatorsConnection
genres(first: Int, after: ID!): GenresConnection
node(id: ID!): Node
}
input CreatorCreateInput {
firstname: String
lastname: String
birth: Int
death: Int
bio: String
}
input SeriesInput {
title: String
synopsis: String
totalBookMembers: Int
totalSubseries: Int
}
input SubseriesInput {
title: String
synopsis: String
totalBookMembers: Int
seriesId: Int!
}
input TitleInput {
title: String
year: Int
synopsis: String
seriesPart: String
subseriesPart: String
genreIds: [ID!]
creatorIds: [ID!]
}
input GenreInput {
genre: String
}
type Mutation {
user: User
newCreator(creator: CreatorCreateInput!): CreatorDetails
newSeries(series: SeriesInput!): Series
newSubseries(series: SubseriesInput!): Subseries
newTitle(title: TitleInput!): BookDetails
newGenre(genre: GenreInput!): Genre
}