Skip to content

Getting products by tags raises KeyError #257

@sjt-rvx

Description

@sjt-rvx

Is there an existing issue for this?

  • I have searched the existing issues and added correct labels.

Description

Current Behavior

When calling get_products(<project_name>, tags=['tagname']) raises KeyError:

self = <ayon_api.graphql.GraphQlQuery object at 0x7f233378bad0>, key = 'productTags', value = ['versioned']

    def set_variable_value(self, key, value):
        """Set value for variable.
    
        Args:
            key (str): Variable name under which the value is stored.
            value (Any): Variable value used in query. Variable is not used
                if value is 'None'.
        """
>       self._variables[key]["value"] = value
        ^^^^^^^^^^^^^^^^^^^^
E       KeyError: 'productTags'

.venv/lib/python3.13/site-packages/ayon_api/graphql.py:202: KeyError

Expected Behavior

I expect getting a nice generator.

Steps To Reproduce:

No response

Additional context:

Version

This is using 1.1.3

I'm guessing it's got to do with the extra periods in there:

statuses_var = query.add_variable("productStatuses.", "[String!]")

However I'm not sure they aren't there for some reason not obvious to a graphql-newbie.

Relevant log output:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions