aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/graphql/user/resolvers.ts2
-rw-r--r--src/graphql/user/schema.graphql2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/graphql/user/resolvers.ts b/src/graphql/user/resolvers.ts
index 2e1160bc..ebdba2a6 100644
--- a/src/graphql/user/resolvers.ts
+++ b/src/graphql/user/resolvers.ts
@@ -70,6 +70,8 @@ const authenticatedPreferencesOperation = async (
export const resolvers: WithIndex<Resolvers> = {
Query: {
User: async (_, args) => {
+ if (!args.id) return null;
+
return {
id: args.id,
badges: (await getUserBadges(args.id)) as Badge[],
diff --git a/src/graphql/user/schema.graphql b/src/graphql/user/schema.graphql
index 66d14ce0..b8217b5a 100644
--- a/src/graphql/user/schema.graphql
+++ b/src/graphql/user/schema.graphql
@@ -1,5 +1,5 @@
type Query {
- User(id: Int): User!
+ User(id: Int): User
}
type Mutation {