mirror of
https://github.com/wassname/talk.git
synced 2026-08-04 13:23:35 +08:00
feat: introduce asset action count caching
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { GQLAssetTypeResolver } from "talk-server/graph/tenant/schema/__generated__/types";
|
||||
import { decodeActionCounts } from "talk-server/models/actions";
|
||||
import { Asset } from "talk-server/models/asset";
|
||||
|
||||
const Asset: GQLAssetTypeResolver<Asset> = {
|
||||
@@ -6,6 +7,7 @@ const Asset: GQLAssetTypeResolver<Asset> = {
|
||||
ctx.loaders.Comments.forAsset(asset.id, input),
|
||||
// TODO: implement this.
|
||||
isClosed: () => false,
|
||||
actionCounts: asset => decodeActionCounts(asset.action_counts),
|
||||
};
|
||||
|
||||
export default Asset;
|
||||
|
||||
@@ -930,6 +930,11 @@ type Asset {
|
||||
after: Cursor
|
||||
): CommentsConnection!
|
||||
|
||||
"""
|
||||
actionCounts stores the counts of all the actions for the Comment.
|
||||
"""
|
||||
actionCounts: ActionCounts!
|
||||
|
||||
"""
|
||||
author is the authors listed in the meta tags for the Asset.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user