import { IdentityContext } from '@app/server/identity'; import { Book, QueryBookOneArgs } from '@generated/types'; import { books } from './booksManyResolver'; export async function BookOneResolver( _: any, { id }: QueryBookOneArgs, { identity }: IdentityContext ): Promise { const book = books.filter(item => item.id === id)[0]; return book; }