From 822225b781648a34dd2e9f780e9e71e23597e47f Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 29 Apr 2022 22:09:19 +0400 Subject: [PATCH] fix: order history entries --- src/graphql/schema/questions.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/graphql/schema/questions.ts b/src/graphql/schema/questions.ts index 05afee3..ed39ab6 100644 --- a/src/graphql/schema/questions.ts +++ b/src/graphql/schema/questions.ts @@ -113,7 +113,13 @@ export const QuestionObj = builder.prismaObject("Question", { resolve: (parent) => (parent.extra as any)?.visualization, // used for guesstimate only, see searchGuesstimate.ts nullable: true, }), - history: t.relation("history", {}), + history: t.relation("history", { + query: () => ({ + orderBy: { + timestamp: "asc", + }, + }), + }), }), });