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
1mutation segmentUpdate($id: ID!, $name: String, $query: String) {2 segmentUpdate(id: $id, name: $name, query: $query) {3 segment {4 # Segment fields5 }6 userErrors {7 field8 message9 }10 }11}
Input
1{2 "id": "gid://shopify/<objectName>/10079785100",3 "name": "<your-name>",4 "query": "<your-query>"5}
{
"id": "gid://shopify/<objectName>/10079785100",
"name": "<your-name>",
"query": "<your-query>"
}