Przejdź do głównej zawartości

machines

Dla: Programista

ZapytanieBetaQuery.machines

Machines of the print shop, one page at a time, with the total count: what Operation.machineId and Task.machineId point at, decommissioned ones included (isActive false; older operations still point at them). A small list that rarely changes: read it whole, without the isActive filter, and keep it.

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

Argumenty

NazwaTypOpis
filterMachineFilterInput

Conditions the machines must meet; without it every machine is listed.

paginationPaginationInput

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

sortMachineSortInput

Order of the list; without it alphabetical by name.

Zwraca

MachinesResult!

Przykład

Zapytanie
query Machines {
machines(pagination: { page: 1, pageSize: 100 }) {
items {
id
name
model
manufacturer
isActive
}
}
}
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 Machines {\n machines(pagination: { page: 1, pageSize: 100 }) {\n items {\n id\n name\n model\n manufacturer\n isActive\n }\n }\n}"
}
JSON
Odpowiedź
{
"data": {
"machines": {
"items": [
{
"id": "9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a",
"name": "Heidelberg SM 74",
"model": "Speedmaster SM 74-4",
"manufacturer": "Heidelberg",
"isActive": true
},
{
"id": "4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b",
"name": "Laminator Komfi",
"model": "Amiga 52",
"manufacturer": "Komfi",
"isActive": true
},
{
"id": "6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c",
"name": "GTO 52 (wycofana)",
"model": "GTO 52-2",
"manufacturer": "Heidelberg",
"isActive": false
}
]
}
}
}