From 95505770bcd0f1b53fd46ec63f110a2805a75fee Mon Sep 17 00:00:00 2001 From: Cheikh Gueye Wane Date: Thu, 27 Jun 2024 09:47:13 +0000 Subject: [PATCH] fix(Datasets): use dataset last version to track update (#724) --- hexa/datasets/schema/types.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hexa/datasets/schema/types.py b/hexa/datasets/schema/types.py index db645770a..dd8ce4c31 100644 --- a/hexa/datasets/schema/types.py +++ b/hexa/datasets/schema/types.py @@ -101,6 +101,15 @@ def resolve_dataset_permissions(obj: Dataset, info, **kwargs): return obj +@dataset_object.field("updatedAt") +def resolve_dataset_updated_at(obj: Dataset, info, **kwargs): + return ( + max(obj.updated_at, obj.latest_version.updated_at) + if obj.latest_version + else obj.updated_at + ) + + @dataset_link_object.field("permissions") def resolve_dataset_link_permissions(obj: DatasetLink, info, **kwargs): return obj