Skip to main content

Managing product templates

Introduction

This guide describes how to query, create, and update product templates from the Nautical GraphQL API.

Query product templates

{
productTypes(first: 100) {
edges {
node {
id
name
}
}
}
}

Query product template

Create a product template

Use the productTypeCreate mutation.

mutation {
productTypeCreate(input: { name: "Tets Prod Type" }) {
productType {
id
name
slug
hasVariants
isShippingRequired
productAttributes {
id
name
}
variantAttributes {
id
name
}
weight {
unit
value
}
}
productErrors {
field
code
message
attributes
}
}
}
Show more ↓

Create product template

Update a product template

In order to update a product template, you'll need its ID. In our example, it is "UHJvZHVjdFR5cGU6MTg=". Here is an example of updating a product template.

Here's an example of the productTypeUpdate mutation:

mutation {
productTypeUpdate(
id: "UHJvZHVjdFR5cGU6MTg="
input: { hasVariants: false, weight: 10, slug: "a-new-slug" }
) {
productType {
id
name
slug
hasVariants
isShippingRequired
productAttributes {
id
name
}
variantAttributes {
id
name
}
weight {
unit
value
}
}
productErrors {
field
code
message
attributes
}
}
}
Show more ↓

Update product template

Was this page helpful?