Hi,
It seems something has changed recently with the behaviour of the Shopify GraphQL Admin API endpoint.
I’m calling the Shopify GraphQL API from Python like this:
url = f"https://{shop_id}/admin/api/2025-07/graphql.json"
headers = {
"Content-Type": "application/json",
"X-Shopify-Access-Token": access_token,
}
payload = {
"query": query,
"variables": variables or {},
}
resp = requests.post(url, json=payload, headers=headers, timeout=1)
resp.raise_for_status()
result = resp.json()
I’m seeing some strange behaviour around request completion time.
With timeout=1, the request succeeds and takes around 1.31s:
x-request-id: fe8dfc8d-02f0-4681-b595-9ba173ea59b0-1778516164
duration: 1.310525s
With timeout=20, the same request also succeeds, but takes around 20.32s:
x-request-id: 07e8ff16-be4d-4fe7-b203-d4c90a338263-1778516357
duration: 20.316896s
With no timeout set, the request eventually completes after around 2m 7s:
x-request-id: 04eea75e-6cf3-4753-912b-a084f5140659-1778516760
duration: 2:07.284663
This makes it look like the GraphQL response body is returned fairly quickly, but the connection is not being closed promptly. The overall request duration seems to depend on the client timeout rather than the actual GraphQL processing time.
The query I make is fetching recent orders with fulfillment orders, line items, fulfillments, product/variant images, and tracking info. Here is the query:
query getOrders($first: Int!, $query: String, $after: String) {
orders(
first: $first
query: $query
after: $after
sortKey: CREATED_AT
reverse: true
) {
pageInfo {
hasNextPage
endCursor
}
edges {
node {
id
name
email
createdAt
displayFulfillmentStatus
customer {
firstName
lastName
}
shippingAddress {
city
}
fulfillmentOrders(first: 10) {
edges {
node {
id
status
lineItems(first: 10) {
edges {
node {
id
totalQuantity
remainingQuantity
lineItem {
id
sku
name
product {
title
onlineStoreUrl
handle
featuredImage {
url
}
}
variant {
id
title
image {
url
}
}
}
}
}
}
fulfillments(first: 10) {
edges {
node {
id
status
trackingInfo {
company
number
url
}
}
}
}
}
}
}
}
}
}
}
With variables:
{
"first": 10,
"query": "created_at:>'2026-05-11T15:23:53Z'",
"after": null
}
Has anyone else seen something similar recently?
Is there a known issue where the Admin GraphQL API returns the response body but keeps the connection open for much longer than expected?
Right now, my “fix” is to set timeout=1
Thank you for your help,