insure that user context is present as posts can be queried without authentication

This commit is contained in:
Moriz Wahl 2022-10-04 02:27:45 +02:00
parent 16a24bfddf
commit 32d3c5e904

View File

@ -31,7 +31,7 @@ const setPostCounter = async (postId, relation, context) => {
}
const userClickedPost = async (resolve, root, args, context, info) => {
if (args.id) {
if (args.id && context.user) {
await setPostCounter(args.id, 'CLICKED', context)
}
return resolve(root, args, context, info)