Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
query getCustomersOrders($accessToken: String!) {
customer(customerAccessToken: $accessToken) {
orders(first: 10) {
edges {
node {
id
currencyCode
# lineItems {
# edges {
# node {
# variant {
# product {
# title
# images(first: 1) {
# edges {
# node {
# url
# }
# }
# }
# }
# }
# }
# }
# }
totalPrice {
amount
}
}
}
}
}
}
in the above storefront API query everything that is requested is returned except for the fields that are commented out. The problem is if I include them (uncomment them) then the entire query returns null (customer: null). I also tried a different way
query getCustomersOrders($accessToken: String!) {
customer(customerAccessToken: $accessToken) {
orders(first:10) {
edges {
node {
lineItems{
edges{
node{
variant{
title
image{
url
}
}
}
}
}
id
currencyCode
totalPrice{
amount
}
}
}
}
}
}
but still I doesn't resolve the main issue. Can anyone please guide me how can fetch the product title and image alongside the other requested order info???
Hi Shah911,
Does your app have the unauthenticated_read_product_listings
access scope?
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog