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
}
}
}
}
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 ↓
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 ↓