Anchor to segmentUpdatesegment
segmentUpdate
mutation
Requires access scope. Also: The user must not have restricted access.
Updates a segment.
Anchor to Arguments
Arguments
- •ID!required
Specifies the segment to be updated.
- Anchor to namename•
The new name for the segment.
- Anchor to queryquery•
A precise definition of the segment. The definition is composed of a combination of conditions on facts about customers such as
with this syntax.
Was this section helpful?
Anchor to SegmentUpdatePayload returnsSegmentUpdatePayload returns
- Anchor to segmentsegment•
The updated segment.
- Anchor to userErrorsuser•
Errors [UserError!]! non-null The list of errors that occurred from executing the mutation.
Was this section helpful?
Mutation Reference
mutation segmentUpdate($id: ID!, $name: String, $query: String) {
segmentUpdate(id: $id, name: $name, query: $query) {
segment {
# Segment fields
}
userErrors {
field
message
}
}
}
Input
{
"id": "gid://shopify/<objectName>/10079785100",
"name": "<your-name>",
"query": "<your-query>"
}
{
"id": "gid://shopify/<objectName>/10079785100",
"name": "<your-name>",
"query": "<your-query>"
}