added resolvers, updated model, updated navbar
This commit is contained in:
parent
a8375b99c2
commit
1d40d7e15f
23 changed files with 439 additions and 301 deletions
17
app/server/graphql/resolvers/bookChapterOne.ts
Normal file
17
app/server/graphql/resolvers/bookChapterOne.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { IdentityContext } from '@app/server/identity';
|
||||
import { prisma } from '@app/server/prisma/client';
|
||||
import { BookChapter, QueryBookChapterOneArgs } from '@generated/types';
|
||||
import { toBookChapterSchema } from './mappers/bookChapterMapper';
|
||||
|
||||
export async function BookChapterOneResolver(
|
||||
_: any,
|
||||
{ id }: QueryBookChapterOneArgs,
|
||||
{ identity }: IdentityContext
|
||||
): Promise<BookChapter> {
|
||||
const model = await prisma.bookChapter.findUniqueOrThrow({
|
||||
where: {
|
||||
id
|
||||
}
|
||||
});
|
||||
return toBookChapterSchema(model);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue