aboutsummaryrefslogtreecommitdiff
path: root/src/graphql/user/resolvers.ts
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-09-28 16:58:15 -0700
committerFuwn <[email protected]>2024-09-28 16:58:15 -0700
commit22b87a179af5ca7b148453c1a1a84c85d29f4c4a (patch)
tree01f754c6c18cad902fd3820494065d403ca8a565 /src/graphql/user/resolvers.ts
parentfeat(api): set up graphql api (diff)
downloaddue.moe-22b87a179af5ca7b148453c1a1a84c85d29f4c4a.tar.xz
due.moe-22b87a179af5ca7b148453c1a1a84c85d29f4c4a.zip
feat(graphl): set up user module
Diffstat (limited to 'src/graphql/user/resolvers.ts')
-rw-r--r--src/graphql/user/resolvers.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/graphql/user/resolvers.ts b/src/graphql/user/resolvers.ts
new file mode 100644
index 00000000..a18358be
--- /dev/null
+++ b/src/graphql/user/resolvers.ts
@@ -0,0 +1,14 @@
+import { getUserBadges } from '$lib/Database/SB/User/badges';
+import type { WithIndex } from '../$types';
+import type { Resolvers, Badge } from './$types';
+
+export const resolvers: WithIndex<Resolvers> = {
+ Query: {
+ User: async (_, args /* , _context */) => {
+ return {
+ id: args.id,
+ badges: await getUserBadges(args.id) as Badge[]
+ }
+ }
+ }
+};