From 7c66eb5f2337e3902a9105b79361a7f2190af337 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Thu, 27 Mar 2025 16:38:23 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8add=20representation=20traits=20to=20g?= =?UTF-8?q?raphql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ayon_server/graphql/nodes/representation.py | 2 ++ ayon_server/graphql/resolvers/representations.py | 1 + 2 files changed, 3 insertions(+) diff --git a/ayon_server/graphql/nodes/representation.py b/ayon_server/graphql/nodes/representation.py index e12d1bb3f..579e2f68e 100644 --- a/ayon_server/graphql/nodes/representation.py +++ b/ayon_server/graphql/nodes/representation.py @@ -38,6 +38,7 @@ class RepresentationNode(BaseNode): attrib: RepresentationAttribType all_attrib: str data: str | None + traits: str | None # GraphQL specifics @@ -107,6 +108,7 @@ def representation_from_record( updated_at=record["updated_at"], context=json_dumps(data.get("context", {})), files=parse_files(record.get("files", [])), + traits=json_dumps(record["traits"]) if record["traits"] else None, ) diff --git a/ayon_server/graphql/resolvers/representations.py b/ayon_server/graphql/resolvers/representations.py index 6af11a38e..7d30cec4a 100644 --- a/ayon_server/graphql/resolvers/representations.py +++ b/ayon_server/graphql/resolvers/representations.py @@ -62,6 +62,7 @@ async def get_representations( "representations.creation_order AS creation_order", "representations.files AS files", # TODO: query conditionally "representations.data AS data", + "representations.traits AS traits", ] sql_joins = []