wp-graphql / wp-graphql-woocommerce

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

Downloadable items query #871

Closed alexookah closed 2 months ago

alexookah commented 3 months ago

I'm currently working on implementing a page similar to WordPress Downloads, where users can view their downloadable purchases.

To achieve this, I'm querying the orders and then filtering them client-side to display only the downloadable items. Is there a way to define a where field in the query to directly retrieve orders that include downloadable results?

Thank you!

alexookah commented 3 months ago

Eventuall I used this query to get my downloads:

query getDownloads {
    customer {
        downloadableItems {
            nodes {
                url
                accessExpires
                downloadId
                downloadsRemaining
                name
                product {
                    databaseId
                }
                download {
                    downloadId
                }
            }
        }
    }
}
alexookah commented 2 months ago

Closing this issue since i do not need to query anymore for orders with downloadable content. getting user downloads worked for me.