added resolvers, updated model, updated navbar

This commit is contained in:
lnn0q 2025-05-17 21:41:07 +03:00
parent a8375b99c2
commit 1d40d7e15f
23 changed files with 439 additions and 301 deletions

View file

@ -0,0 +1,17 @@
import { IdentityContext } from '@app/server/identity';
import { prisma } from '@app/server/prisma/client';
import { Book, QueryBookOneArgs } from '@generated/types';
import { toBookSchema } from './mappers/bookMapper';
export async function BookOneResolver(
_: any,
{ id }: QueryBookOneArgs,
{ identity }: IdentityContext
): Promise<Book> {
const model = await prisma.book.findUniqueOrThrow({
where: {
id
}
});
return toBookSchema(model);
}