Requires
write_products
access scope. Also: The user must have a permission to update a catalog.
Updates the context of a catalog.
Arguments
The ID of the catalog for which to update the context.
Anchor to contextsToAddcontextsToAddThe contexts to add to the catalog.
Anchor to contextsToRemovecontextsToRemoveThe contexts to remove from the catalog.
Was this section helpful?
CatalogContextUpdatePayload returns
The updated catalog.
The list of errors that occurred from executing the mutation.
Was this section helpful?
Hide code
Mutation reference
Copy
mutation catalogContextUpdate($catalogId: ID!, $contextsToAdd: CatalogContextInput, $contextsToRemove: CatalogContextInput) {
catalogContextUpdate(catalogId: $catalogId, contextsToAdd: $contextsToAdd, contextsToRemove: $contextsToRemove) {
catalog {
# Catalog fields
}
userErrors {
field
message
}
}
}
Hide code
Input
Copy
{
"catalogId": "gid://shopify/<objectName>/10079785100",
"contextsToAdd": {
"companyLocationIds": []
},
"contextsToRemove": {
"companyLocationIds": []
}
}
input CatalogContextInput {
companyLocationIds: [ID!]
}