Organizations and users · GraphQL query

userSetMetadata query

Stores a value under a key in the caller's own key-value metadata store, replacing any existing value, and returns the stored key and value. Each user can hold up to 4096 keys; overwriting an existing key is always allowed. Read values back with userGetMetadata. This operation writes data even though it is declared as a query.

Response

Returns a UserMetadataPayload!

Arguments

Name Description
key - String! The metadata key, 1 to 256 bytes.
value - Binary! The value to store, up to 256 KiB.

Example

Query

query userSetMetadata(
  $key: String!,
  $value: Binary!
) {
  userSetMetadata(
    key: $key,
    value: $value
  ) {
    key
    value
  }
}

Variables

{
  "key": "abc123",
  "value": Binary
}

Response

{
  "data": {
    "userSetMetadata": {
      "key": "abc123",
      "value": Binary
    }
  }
}