Przejdź do głównej zawartości

tasks

Dla: Programista

ZapytanieBetaQuery.tasks

Production tasks, one page at a time, with the total count: what the shop floor is doing on the operations of orders, with status and times. Filter by order, operation, machine or status; with updatedFrom and the UPDATED_AT sort, fetch only tasks changed since your last sync. Without a sort: earliest due date first (tasks without one last), then the most recently created first.

Wymagany zakresproduction:read
Dostępne odPrynt 0.28.0
StabilnośćBeta (co to znaczy)

Argumenty

NazwaTypOpis
filterTaskFilterInput

Conditions the tasks must meet; without it every task is listed.

paginationPaginationInput

Page of the list to return; without it the first page at the default size.

sortTaskSortInput

Order of the list; without it earliest due date first (tasks without one last), then the most recently created first.

Zwraca

TasksResult!

Przykład

Zapytanie
query Tasks($orderId: ID!) {
tasks(
filter: { orderId: $orderId }
sort: { field: UPDATED_AT, direction: ASC }
pagination: { page: 1, pageSize: 20 }
) {
totalCount
items {
id
title
currentStatus
operationId
machineId
dueDate
startedAt
completedAt
updatedAt
}
}
}
Zmienne
{
"orderId": "7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f"
}
Wywołanie (curl)
curl -sS https://twoja-drukarnia.prynt.pl/api/v1/graphql \
-H "Authorization: Bearer $PRYNT_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"query": "query Tasks($orderId: ID!) {\n tasks(\n filter: { orderId: $orderId }\n sort: { field: UPDATED_AT, direction: ASC }\n pagination: { page: 1, pageSize: 20 }\n ) {\n totalCount\n items {\n id\n title\n currentStatus\n operationId\n machineId\n dueDate\n startedAt\n completedAt\n updatedAt\n }\n }\n}",
"variables": {
"orderId": "7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f"
}
}
JSON
Odpowiedź
{
"data": {
"tasks": {
"totalCount": 2,
"items": [
{
"id": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c01",
"title": "Druk 4+4 — 1084/2026",
"currentStatus": "COMPLETED",
"operationId": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d01",
"machineId": "9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a",
"dueDate": "2026-10-09T14:00:00.000Z",
"startedAt": "2026-10-06T06:10:00.000Z",
"completedAt": "2026-10-06T08:40:00.000Z",
"updatedAt": "2026-10-06T08:40:00.000Z"
},
{
"id": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c02",
"title": "Foliowanie mat — 1084/2026",
"currentStatus": "IN_PROGRESS",
"operationId": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d02",
"machineId": "4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b",
"dueDate": "2026-10-09T14:00:00.000Z",
"startedAt": "2026-10-06T09:05:00.000Z",
"completedAt": null,
"updatedAt": "2026-10-06T09:05:00.000Z"
}
]
}
}
}