import { GraphQLResolverMap } from 'apollo-graphql' ; import { Author , Book } from '@prisma/client' ; import { getAuthorById } from '@src/data/authorService' ; import { getBooksByAuthor } from '@src/data/bookService' ; import { IApolloServerContext } from '@src/lib/interfaces/IApolloServerContext' ; import mutation from '@src/graphql/schema/resolvers/mutation/mutation' ; import query from '@src/graphql/schema/resolvers/query/query' ; const resolvers = { Query : query , Mutation : mutation , Book : { author ( book ) { return getAuthorById ( book . authorId ) ; } , } , Author : { books ( author ) { return getBooksByAuthor ( author . authorId ) ; } , } , } ; export default resolvers ;