Skip to main content

Creating Categories

Introduction

This guide describes how to create and update categories from the Nautical GraphQL API.

Create a Category

Use the categoryCreate mutation.

mutation {
categoryCreate(
input: {
name: "Books"
description: "Those things with pages in them"
allowProductAssignment: true
}
) {
category {
id
name
description
allowProductAssignment
}
productErrors {
field
message
code
}
}
}
Show more ↓

Create Category

Update a Category

In order to update a given category, you'll need its ID. In the example above, the category ID is "Q2F0ZWdvcnk6MjM=".

Here's an example of the categoryUpdate mutation:

mutation {
categoryUpdate(
id: "Q2F0ZWdvcnk6MjM="
input: {
name: "BOOOOOKS!!"
seo: { title: "Books", description: "Has pages" }
}
) {
category {
id
name
description
allowProductAssignment
seoTitle
seoDescription
}
productErrors {
field
message
code
}
}
}
Show more ↓

Update Category

Was this page helpful?