mirror of
https://github.com/wassname/talk.git
synced 2026-08-05 13:30:26 +08:00
review: applied some review changes
This commit is contained in:
@@ -9,7 +9,7 @@ import {
|
||||
} from "talk-server/graph/tenant/schema/__generated__/types";
|
||||
import {
|
||||
ACTION_ITEM_TYPE,
|
||||
retrieveManyAuthoredActionPresence,
|
||||
retrieveManyUserActionPresence,
|
||||
} from "talk-server/models/actions";
|
||||
import {
|
||||
retrieveCommentAssetConnection,
|
||||
@@ -21,9 +21,9 @@ export default (ctx: Context) => ({
|
||||
comment: new DataLoader((ids: string[]) =>
|
||||
retrieveManyComments(ctx.mongo, ctx.tenant.id, ids)
|
||||
),
|
||||
retrieveAuthoredActionPresence: new DataLoader<string, GQLActionPresence>(
|
||||
retrieveMyActionPresence: new DataLoader<string, GQLActionPresence>(
|
||||
(itemIDs: string[]) =>
|
||||
retrieveManyAuthoredActionPresence(
|
||||
retrieveManyUserActionPresence(
|
||||
ctx.mongo,
|
||||
ctx.tenant.id,
|
||||
// This should only ever be accessed when a user is logged in.
|
||||
|
||||
@@ -19,8 +19,10 @@ const Comment: GQLCommentTypeResolver<Comment> = {
|
||||
replies: (comment, input, ctx) =>
|
||||
ctx.loaders.Comments.forParent(comment.asset_id, comment.id, input),
|
||||
actionCounts: comment => decodeActionCounts(comment.action_counts),
|
||||
authoredActionPresence: (comment, input, ctx) =>
|
||||
ctx.loaders.Comments.retrieveAuthoredActionPresence.load(comment.id),
|
||||
myActionPresence: (comment, input, ctx) =>
|
||||
ctx.user
|
||||
? ctx.loaders.Comments.retrieveMyActionPresence.load(comment.id)
|
||||
: null,
|
||||
};
|
||||
|
||||
export default Comment;
|
||||
|
||||
@@ -833,10 +833,10 @@ type Comment {
|
||||
actionCounts: ActionCounts!
|
||||
|
||||
"""
|
||||
authoredActionPresence stores the presense information for all the actions
|
||||
myActionPresence stores the presense information for all the actions
|
||||
left by the current User on this Comment.
|
||||
"""
|
||||
authoredActionPresence: ActionPresence! @auth
|
||||
myActionPresence: ActionPresence
|
||||
}
|
||||
|
||||
type PageInfo {
|
||||
|
||||
Reference in New Issue
Block a user