I am using apollo-server-lambda, Prisma ORM and graphql-codegen.
I have a query (getBookById
) that returns a Book
. Book
contains an enum called BookStatus
. I want to be able to return in ENUM in the playground but I get the error:
Cannot return null for non-nullable field Book.bookStatus.
BookStatus - TypeDef
enum BookStatus {
OPEN
DRAFT
CLOSED
}
Book - TypeDef
type Book {
id: ID!
title: String!
bookStatus: BookStatus!
}
getBookById - TypeDef
type Query {
getBookById(getBookByIdInput: GetBookByIdInput): Book
}