wp-graphql / wp-graphql-woocommerce

Add WooCommerce support and functionality to your WPGraphQL server
https://woographql.com
GNU General Public License v3.0
649 stars 130 forks source link

Is there a way to dynamically retrieve all attributes without querying all products? #892

Open mfa56 opened 2 months ago

mfa56 commented 2 months ago

Hello,

I'm currently working on an integration using WPGraphQL and WooCommerce, and I was wondering if there’s an efficient way to retrieve all product attributes dynamically without knowing their names beforehand and without querying every product in the store.

The goal is to get a list of all possible attributes, but querying each product to extract them seems inefficient for larger stores. Is there a recommended method or an existing query for fetching all available attributes globally?

Thank you for your insights and assistance!

kidunot89 commented 1 month ago

@mfa56 Sorry for the late response. You should checkout the collectionStats query it attempts to port the functionality of the product collection data endpoint of the WooCommerce Store API.