Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
export async function userOwnsDirectiveResolver(next, source, args, context) {
if (source[args.field] === await getUserId(context)) {
return await next();
}
else {
throw new Error('Not authorized');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.