wp-graphql / wp-graphql-woocommerce

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

Query orders return empty response #840

Open Sylvesterx1 opened 3 months ago

Sylvesterx1 commented 3 months ago

When I query orders from wordpress dashboard then I see correct response.

I know query orders is restricted.

I build headless admin, and I want get all orders as admin user. For this I generate public_key and secret_key with admin privilages.

I try add in headers, also in postman I try switch to oAuth 1.0 and here I provide consumer key and private key. But still I see empty result.

How can I query orders as admin without need get woocommerce session ? (i need get all orders created in system from all customers).

For REST API I can include public_key and secret_key and I see correct response all orders. I need do the same using graphql.

ZeroPie commented 4 weeks ago

The query does not work on my end either, im using 0.19. I also get responses with the rest api, but no responses with the grapqhl query

/wp-json/wc/v3/orders?email=zeropie@zeropie.com will give me a response

query getOrders ($billingEmail: String) {
 orders(where: { billingEmail: $billingEmail }) {
        nodes {
          date
        total
        status
        }
    }
}

wont