Skip to content

Projects: Fix fetching of projects#313

Merged
iLLiCiTiT merged 6 commits intodevelopfrom
bugfix/projects-fetching-fixes
Mar 20, 2026
Merged

Projects: Fix fetching of projects#313
iLLiCiTiT merged 6 commits intodevelopfrom
bugfix/projects-fetching-fixes

Conversation

@iLLiCiTiT
Copy link
Member

Changelog Description

Fetch correct project using GraphQl and fill more data when merging GraphQl and REST project data.

Additional review information

When GraphQl was used to get project it did not use project name as filter for the project which lead to use "first" project -> wrong data.

Merge of GraphQl and REST data was restricted to specific keys, now the restricted keys will override anything from REST but all other keys from GraphQl are appended to the REST project.

Testing notes:

  1. Fetching of project using get_project should work if only graphql fields are requested (e.g. fields={"attrib"}).

@iLLiCiTiT iLLiCiTiT added the type: bug Something isn't working label Mar 19, 2026
@iLLiCiTiT iLLiCiTiT self-assigned this Mar 19, 2026
@iLLiCiTiT iLLiCiTiT requested review from BigRoy and antirotor March 19, 2026 15:01
Copy link
Member

@antirotor antirotor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it fixed the problem where the returned data were wrong, but there is still discrepancy between the data fields returned.

So lets assume one project TestProject and running these two calls:

import ayon_api
from pprint import pprint

project_name = "TestProject"

graphql_result = ayon_api.get_project(project_name, fields={"attrib"})
rest_result = ayon_api.get_rest_project(project_name)

key_diff = set(graphl_result["attrib"].keys()) - set(rest_result["attrib"].keys())

in my case, the key_diff is:

{'ftrackId', 'shotgridPush', 'shotgridType', 'tools', 'shotgridId', 'ftrackPath'}

other than that the values are matching.

I think those two call should produce 1:1 result.

@iLLiCiTiT
Copy link
Member Author

Should be resolved.

@iLLiCiTiT iLLiCiTiT requested a review from antirotor March 20, 2026 07:54
Copy link
Member

@antirotor antirotor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm it works as expected

@iLLiCiTiT iLLiCiTiT merged commit 0a043cd into develop Mar 20, 2026
3 checks passed
@iLLiCiTiT iLLiCiTiT deleted the bugfix/projects-fetching-fixes branch March 20, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants