add nComments resolver
This commit is contained in:
parent
f40fe85d5a
commit
a49cd8500c
|
@ -759,6 +759,11 @@ export default {
|
|||
|
||||
return sats || 0
|
||||
},
|
||||
meComments: async (item, args, { me, models }) => {
|
||||
if (!me) return 0
|
||||
|
||||
return await models.items.count({ where: { userId: me.id, parentId: item.id } })
|
||||
},
|
||||
mine: async (item, args, { me, models }) => {
|
||||
return me?.id === item.userId
|
||||
},
|
||||
|
|
|
@ -60,6 +60,7 @@ export default gql`
|
|||
sats: Int!
|
||||
upvotes: Int!
|
||||
meSats: Int!
|
||||
meComments: Int!
|
||||
ncomments: Int!
|
||||
comments: [Item!]!
|
||||
path: String
|
||||
|
|
Loading…
Reference in New Issue