Przejdź do głównej zawartości

updateSupplier

Dla: Programista

MutacjaBetaMutation.updateSupplier

Changes a supplier: a field left out keeps its value, null clears an optional field. Supplier.updatedAt moves only when something really changed: the same values sent again leave it as it was.

Wymagany zakreswarehouse:write
Dostępne odPrynt 0.28.0
StabilnośćBeta (co to znaczy)
PonawianieOperacja idempotentna: ponowienie bez nagłówka Idempotency-Key jest bezpieczne. Zapisy i idempotencja

Argumenty

NazwaTypOpis
idwymaganeID!

Identifier of the supplier to change.

inputwymaganeUpdateSupplierInput!

What to change: fields left out keep their values. An explicit null is refused unless the field says otherwise.

Zwraca

Supplier!

Przykład

Mutacja
mutation UpdateSupplier($id: ID!, $input: UpdateSupplierInput!) {
updateSupplier(id: $id, input: $input) {
id
email
contactPerson
updatedAt
}
}
Zmienne
{
"id": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b06",
"input": {
"email": "[email protected]",
"contactPerson": null
}
}
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": "mutation UpdateSupplier($id: ID!, $input: UpdateSupplierInput!) {\n updateSupplier(id: $id, input: $input) {\n id\n email\n contactPerson\n updatedAt\n }\n}",
"variables": {
"id": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b06",
"input": {
"email": "[email protected]",
"contactPerson": null
}
}
}
JSON
Odpowiedź
{
"data": {
"updateSupplier": {
"id": "3f6b2a1c-8d4e-4f5a-9b6c-1d2e3f4a5b06",
"email": "[email protected]",
"contactPerson": null,
"updatedAt": "2026-10-05T09:30:00.000Z"
}
}
}