Skip to content

GraphQl: Use 'allAttrib' instead of 'attrib'#322

Open
iLLiCiTiT wants to merge 12 commits intodevelopfrom
enhancement/321-refactor-usage-of-attrib-to-allattrib
Open

GraphQl: Use 'allAttrib' instead of 'attrib'#322
iLLiCiTiT wants to merge 12 commits intodevelopfrom
enhancement/321-refactor-usage-of-attrib-to-allattrib

Conversation

@iLLiCiTiT
Copy link
Copy Markdown
Member

Changelog Description

GraphQl queries use allAttrib field instead of attrib.

Additional review information

It is planned to get rid of attrib fields server side, to be able to do that we have to stop using it.

This is not 1:1 parity with previous output where it was possible to receive only limited amount of attributes from server whereas now it always returns all attribute values on an entity.

This change affects all entity types that have attributes (which are probably all of them).

Testing notes:

Project can use REST or GraphQl based on what fields are requested, but all other entities do use GraphQl to get entities using GraphQl unless explicit rest methods are used (e.g. get_rest_folder).

from ayon_api import (
    get_project,
    get_folders,
    get_tasks,
    get_products,
    get_versions,
    get_representations,
    get_users,
    get_workfiles_info,
    get_entity_lists,
)
project_name = "..."

user1 = next(get_users(project_name))
user2 = next(get_users(project_name, fields={"attrib.email"}))
project1 = get_project(project_name, fields={"productBaseTypes", "attrib"})
project2 = get_project(project_name, fields={"productBaseTypes", "attrib.frameStart"})
folder1 = next(get_folders(project_name))
folder2 = next(get_folders(project_name, fields={"attrib.frameStart"}))
task1 = next(get_tasks(project_name))
task2 = next(get_tasks(project_name, fields={"attrib.frameStart"}))
# Product doesn't have default attributes
product = next(get_products(project_name))
version1 = next(get_versions(project_name))
version2 = next(get_versions(project_name, fields={"attrib.frameStart"}))
repre1 = next(get_representations(project_name))
repre2 = next(get_representations(project_name, fields={"attrib.frameStart"}))
workfile1 = next(get_workfiles_info(project_name))
workfile2 = next(get_workfiles_info(project_name, fields={"attrib.extension"}))
list1 = next(get_entity_lists(project_name))
list2 = next(get_entity_lists(project_name, fields={"attrib.entityListCategory"}))

print("--- User ---")
print(user1["attrib"])
print(user2["attrib"])
print("--- Project ---")
print(project1["attrib"])
print(project2["attrib"])
print("--- Folder ---")
print(folder1["attrib"])
print(folder2["attrib"])
print("--- Task ---")
print(task1["attrib"])
print(task2["attrib"])
print("--- Product ---")
print(product["attrib"])
print("--- Version ---")
print(version1["attrib"])
print(version2["attrib"])
print("--- Representation ---")
print(repre1["attrib"])
print(repre2["attrib"])
print("--- Workfile ---")
print(workfile1["attrib"])
print(workfile2["attrib"])
print("--- Entity list ---")
print(list1["attrib"])
print(list2["attrib"])
  1. All of these should return correct output.

Resolves #321

@BigRoy BigRoy added the type: enhancement New feature or request label Apr 2, 2026
@iLLiCiTiT iLLiCiTiT requested review from BigRoy, antirotor and kalisp April 2, 2026 12:03
@BigRoy
Copy link
Copy Markdown
Contributor

BigRoy commented Apr 2, 2026

I get this:

--- User ---
{'developerMode': True, 'email': 'roy@ynput.io', 'fullName': 'Roy Nieterau', 'avatarUrl': None}
{'developerMode': True, 'email': 'roy@ynput.io', 'fullName': 'Roy Nieterau', 'avatarUrl': None}
--- Project ---
{'clipIn': 1, 'clipOut': 1, 'endDate': '2025-07-27T22:00:00+00:00', 'fps': 25.0, 'frameEnd': 1020, 'frameStart': 1001, 'handleEnd': 0, 'handleStart': 0, 'pixelAspect': 1.0, 'priority': 'normal', 'resolutionHeight': 1080, 'resolutionWidth': 1920, 'startDate': None, 'description': None}
{'clipIn': 1, 'clipOut': 1, 'endDate': '2025-07-27T22:00:00+00:00', 'fps': 25.0, 'frameEnd': 1020, 'frameStart': 1001, 'handleEnd': 0, 'handleStart': 0, 'pixelAspect': 1.0, 'priority': 'normal', 'resolutionHeight': 1080, 'resolutionWidth': 1920, 'startDate': None, 'description': None}
--- Folder ---
{'another': 'sexy', 'clipIn': 1, 'clipOut': 1, 'endDate': '2025-07-27T22:00:00+00:00', 'fps': 25.0, 'frameEnd': 1010, 'frameStart': 1001, 'handleEnd': 0, 'handleStart': 0, 'hello': 'bb', 'pixelAspect': 1.0, 'priority': 'normal', 'resolutionHeight': 1080, 'resolutionWidth': 1920, 'test': 'aa'}
{'another': 'sexy', 'clipIn': 1, 'clipOut': 1, 'endDate': '2025-07-27T22:00:00+00:00', 'fps': 25.0, 'frameEnd': 1010, 'frameStart': 1001, 'handleEnd': 0, 'handleStart': 0, 'hello': 'bb', 'pixelAspect': 1.0, 'priority': 'normal', 'resolutionHeight': 1080, 'resolutionWidth': 1920, 'test': 'aa'}
--- Task ---
{'another': 'sexy', 'clipIn': 1, 'clipOut': 1, 'endDate': '2025-07-27T22:00:00+00:00', 'fps': 25.0, 'frameEnd': 1010, 'frameStart': 1001, 'handleEnd': 0, 'handleStart': 0, 'hello': 'bb', 'pixelAspect': 1.0, 'priority': 'normal', 'resolutionHeight': 1080, 'resolutionWidth': 1920, 'test': 'aa'}
{'another': 'sexy', 'clipIn': 1, 'clipOut': 1, 'endDate': '2025-07-27T22:00:00+00:00', 'fps': 25.0, 'frameEnd': 1010, 'frameStart': 1001, 'handleEnd': 0, 'handleStart': 0, 'hello': 'bb', 'pixelAspect': 1.0, 'priority': 'normal', 'resolutionHeight': 1080, 'resolutionWidth': 1920, 'test': 'aa'}
--- Product ---
{}
--- Version ---
{'comment': '', 'families': ['render', 'review'], 'fps': 25.0, 'frameEnd': 1020, 'frameStart': 1001, 'handleEnd': 0, 'handleStart': 0, 'machine': 'Roy', 'source': 'P:\\Personal\\Roy\\test_assets\\SXR_StereoOpenEXR\\suzanne_rgba.%d.sxr'}
{'comment': '', 'families': ['render', 'review'], 'fps': 25.0, 'frameEnd': 1020, 'frameStart': 1001, 'handleEnd': 0, 'handleStart': 0, 'machine': 'Roy', 'source': 'P:\\Personal\\Roy\\test_assets\\SXR_StereoOpenEXR\\suzanne_rgba.%d.sxr'}
--- Representation ---
{'path': 'C:/projects/test/apps/silhouette/publish/render/renderRotoStereoSuzanne/v001/tes_silhouette_renderRotoStereoSuzanne_v001.1001.sxr', 'template': '{root[work]}/{project[name]}/{hierarchy}/{folder[name]}/publish/{product[type]}/{product[name]}/v{version:0>3}/{project[code]}_{folder[name]}_{product[name]}_v{version:0>3}<_{output}><.{frame:0>4}>.{ext}'}
{'path': 'C:/projects/test/apps/silhouette/publish/render/renderRotoStereoSuzanne/v001/tes_silhouette_renderRotoStereoSuzanne_v001.1001.sxr', 'template': '{root[work]}/{project[name]}/{hierarchy}/{folder[name]}/publish/{product[type]}/{product[name]}/v{version:0>3}/{project[code]}_{folder[name]}_{product[name]}_v{version:0>3}<_{output}><.{frame:0>4}>.{ext}'}
--- Workfile ---
{'description': '', 'extension': '.comp'}
{'description': '', 'extension': '.comp'}
--- Entity list ---
{'entityListCategory': None}
{'entityListCategory': None}

And before:

--- User ---
{'fullName': 'Roy Nieterau', 'avatarUrl': None, 'developerMode': True, 'email': 'roy@ynput.io'}
{'email': 'roy@ynput.io'}
--- Project ---
{'priority': 'normal', 'description': None, 'clipOut': 1, 'handleStart': 0, 'startDate': None, 'resolutionWidth': 1920, 'clipIn': 1, 'fps': 25.0, 'handleEnd': 0, 'endDate': '2025-07-27T22:00:00+00:00', 'frameEnd': 1020, 'frameStart': 1001, 'resolutionHeight': 1080, 'pixelAspect': 1.0}
{'priority': 'normal', 'fps': 25.0, 'resolutionWidth': 1920, 'resolutionHeight': 1080, 'pixelAspect': 1.0, 'clipIn': 1, 'clipOut': 1, 'frameStart': 1001, 'frameEnd': 1020, 'handleStart': 0, 'handleEnd': 0, 'endDate': '2025-07-27T22:00:00+00:00', 'startDate': None, 'description': None}
--- Folder ---
{'clipOut': 1, 'handleStart': 0, 'startDate': None, 'reviewer': None, 'clipIn': 1, 'fps': 25.0, 'hello': 'bb', 'another': 'sexy', 'handleEnd': 0, 'frameStart': 1001, 'priority': 'normal', 'description': None, 'resolutionWidth': 1920, 'test': 'aa', 'endDate': '2025-07-27T22:00:00+00:00', 'frameEnd': 1010, 'resolutionHeight': 1080, 'pixelAspect': 1.0}
{'frameStart': 1001}
--- Task ---
{'clipOut': 1, 'handleStart': 0, 'startDate': None, 'reviewer': None, 'clipIn': 1, 'fps': 25.0, 'hello': 'bb', 'another': 'sexy', 'handleEnd': 0, 'frameStart': 1001, 'priority': 'normal', 'description': None, 'resolutionWidth': 1920, 'test': 'aa', 'endDate': '2025-07-27T22:00:00+00:00', 'frameEnd': 1010, 'resolutionHeight': 1080, 'pixelAspect': 1.0}
{'frameStart': 1001}
--- Product ---
{'description': None, 'reviewer': None, 'productGroup': None}
--- Version ---
{'clipOut': None, 'handleStart': 0, 'machine': 'Roy', 'clipIn': None, 'fps': 25.0, 'families': ['render', 'review'], 'source': 'P:\\Personal\\Roy\\test_assets\\SXR_StereoOpenEXR\\suzanne_rgba.%d.sxr', 'handleEnd': 0, 'frameStart': 1001, 'comment': '', 'description': None, 'colorSpace': None, 'resolutionWidth': None, 'site': None, 'frameEnd': 1020, 'resolutionHeight': None, 'intent': None, 'pixelAspect': None}
{'frameStart': 1001}
--- Representation ---
{'extension': None, 'clipOut': None, 'handleStart': None, 'path': 'C:/projects/test/apps/silhouette/publish/render/renderRotoStereoSuzanne/v001/tes_silhouette_renderRotoStereoSuzanne_v001.1001.sxr', 'clipIn': None, 'fps': None, 'template': '{root[work]}/{project[name]}/{hierarchy}/{folder[name]}/publish/{product[type]}/{product[name]}/v{version:0>3}/{project[code]}_{folder[name]}_{product[name]}_v{version:0>3}<_{output}><.{frame:0>4}>.{ext}', 'handleEnd': None, 'frameStart': None, 'description': None, 'resolutionWidth': None, 'frameEnd': None, 'resolutionHeight': None, 'pixelAspect': None}
{'frameStart': None}
--- Workfile ---
{'extension': '.comp', 'description': ''}
{'extension': '.comp'}
--- Entity list ---
{'entityListCategory': None}
{'entityListCategory': None}

The desktop tools on quick run seem to be fine.

@iLLiCiTiT
Copy link
Copy Markdown
Member Author

Looks like it works as expected. We can't filter out which attributes are received, so using attrib.frameStart is redundant, but should not break anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor usage of 'attrib' to 'allAttrib'

2 participants