feat: expose fetchedStr and firstSeenStr

This commit is contained in:
Vyacheslav Matyukhin 2022-05-26 13:47:54 +04:00
parent 5fdea80f8b
commit 9c162fab9d
No known key found for this signature in database
GPG Key ID: 3D2A774C5489F96C

View File

@ -81,6 +81,11 @@ const QuestionShapeInterface = builder
"Last timestamp at which metaforecast fetched the question",
resolve: (parent) => parent.fetched,
}),
fetchedStr: t.string({
description:
"Last timestamp at which metaforecast fetched the question, in ISO 8601 format",
resolve: (parent) => parent.fetched.toISOString(),
}),
qualityIndicators: t.field({
type: QualityIndicatorsObj,
resolve: (parent) =>
@ -127,6 +132,11 @@ export const QuestionObj = builder.prismaObject("Question", {
description: "First timestamp at which metaforecast fetched the question",
resolve: (parent) => parent.firstSeen,
}),
firstSeenStr: t.string({
description:
"First timestamp at which metaforecast fetched the question, in ISO 8601 format",
resolve: (parent) => parent.firstSeen.toISOString(),
}),
history: t.relation("history", {
query: () => ({
orderBy: {