CreateAttribute
CreateAttributeCreates a new product attribute value (e.g. "Red" for a "Color" option).
Parameters:
| Parameter | Type | Description |
|---|---|---|
input | CreateAttributeInput! | Attribute data. |
Example Query:
mutation CreateAttribute($input: CreateAttributeInput!) {
CreateAttribute(input: $input) {
id
label
option { id label }
}
}Example Variables:
{
"input": {
"label": "Cotton",
"option": {
"id": 10002
}
}
}UpdateAttribute
UpdateAttributeUpdates an existing attribute value.
Parameters:
| Parameter | Type | Description |
|---|---|---|
id | Int! | ID of the attribute. |
input | UpdateAttributeInput! | Updated data. |
Example Query:
mutation UpdateAttribute($id: ID!, $input: UpdateAttributeInput!) {
UpdateAttribute(id: $id, input: $input) {
id
label
}
}DeleteAttribute
DeleteAttributeDeletes an attribute value.
Parameters:
| Parameter | Type | Description |
|---|---|---|
id | Int! | ID of the attribute to delete. |
Example Query:
mutation DeleteAttribute($id: ID!) {
DeleteAttribute(id: $id)
}Input Data Types
CreateAttributeInput
CreateAttributeInput| Field | Type | Description |
|---|---|---|
label | String! | Name of the attribute. |
option | OptionInput! | The Option this attribute belongs to. |
UpdateAttributeInput
UpdateAttributeInput| Field | Type | Description |
|---|---|---|
id | Int | ID of the attribute. |
label | String! | Name of the attribute. |
option | OptionInput | Optional. Change the option. |
AttributeInput
AttributeInput| Field | Type | Description |
|---|---|---|
id | Int | ID. |
label | String! | Name. |
option | OptionInput | Option payload. |
