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
1mutation catalogContextUpdate($catalogId: ID!, $contextsToAdd: CatalogContextInput, $contextsToRemove: CatalogContextInput) {2 catalogContextUpdate(catalogId: $catalogId, contextsToAdd: $contextsToAdd, contextsToRemove: $contextsToRemove) {3 catalog {4 # Catalog fields5 }6 userErrors {7 field8 message9 }10 }11}
Input
1{2 "catalogId": "gid://shopify/<objectName>/10079785100",3 "contextsToAdd": {4 "companyLocationIds": [5 "gid://shopify/<objectName>/10079785100"6 ]7 },8 "contextsToRemove": {9 "companyLocationIds": [10 "gid://shopify/<objectName>/10079785100"11 ]12 }13}
{
"catalogId": "gid://shopify/<objectName>/10079785100",
"contextsToAdd": {
"companyLocationIds": [
"gid://shopify/<objectName>/10079785100"
]
},
"contextsToRemove": {
"companyLocationIds": [
"gid://shopify/<objectName>/10079785100"
]
}
}
input CatalogContextInput {
companyLocationIds: [ID!]
}