Skip to main content

Product Attribute

By using this api, you can manage attributes of your products.

Models

ProductAttribute

type ProductAttribute {
id: ID!
description: String
name: String!
options: [ProductAttributeOption!]
tableTemplate: ProductAttributeTableTemplate
translations: [ProductAttributeTranslation!]
type: ProductAttributeTypeEnum!
}

Fields

idID!required
descriptionString

Description of the attribute

nameString!required

Name of the attribute

Options of the attribute

Table template description for product attribute

Translations for the attribute

Type of the attribute

ProductAttributeOption

type ProductAttributeOption {
id: ID!
name: String!
}

Fields

idID!required
nameString!required

Name of the product attribute option

ProductAttributeValue

type ProductAttributeValue {
imageIds: [String!]
productAttributeId: String
productAttributeOptionId: String
value: String
}

Fields

imageIds[String!]

Image ids of the product attribute

productAttributeIdString

Identifier of the product attribute

productAttributeOptionIdString

Option identifier for the product attribute

valueString

Value of the product attribute

ProductAttributeTranslation

type ProductAttributeTranslation {
description: String
locale: String!
name: String
options: [ProductAttributeOptionTranslation!]
}

Fields

descriptionString

It is the description information of the translation.

localeString!required

It is the name information of the translation.

nameString

It is the information in which language the translation is saved.

List of translations for attribute options

Queries

List Product Attributes

Use this query to list product attributes.

listProductAttribute(
id: StringFilterInput
name: StringFilterInput
updatedAt: DateFilterInput
): [ProductAttribute!]!

Arguments

Return Type

ProductAttributeProductAttribute

Mutations

Save Product Attribute

Use this mutation to create or update product attributes with provided input values.

saveProductAttribute(
input: ProductAttributeInput!
): ProductAttribute!

Arguments

Return Type

ProductAttributeProductAttribute

Delete Product Attribute List

Use this mutation to delete product attributes with specific ids.

deleteProductAttributeList(
idList: [String!]!
): Boolean!

Arguments

idList[String!]!required

Return Type

BooleanBoolean

The Boolean scalar type represents true or false.

Examples

Retrieves a list of product attributes

curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your_access_token>' \
--data-raw '{"query":"{ listProductAttribute { id name createdAt } }"}'

Response

{
"data": {
"listProductAttribute": [
{
"id": "a8befae6-2cb9-487a-bd7f-5e0bfff3676b",
"name": "Product attribute name",
"createdAt": 1634019877744
}
]
}
}