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