fix(server): 500 error when Commit.author is null

This commit is contained in:
Kristaps Fabians Geikins
2023-07-19 14:16:48 +03:00
parent 80df259159
commit a7ba118f3a
2 changed files with 2 additions and 1 deletions
@@ -17,6 +17,7 @@ export = {
Version: {
async authorUser(parent, _args, ctx) {
const { author } = parent
if (!author) return null
return (await ctx.loaders.users.getUser.load(author)) || null
},
async model(parent, _args, ctx) {
@@ -85,7 +85,7 @@ export type ServerInfo = ServerConfigRecord & {
export type CommitRecord = {
id: string
referencedObject: string
author: string
author: Nullable<string>
message: Nullable<string>
createdAt: Date
sourceApplication: Nullable<string>