Przejdź do głównej zawartości

paints

Dla: Programista

ZapytanieBetaQuery.paints

Paints in the warehouse with their stock, one page at a time, with the total count. Filter and sort them; with updatedFrom and the UPDATED_AT sort, fetch only paints whose card or stock changed since your last sync.

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

Argumenty

NazwaTypOpis
filterPaintFilterInput

Conditions the paints must meet; without it every paint is listed.

paginationPaginationInput

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

sortPaintSortInput

Order of the list; without it newest first.

Zwraca

PaintsResult!

Przykład

Zapytanie
query ChangedPaints($since: DateTime) {
paints(
filter: { updatedFrom: $since }
sort: { field: UPDATED_AT, direction: ASC }
pagination: { page: 1, pageSize: 100 }
) {
items {
id
code
name
quantityGrams
minimumStock
updatedAt
}
pageInfo {
hasNextPage
}
}
}
Zmienne
{
"since": "2026-10-05T06:55:00.000Z"
}
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 ChangedPaints($since: DateTime) {\n paints(\n filter: { updatedFrom: $since }\n sort: { field: UPDATED_AT, direction: ASC }\n pagination: { page: 1, pageSize: 100 }\n ) {\n items {\n id\n code\n name\n quantityGrams\n minimumStock\n updatedAt\n }\n pageInfo {\n hasNextPage\n }\n }\n}",
"variables": {
"since": "2026-10-05T06:55:00.000Z"
}
}
JSON
Odpowiedź
{
"data": {
"paints": {
"items": [
{
"id": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b02",
"code": "F-1208",
"name": "Pantone 1935 C",
"quantityGrams": 2349.5,
"minimumStock": 500,
"updatedAt": "2026-10-05T08:02:44.120Z"
}
],
"pageInfo": {
"hasNextPage": false
}
}
}
}