Skip to content

Commit

Permalink
allow null comment in notifications resolver
Browse files Browse the repository at this point in the history
simply return null instead of throwing an error
  • Loading branch information
nick-funk committed Nov 20, 2023
1 parent 2d61ee2 commit 294fb31
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions server/src/core/server/graph/resolvers/Notification.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { CommentNotFoundError } from "coral-server/errors";
import { Notification } from "coral-server/models/notifications/notification";

import {
Expand All @@ -18,12 +17,7 @@ export const NotificationResolver: Required<
return null;
}

const comment = await ctx.loaders.Comments.comment.load(commentID);
if (!comment) {
throw new CommentNotFoundError(commentID);
}

return comment;
return await ctx.loaders.Comments.comment.load(commentID);
},
commentStatus: ({ commentStatus }) => commentStatus,
dsaReport: async ({ reportID }, input, ctx) => {
Expand Down

0 comments on commit 294fb31

Please sign in to comment.