A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi all,
I am attempting to upgrade the Shopify API version from 2022-07 to 2022-10 for our Bulk Operation process to retrieve customer orders. However my queries are now failing and I am receiving an error code of INTERNAL_SERVER_ERROR when I am retrieving info on the currentBulkOperation query.
Please see below the current bulkOperationRunQuery which we are currently running in our Java Backend implementation along with the currentBulkOperation query which is returning the FAILED status and INTERNAL_SERVER_ERROR error code
Base-url:
https://theoptishopusa.myshopify.com/admin/api/2022-10/graphql.json
bulkOperationRunQuery:
Bulk operation is created from the query below
mutation { bulkOperationRunQuery( query:\"\"\" { orders( query: \"created_at:>=2023-04-01\" ) { edges { node { id totalPrice createdAt customerJourneySummary { firstVisit { utmParameters { source medium campaign } } lastVisit { utmParameters { source medium campaign } } } } } } } \"\"\") { bulkOperation { id status } userErrors { field message } } }
currentBulkOperation:
{ currentBulkOperation { id status errorCode createdAt completedAt objectCount fileSize url partialDataUrl } }
Logging of FAILED response with error_code INTERNAL_SERVER_ERROR returned from GraphQL query for Bulk Operation with id 3288860688674
2023-05-30 06:05:00.164 DEBUG 1 --- [or-http-epoll-3] .o.s.c.ShopifyBulkOperationConnectorImpl : leaving < getBulkOperation > returning ShopifyBulkOperation(id=gid://shopify/BulkOperation/3288860688674, status=FAILED, errorCode=INTERNAL_SERVER_ERROR, createdAt=2023-05-30T06:00:00Z, completedAt=null, objectCount=0, fileSize=null, url=null, partialDataUrl=null)
Please note that the above query to retrieve orders data completes successfully when using Shopify Version 2022-07. Also the Protected Customer data access has been approved so this should not be causing an issue.
If anyone can see that there is an issue with the queries above which is not supported in versions 2022-10 and above, it would be greatly appreciated if you can advise.
Kind regards,
Kevin
Hi @KevinOS1990 👋
Would you please try running the query in 2022-10 without the bulk operation? If this fails, please contact us here with the resulting x-request-id (+date/time) from running the single query below.
I agree, it's most likely related to the protected data scopes. This isn't a single blanket scope, so the "approved" status isn't very meaningful without the granular scopes that have been requested/granted.
{
orders(first: 1, query: "created_at:>=2023-04-01") {
nodes {
id
totalPrice
createdAt
customerJourneySummary {
firstVisit {
utmParameters {
source
medium
campaign
}
}
lastVisit {
utmParameters {
source
medium
campaign
}
}
}
}
}
}
Hope that helps!
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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