Przejdź do głównej zawartości

updateClient

Dla: Programista

MutacjaBetaMutation.updateClient

Changes a client: a field left out keeps its value, null clears a field that may be empty. Client.updatedAt moves only when something really changed: the same values sent again leave it as it was. A client the print shop deactivated (isActive: false) takes no change from an API key, nor do its contacts, addresses, notes and tags.

Wymagany zakresclients: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 client to change.

inputwymaganeUpdateClientInput!

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

Zwraca

Client!

Przykład

Mutacja
mutation UpdateClient($id: ID!, $input: UpdateClientInput!) {
updateClient(id: $id, input: $input) {
id
email
phone
tags {
name
}
updatedAt
}
}
Zmienne
{
"id": "6c2e4a1b-7d3f-4e5a-9b8c-0d1e2f3a4b5c",
"input": {
"email": "[email protected]",
"phone": null,
"tagIds": [
"8e4a6c3d-9f5b-4a7c-8d0e-2f3a4b5c6d7f"
]
}
}
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 UpdateClient($id: ID!, $input: UpdateClientInput!) {\n updateClient(id: $id, input: $input) {\n id\n email\n phone\n tags {\n name\n }\n updatedAt\n }\n}",
"variables": {
"id": "6c2e4a1b-7d3f-4e5a-9b8c-0d1e2f3a4b5c",
"input": {
"email": "[email protected]",
"phone": null,
"tagIds": [
"8e4a6c3d-9f5b-4a7c-8d0e-2f3a4b5c6d7f"
]
}
}
}
JSON
Odpowiedź
{
"data": {
"updateClient": {
"id": "6c2e4a1b-7d3f-4e5a-9b8c-0d1e2f3a4b5c",
"email": "[email protected]",
"phone": null,
"tags": [
{
"name": "Wydawnictwa"
}
],
"updatedAt": "2026-10-05T09:02:11.318Z"
}
}
}