diff --git a/resolvers/reaction.py b/resolvers/reaction.py index 5c8e28e1..65440adb 100644 --- a/resolvers/reaction.py +++ b/resolvers/reaction.py @@ -408,7 +408,7 @@ async def load_reactions_by(_, info, by, limit=50, offset=0): # sort if by stat is present if by.get("stat"): - reactions = sorted(reactions, key=lambda r: r.stat.get(by["stat"]) or r.created_at) + reactions = sorted(reactions, key=lambda r: r.stat.get(by["stat"]) or r.created_at, reverse=True) return reactions diff --git a/schemas/core.graphql b/schemas/core.graphql index e1f7db96..a85f8ab7 100644 --- a/schemas/core.graphql +++ b/schemas/core.graphql @@ -13,22 +13,42 @@ enum ReactionStatus { } enum ReactionKind { - LIKE - DISLIKE + # collabs AGREE DISAGREE + ASK + PROPOSE PROOF DISPROOF - COMMENT - QUOTE - PROPOSE - ASK - REMARK - FOOTNOTE ACCEPT REJECT + # public feed + QUOTE + COMMENT + LIKE + DISLIKE } +class ReactionKind(Enumeration): + # TYPE = # rating diff + + # editor mode + AGREE = "AGREE" # +1 + DISAGREE = "DISAGREE" # -1 + ASK = "ASK" # +0 + PROPOSE = "PROPOSE" # +0 + PROOF = "PROOF" # +1 + DISPROOF = "DISPROOF" # -1 + ACCEPT = "ACCEPT" # +1 + REJECT = "REJECT" # -1 + + # public feed + QUOTE = "QUOTE" # +0 TODO: use to bookmark in collection + COMMENT = "COMMENT" # +0 + LIKE = "LIKE" # +1 + DISLIKE = "DISLIKE" # -1 + + enum FollowingEntity { TOPIC AUTHOR