aboutsummaryrefslogtreecommitdiff
path: root/src/graphql/user/resolvers.ts
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-03-01 15:21:28 -0800
committerFuwn <[email protected]>2026-03-01 15:32:43 -0800
commit9de256c76ecb8b71b2c84a36c6e972d65b489add (patch)
tree8feb3ca2ab512ecf2ca6d8fe09379079b64ea179 /src/graphql/user/resolvers.ts
parentfix(anime): unify due classification and harden subtitle matching (diff)
downloaddue.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.ts5
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;