Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe how to query list of attributes relevant to the category #995

Open
2 tasks
krzysztofwolski opened this issue Oct 23, 2023 · 1 comment
Open
2 tasks
Labels
good first issue Good for newcomers

Comments

@krzysztofwolski
Copy link
Member

krzysztofwolski commented Oct 23, 2023

attributes query allows the user to apply inCategory and inCollection filters. This pattern can be used to create dynamic filters for product listings (show attribute filters relevant to the given category).

query AttributesForCategory{
  attributes(filter: {inCategory:"Q2F0ZWdvcnk6MjU="}, first:10, channel: "default-channel"){
    edges{
      node{
        name
        inputType
        choices(first:10){
          edges{
            node{
              name
            }
          }
        }
      }
    }
  }
}
{
  "data": {
    "attributes": {
      "edges": [
        {
          "node": {
            "name": "Medium",
            "inputType": "DROPDOWN",
            "choices": {
              "edges": [
                {
                  "node": {
                    "name": "Vinyl"
                  }
                },
                {
                  "node": {
                    "name": "DVD"
                  }
                },
                {
                  "node": {
                    "name": "VHS"
                  }
                },
                {
                  "node": {
                    "name": "iTunes"
                  }
                },
                {
                  "node": {
                    "name": "CD"
                  }
                },
                {
                  "node": {
                    "name": "MP3"
                  }
                }
              ]
            }
          }
        },
        ...

Tasks

@krzysztofwolski krzysztofwolski added the good first issue Good for newcomers label Oct 23, 2023
@shubhusion
Copy link

kindly assign this issue to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants