Przejdź do głównej zawartości

updateClientContact

Dla: Programista

MutacjaBetaMutation.updateClientContact

Changes a contact person: a field left out keeps its value, null clears a text field. The contact must keep a name, an e-mail or a phone. 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
contactIdwymaganeID!

Identifier of the contact to change.

inputwymaganeClientContactInput!

What to change.

Zwraca

ClientContact!

Przykład

Mutacja
mutation UpdateClientContact($contactId: ID!, $input: ClientContactInput!) {
updateClientContact(contactId: $contactId, input: $input) {
id
phone
role
isActive
}
}
Zmienne
{
"contactId": "7d3f5b2c-8e4a-4f6b-9c0d-1e2f3a4b5c6d",
"input": {
"phone": null,
"role": "Dyrektor produkcji"
}
}
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 UpdateClientContact($contactId: ID!, $input: ClientContactInput!) {\n updateClientContact(contactId: $contactId, input: $input) {\n id\n phone\n role\n isActive\n }\n}",
"variables": {
"contactId": "7d3f5b2c-8e4a-4f6b-9c0d-1e2f3a4b5c6d",
"input": {
"phone": null,
"role": "Dyrektor produkcji"
}
}
}
JSON
Odpowiedź
{
"data": {
"updateClientContact": {
"id": "7d3f5b2c-8e4a-4f6b-9c0d-1e2f3a4b5c6d",
"phone": null,
"role": "Dyrektor produkcji",
"isActive": true
}
}
}