This commit is contained in:
QkoSad
2023-08-08 16:02:54 +03:00
commit 0a7a469d56
315 changed files with 426907 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
const typeDefs = `
type User {
username: String!
favoriteGenre: String!
id: ID!
}
type Token {
value: String!
}
type Author {
name: String!
born: Int
id: ID!
bookCount: Int!
}
type Book {
title: String!
published: Int
id: ID!
author: Author!
genres: [String]
}
type Query {
authorCount: Int!
bookCount: Int!
books(genre:String, author:String): [Book]!
authors: [Author]!
me: User
}
type Mutation {
addBook(
title: String!,
author: String!,
published: Int!,
genres: [String!]!): Book!
editAuthor(born: Int!,name: String!): Author!
addAuthor(name: String!, born: Int): Author!
createUser(username: String! favoriteGenre: String!): User
login(username: String! password: String!): Token
}
type Subscription {
bookAdded: Book!
}
`;
module.exports = typeDefs;