Anchor to catalogContextUpdatecatalog
catalogContextUpdate
mutation
Requires access scope. Also: The user must have permission to create and edit catalogs.
Updates the context of a catalog.
Anchor to Arguments
Arguments
- Anchor to catalogIdcatalog•
Id ID!required The ID of the catalog for which to update the context.
- Anchor to contextsToAddcontexts•
To Add The contexts to add to the catalog.
- Anchor to contextsToRemovecontexts•
To Remove The contexts to remove from the catalog.
Was this section helpful?
Anchor to CatalogContextUpdatePayload returnsCatalogContextUpdatePayload returns
- Anchor to catalogcatalog•
The updated catalog.
- Anchor to userErrorsuser•
Errors [CatalogUser non-nullError!]! The list of errors that occurred from executing the mutation.
Was this section helpful?
Mutation Reference
mutation catalogContextUpdate($catalogId: ID!, $contextsToAdd: CatalogContextInput, $contextsToRemove: CatalogContextInput) {
catalogContextUpdate(catalogId: $catalogId, contextsToAdd: $contextsToAdd, contextsToRemove: $contextsToRemove) {
catalog {
# Catalog fields
}
userErrors {
field
message
}
}
}
Input
{
"catalogId": "gid://shopify/<objectName>/10079785100",
"contextsToAdd": {
"companyLocationIds": [
"gid://shopify/<objectName>/10079785100"
]
},
"contextsToRemove": {
"companyLocationIds": [
"gid://shopify/<objectName>/10079785100"
]
}
}
{
"catalogId": "gid://shopify/<objectName>/10079785100",
"contextsToAdd": {
"companyLocationIds": [
"gid://shopify/<objectName>/10079785100"
]
},
"contextsToRemove": {
"companyLocationIds": [
"gid://shopify/<objectName>/10079785100"
]
}
}
input CatalogContextInput {
companyLocationIds: [ID!]
}