Requires write_customers access scope. Also: The user must not have restricted access.

Updates a segment.


Anchor to id
id
required

Specifies the segment to be updated.

The new name for the segment.

A precise definition of the segment. The definition is composed of a combination of conditions on facts about customers such as email_subscription_status = 'SUBSCRIBED' with this syntax.


Was this section helpful?

The updated segment.

The list of errors that occurred from executing the mutation.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation segmentUpdate($id: ID!) {
  segmentUpdate(id: $id) {
    segment {
      # Segment fields
    }
    userErrors {
      field
      message
    }
  }
}
Hide code
Input
Copy
{
  "id": "gid://shopify/<objectName>/10079785100",
  "name": "<your-name>",
  "query": "<your-query>"
}