Skip to content

Projects: Fix fetching of projects#313

Open
iLLiCiTiT wants to merge 2 commits intodevelopfrom
bugfix/projects-fetching-fixes
Open

Projects: Fix fetching of projects#313
iLLiCiTiT wants to merge 2 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.

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.

2 participants