export const typeDefs = `
  type Book {
    id: ID!
    title: String!
    isbn: String
    author: Author
  }

  type Author {
    id: ID!
    firstname: String
    lastname: String
  }

  type Query {
    books: [Book]
    authors: [Author]
    book(title: String, isbn: String): [Book]
    author(id: ID!): Author
  }

type Mutation {
  createAuthor(firstname: String!, lastname: String!): Author
  updateAuthor(id: ID!, firstname: String, lastname: String): Author
  deleteAuthor(id: ID!): Boolean

  createBook(title: String!, isbn: String, authorId: ID): Book
  updateBook(id: ID!, title: String, isbn: String, authorId: ID): Book
  deleteBook(id: ID!): Boolean
}
`;
