storefrontSectionGenerationJob
Requires permission storefront:storefront:update.
Poll a section-generation job. Jobs expire an hour after their last update. A job whose server stopped before it finished (a deploy, a crash) reads FAILED (CANCELLED if a cancel was asked for) about a minute after its last update.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query StorefrontSectionGenerationJob($jobId: ID!) {
storefrontSectionGenerationJob(jobId: $jobId) {
status
costDisplay
creditsUsedCents
error
jobId
partial
writing {
name
codeTail
key
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query StorefrontSectionGenerationJob($jobId: ID!) {\n storefrontSectionGenerationJob(jobId: $jobId) {\n status\n costDisplay\n creditsUsedCents\n error\n jobId\n partial\n writing {\n name\n codeTail\n key\n }\n }\n}",
"variables": {
"jobId": "id"
}
}
EOF
Variables:
{
"jobId": "id"
}
Response:
{
"data": {
"storefrontSectionGenerationJob": {
"status": "CANCELLED",
"costDisplay": "string",
"creditsUsedCents": 0,
"error": "string",
"jobId": "id",
"partial": "string",
"writing": {
"name": "string",
"codeTail": "string",
"key": "string"
}
}
}
}
storefrontSectionGenerationJob(
jobId: ID!
): StorefrontSectionJob!
Arguments
storefrontSectionGenerationJob.jobId ● ID! non-null scalar
The ID of the section generation job.
Type
StorefrontSectionJob object
A storefront section generation.