Skip to content

Woocommerce 9.6.0 breaks GetOrders request #919

Open
@catative

Description

@catative

Describe the bug

A request like that:
query GetOrders($customerId: Int!) { customer(customerId: $customerId) { orders { nodes { id databaseId date status total lineItems { nodes { productId quantity total } } billing { firstName lastName address1 city state postcode country } shipping { firstName lastName address1 address2 city state postcode country } } } } }

starts returning an empty array:
{ "data": { "customer": { "orders": { "nodes": [] } } }, "extensions": { "debug": [ { "type": "DEBUG_LOGS_INACTIVE", "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled." } ] } }

instead of orders if you update the Woocommerce plugin to version 9.6.0 and above. To authorize a request as a Bearer Token, I use the latest version of the WPGraphQL JWT Authentication plugin (0.7.0).

To Reproduce

Steps to reproduce the behavior:

  1. Install Woocommerce plugin (9.6.0 and above)
  2. Install latest WPGraphQL (1.32.1), WPGraphQL WooCommerce (WooGraphQL) (0.21.1) and WPGraphQL JWT Authentication (0.7.0) plugins
  3. Make login request like that to get actual authToken:

mutation LoginUser { login( input: { username: "test@test.com", password: "12345" } ) { authToken refreshToken customer { id databaseId firstName lastName email username billing { phone address1 address2 city postcode state lastName firstName email country company address1 } } } }

  1. Make GetOrders request with actual authToken

Expected behavior

Should return an array of orders like that:

{ "data": { "customer": { "orders": { "nodes": [ { "id": "b3JkZXI6MjUyODg=", "databaseId": 25288, "date": "2025-02-18T11:16:27+00:00", "status": "PENDING", "total": "1000,00 ₸", "lineItems": { "nodes": [ { "productId": null, "quantity": 2, "total": "1000" } ] }, "billing": { "firstName": "User", "lastName": null, "address1": "Street example, 1", "city": "City example", "state": null, "postcode": null, "country": null }, "shipping": { "firstName": "User", "lastName": null, "address1": "Street example, 1", "address2": null, "city": "City example", "state": null, "postcode": null, "country": null } },

Desktop (please complete the following information):

  • OS: Linux Kubuntu 22.04
  • Browser: chrome
  • Version: 130.0.6723.116

Plugin Versions

  • WooGraphQL Version: 0.21.1
  • WPGraphQL Version: 1.32.1
  • WPGraphQL JWT Authentication: 0.7.0
  • WordPress Version: 6.7.2
  • WooCommerce Version: 9.6.0 and above

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions