Przejdź do głównej zawartości

updateClientAddress

Dla: Programista

MutacjaBetaMutation.updateClientAddress

Changes an address of a client: a field left out keeps its value, null clears an optional field. The same values sent again change nothing.

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
addressIdwymaganeID!

Identifier of the address to change.

inputwymaganeUpdateClientAddressInput!

What to change.

Zwraca

ClientAddress!

Przykład

Mutacja
mutation UpdateClientAddress($addressId: ID!, $input: UpdateClientAddressInput!) {
updateClientAddress(addressId: $addressId, input: $input) {
id
street
buildingNumber
notes
}
}
Zmienne
{
"addressId": "9f5b7d4e-0a6c-4b8d-8e1f-3a4b5c6d7e8f",
"input": {
"buildingNumber": "5",
"notes": "Rampa nr 2, awizacja telefoniczna."
}
}
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 UpdateClientAddress($addressId: ID!, $input: UpdateClientAddressInput!) {\n updateClientAddress(addressId: $addressId, input: $input) {\n id\n street\n buildingNumber\n notes\n }\n}",
"variables": {
"addressId": "9f5b7d4e-0a6c-4b8d-8e1f-3a4b5c6d7e8f",
"input": {
"buildingNumber": "5",
"notes": "Rampa nr 2, awizacja telefoniczna."
}
}
}
JSON
Odpowiedź
{
"data": {
"updateClientAddress": {
"id": "9f5b7d4e-0a6c-4b8d-8e1f-3a4b5c6d7e8f",
"street": "Składowa",
"buildingNumber": "5",
"notes": "Rampa nr 2, awizacja telefoniczna."
}
}
}