Solved

Field customerJourneySummary doesn't exist on type Order - GraphQL API

manhnq94
Excursionist
30 1 5

Hi everyone,

When I ran the following query, Shopify response an error with message "Field customerJourneySummary doesn't exist on type Order" but in the API document there is a customerJourneySummary field for the Order object.

I cant figure out why this is happened, please tell me where the problem is.

Thank you for your support!

 

Query:

graphQLquery = """
            query ($orderID: ID!){
                order(id: $orderID) {
                    id
                    customerJourneySummary {
                        firstVisit {
                            landingPage 
                            referrerUrl 
                            source 
                            sourceType 
                        }
                        lastVisit {
                            landingPage 
                            referrerUrl 
                            source 
                            sourceType 
                        }
                        ready 
                    }
                }
            }
        """

 

Response text:

{
    "errors": [
        {
            "message": "Field 'customerJourneySummary' doesn't exist on type 'Order'",
            "locations": [
                {
                    "line": 5,
                    "column": 21
                }
            ],
            "path": [
                "query",
                "order",
                "customerJourneySummary"
            ],
            "extensions": {
                "code": "undefinedField",
                "typeName": "Order",
                "fieldName": "customerJourneySummary"
            }
        }
    ]
}

 

Document link: https://shopify.dev/docs/admin-api/graphql/reference/orders/order?api%5Bversion%5D=2020-10

Capture.PNG

Accepted Solution (1)
manhnq94
Excursionist
30 1 5

This is an accepted solution.

Hi @syf_ ,

 

Thank you for your reply, actually I found out that I use the wrong API version in my code which is 2020-07 instead of 2020-10 so that's why I cant get the customerJourneySummary field.

 

Thanks.

View solution in original post

Replies 3 (3)

manhnq94
Excursionist
30 1 5

Hello, is anybody there?

syf_
Shopify Staff
95 21 24

Hi @manhnq94,

I tried the above query and I wan't able to reproduce your results; the query returned the expected data for me. Could you please provide me with the request-id found in the response header of  the query that isn't working, and I'd be happy to look into this further for you.

 

Thanks,

Seth.

syf_ | Developer Support @ 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

manhnq94
Excursionist
30 1 5

This is an accepted solution.

Hi @syf_ ,

 

Thank you for your reply, actually I found out that I use the wrong API version in my code which is 2020-07 instead of 2020-10 so that's why I cant get the customerJourneySummary field.

 

Thanks.