shopify - Categories and sub categories using API - headless
What is the best way to display categories and sub categories through an API for a headless front end? I can't use the menu items in the store front as they are not available in my GraphQL layer.
I am trying to build a main category structure like: Mens > Clothing, Mens > Footwear. And also have other structures like Brand and Colour that are assigned to each product. I'd like to list these on a page that can be filtered to a granular level.
Can these structures be created using collections and product types? Or is a better approach to define a JSON structure of the categories and then set up each product in Shopify to have a flat level of tags?
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.