A product represents a good or service that a shop or platform is offering. It contains the following associations/properties:
For example, an "iPhone" is a Product that has two options capacity and color. An "iPhone 512GB Silver" would be an example of a variant.
mutation CreateProduct($input: ProductInput!) {
tenant {
createProduct(input: $input) {
id
name
caption
description
active
options
}
}
}
{
"input": {
"name": "iPhone",
"caption": "Smart phone product by Apple",
"description": "Expensive but reliable phone that's mostly used for puppy filters.",
"active": true
}
}
{
"data": {
"tenant": {
"createProduct": {
"active": true,
"caption": "Smart phone product by Apple",
"description": "Expensive but reliable phone that's mostly used for puppy filters.",
"id": "1",
"name": "iPhone",
"options": null
}
}
}
}
mutation CreateProduct($shopId: ID, $input: ProductInput!) {
tenant {
createProduct(shopId: $shopId, input: $input) {
id
name
caption
description
active
options
shop {
id
name
}
}
}
}
{
"shopId": 2,
"input": {
"name": "iPhone",
"caption": "Smart phone product by Apple",
"description": "Expensive but reliable phone that's mostly used for puppy filters.",
"active": true
}
}
{
"data": {
"tenant": {
"createProduct": {
"active": true,
"caption": "Smart phone product by Apple",
"description": "Expensive but reliable phone that's mostly used for puppy filters.",
"id": "2",
"name": "iPhone",
"options": null,
"shop": {
"id": "2",
"name": "Cyberware shop"
}
}
}
}
}