import { GraphQLNonNull , GraphQLObjectType , GraphQLString , GraphQLID , GraphQLList , } from 'graphql' ; import BookType from '@src/graphql/schema/typedefs/BookType' ; const AuthorType = new GraphQLObjectType ( { name : 'Author' , description : 'A author' , fields : ( ) => ( { authorId : { type : GraphQLNonNull ( GraphQLID ) , description : 'id of the author' , } , username : { type : GraphQLString , description : 'authors username' , } , books : { type : GraphQLList ( BookType ) , description : 'list of authors books' , } , } ) , } ) ; export default AuthorType ;