implemented identity, updated session, added 'workings' list

added paginated querying, added 'common'
This commit is contained in:
lnn0q 2025-05-17 00:29:55 +03:00
parent 027deba422
commit 6ada519e06
36 changed files with 1422 additions and 279 deletions

View file

@ -0,0 +1,14 @@
import { IdentityContext } from '@app/server/identity';
import { prisma } from '@app/server/prisma/client';
import { Identity } from '@generated/types';
import { toIdentitySchema } from './mappers/identityMapper';
export async function IdentityResolver(
_: any,
__: any,
{ identity }: IdentityContext
): Promise<Identity> {
if (identity == null) throw new Error('Unauthorized.');
const model = await prisma.user.findUniqueOrThrow({ where: { id: identity.id } });
return toIdentitySchema(model);
}