Skip to content

attributes, globalAttribute and localAttribute return wrong values #756

@creative-andrew

Description

@creative-andrew

Describe the bug
A clear and concise description of what the bug is.

  • It's not possible to filter the attributes field using the type in the where input field. It returns unfiltered results.
  • globalAttributes field return all attributes (including local attributes)
  • localAttributes field return all attributes (including global attributes)
  • globalAttributes allows selecting the type in the where input field
  • localAttributes allows selecting the type in the where input field

To Reproduce
Steps to reproduce the behavior:

  1. Create a Variable product
  2. Assign attributes to create the variations
  3. Also assign it a local attribute
image

Querying globalAttribute return also localAttributes
image

Because of the above, if you select terms, you will get a critical error:
image

While querying localAttributes, globalAttributes are also returned:
image

While querying attributes and using the where input field, results are not filtered and everything is returned:
image

There is no reason to have in the globalAttributes / localAttributes a where selector for the type:
image

Expected behavior
Remove the unnecessary input field to select type on globalAttributes and localAttributes.
Return the correct data based on the selection.

Plugin Versions

  • WooGraphQL Version: Latest
  • WPGraphQL Version: Latest
  • WordPress Version: Latest
  • WooCommerce Version: Latest

Additional context
https://dropshiptool.eu/explanation/woocommerce-product-attributes-global-vs-local/

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