Skip to content

orderNotes returns null #553

Open
Open
@flocosnier

Description

When querying customer orders, I'm trying to get the order notes but the query returns an empty array.

Here's the query :

query getCustomer($id: ID!) {
		customer(id: $id) {
			username
			calculatedShipping
			databaseId
			date
			displayName
			email
			firstName
			hasCalculatedShipping
			id
			isJwtAuthSecretRevoked
			isPayingCustomer
			isVatExempt
			jwtAuthExpiration
			jwtAuthToken
			jwtRefreshToken
			jwtUserSecret
			lastName
			shipping {
				address1
				address2
				city
				company
				country
				email
				firstName
				lastName
				phone
				postcode
				state
			}
			billing {
				address1
				address2
				city
				company
				country
				email
				firstName
				lastName
				phone
				postcode
				state
			}
			orderCount
			orders {
				edges {
					node {
						orderNotes {
							edges {
								isCustomerNote
								node {
									content
									date
								}
							}
						}
						billing {
							address1
							address2
							city
							company
							email
							country
							lastName
							firstName
							state
							postcode
							phone
						}
						shipping {
							address1
							address2
							city
							company
							email
							country
							lastName
							firstName
							state
							postcode
							phone
						}
						cartHash
						cartTax
						commentCount
						commentStatus
						createdVia

						customerNote
						datePaid
						dateCompleted
						date
						databaseId
						discountTax(format: FORMATTED)
						discountTotal(format: FORMATTED)
						hasBillingAddress
						hasDownloadableItem
						hasShippingAddress
						id
						isDownloadPermitted
						metaData {
							id
							key
							value
						}
						modified
						needsPayment
						needsProcessing
						needsShippingAddress
						orderKey
						orderNumber
						orderVersion
						paymentMethod
						paymentMethodTitle
						pricesIncludeTax
						transactionId
						totalTax(format: FORMATTED)
						total(format: FORMATTED)
						subtotal
						status
						shippingTotal
						shippingTax
						shippingAddressMapUrl
						lineItems {
							edges {
								node {
									subtotal
									product {
										id
										databaseId
										slug
										name
										attributes {
											edges {
												node {
													name
												}
											}
										}
										... on SimpleProduct {
											price(format: FORMATTED)
										}
										... on VariableProduct {
											price(format: FORMATTED)
										}

										image {
											mediaItemUrl
											altText
										}
									}
									variation {
										description
									}
									quantity
								}
							}
						}
					}
				}
			}
		}
	}

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions