-
-
Notifications
You must be signed in to change notification settings - Fork 141
Description
Describe the bug
I am trying to get the orders. But the product data inside lineItems is null.
Following is a single node from lineItems
"node": { "databaseId": null, "total": "798", "totalTax": null, "variationId": null, "subtotalTax": null, "subtotal": "798", "quantity": 2, "productId": null }
To Reproduce
Steps to reproduce the behavior:
I am using the graphiQL IDE. Run the following query.
query MyQuery { orders { nodes { lineItems { nodes { product { id } databaseId } } } } }
Query response. There aren't any errors. But the data is null for the fields related to product. databaseId, product, productId etc.
{ "data": { "orders": { "nodes": [ { "lineItems": { "edges": [ { "node": { "databaseId": null, "total": "798", "totalTax": null, "variationId": null, "subtotalTax": null, "subtotal": "798", "quantity": 2, "productId": null } }, { "node": { "databaseId": null, "total": "2", "totalTax": null, "variationId": null, "subtotalTax": null, "subtotal": "2", "quantity": 1, "productId": null } }, { "node": { "databaseId": null, "total": "18", "totalTax": null, "variationId": null, "subtotalTax": null, "subtotal": "18", "quantity": 1, "productId": null } } ] } } ] } }, "extensions": { "debug": [] } }
Expected behavior
To return line items(product) data of all the orders and order by ID.
Desktop (please complete the following information):
- OS: MacOS BigSur 11.4
- Browser Chrome Version 91.0.4472.164 (Official Build) (arm64)
Plugin Versions
- WooGraphQL Version: 0.10.0
- WPGraphQL Version: 1.5.3
- WordPress Version: 5.7.2
- WooCommerce Version: 5.5.1
Additional context
Any help is much appreciated. Thank you.