query
Returns a Job resource by ID. Used to check the status of internal jobs and any applicable changes.
Anchor to Possible returnsPossible returns
- •
A job corresponds to some long running task that the client should poll for status.
Was this section helpful?
Get the status of a queued collectionUpdate job
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
job(id: "gid://shopify/Job/dc9b2604-c73b-45c6-8942-e235bac987e8") {
id
done
}
}`,
);
const data = await response.json();
query {
job(id: "gid://shopify/Job/dc9b2604-c73b-45c6-8942-e235bac987e8") {
id
done
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query { job(id: \"gid://shopify/Job/dc9b2604-c73b-45c6-8942-e235bac987e8\") { id done } }"
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
job(id: "gid://shopify/Job/dc9b2604-c73b-45c6-8942-e235bac987e8") {
id
done
}
}`,
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: `query {
job(id: "gid://shopify/Job/dc9b2604-c73b-45c6-8942-e235bac987e8") {
id
done
}
}`,
});
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
query {
job(id: "gid://shopify/Job/dc9b2604-c73b-45c6-8942-e235bac987e8") {
id
done
}
}
QUERY
response = client.query(query: query)
Response
JSON{
"job": {
"id": "gid://shopify/Job/dc9b2604-c73b-45c6-8942-e235bac987e8",
"done": false
}
}