diff options
| author | Fuwn <[email protected]> | 2026-03-01 15:21:28 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-03-01 15:32:43 -0800 |
| commit | 9de256c76ecb8b71b2c84a36c6e972d65b489add (patch) | |
| tree | 8feb3ca2ab512ecf2ca6d8fe09379079b64ea179 /src/graphql/user/resolvers.ts | |
| parent | fix(anime): unify due classification and harden subtitle matching (diff) | |
| download | due.moe-9de256c76ecb8b71b2c84a36c6e972d65b489add.tar.xz due.moe-9de256c76ecb8b71b2c84a36c6e972d65b489add.zip | |
chore(types): decouple app code from fragile generated route types
Diffstat (limited to 'src/graphql/user/resolvers.ts')
| -rw-r--r-- | src/graphql/user/resolvers.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/graphql/user/resolvers.ts b/src/graphql/user/resolvers.ts index 9773d8b0..879d066d 100644 --- a/src/graphql/user/resolvers.ts +++ b/src/graphql/user/resolvers.ts @@ -10,7 +10,7 @@ import { type Badge as DatabaseBadge } from '$lib/Database/SB/User/badges'; import type { WithIndex } from '../$types'; -import type { Resolvers, Badge } from './$types'; +import type { Resolvers as RootResolvers, Badge } from '../$types'; import type { RequestEvent } from '@sveltejs/kit'; import { getUserPreferences, @@ -26,6 +26,7 @@ import { import privilegedUser from '$lib/Utility/privilegedUser'; type Context = RequestEvent<Partial<Record<string, string>>, string | null>; +type UserResolvers = Pick<RootResolvers, 'Query' | 'Mutation' | 'User' | 'Badge' | 'Preferences'>; const toGraphQLBadges = (databaseBadges: DatabaseBadge[]): Badge[] => databaseBadges.map((databaseBadge) => ({ @@ -118,7 +119,7 @@ const ensureBadgeOwnerOrPrivileged = async ( if (!ownsBadge) throw new Error('Unauthorized'); }; -export const resolvers: WithIndex<Resolvers> = { +export const resolvers: WithIndex<UserResolvers> = { Query: { User: async (_, args) => { if (!args.id) return null; |