Created
June 26, 2024 19:16
-
-
Save dtauer/c87006293556de6d3a03f3627fb17b48 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mutation: { | |
editIssue: async (_, { input }, ctx) => { | |
if (!ctx.user) | |
throw new GraphQLError('UNAUTHORIZED', { extensions: { code: 401 } }) | |
const { id, ...update } = input | |
const result = await db | |
.update(issues) | |
.set(update ?? {}) | |
.where(and(eq(issues.userid, ctx.urser.id), eq(issues.id, id))) | |
.returning() | |
return result[0] | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment