A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi,
I'm using the below query(screenshot) and getting the error: "Field 'abandonedCheckoutsConnection' doesn't exist on type 'QueryRoot'".
I have tried multiple different queries but got the same response.
Please suggest the correct query to fetch all the abandoned checkout data using graphQL.
Below are the attachments of the query and response.
To fetch all the abandoned checkout data, you can use the abandonment
and abandonment
queries from the Shopify GraphQL Admin API. Below are examples of how to use these queries:
query GetAbandonmentByCheckoutId {
abandonmentByAbandonedCheckoutId(abandonedCheckoutId: "your_abandoned_checkout_id") {
abandonedCheckoutPayload {
abandonedCheckoutUrl
id
lineItems(first: 5) {
edges {
node {
title
quantity
priceSet {
shopMoney {
amount
currencyCode
}
}
}
}
}
lineItemsQuantity
totalPriceSet {
shopMoney {
amount
currencyCode
}
}
}
abandonmentType
createdAt
customer {
email
firstName
lastName
}
emailSentAt
emailState
}
}
query GetAbandonmentById {
abandonment(id: "your_abandonment_id") {
abandonedCheckoutPayload {
abandonedCheckoutUrl
id
lineItems(first: 5) {
edges {
node {
title
quantity
priceSet {
shopMoney {
amount
currencyCode
}
}
}
}
}
lineItemsQuantity
totalPriceSet {
shopMoney {
amount
currencyCode
}
}
}
abandonmentType
createdAt
customer {
email
firstName
lastName
}
emailSentAt
emailState
}
}
Would these work for you?
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
Hi @Liam,
Thanks for the reply.
If I use abandonmentByAbandonedCheckoutId(abandonedCheckoutId: "your_abandoned_checkout_id") then I have to pass the ID of the abandoned checkout and it will return data related to that abandoned_checkout.
But here I need to fetch all the abandoned checkout data between 2 updated_at dates without using a particular Id of abandoned checkout..
Please suggest.
Thanks @Liam . How do you get the list of "your_abandonment_id"? If you do not have that id, then these queries are of no use. What is the query to get the list of abandonment ids?
Thanks,
John