Skip to main content

VariantType

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

Models

VariantType

type VariantType {
id: ID!
name: String!
selectionType: VariantSelectionTypeEnum!
translations: [VariantTypeTranslation!]
values: [VariantValue!]!
}

Fields

idID!required
nameString!required

Product variant type name information. For example: Size, Color, Number etc..It can be a maximum of 100 characters.

selectionTypeVariantSelectionTypeEnum!required

Product variant type selection type. It can be choice or color.

It is the translation information of the product variant types.

values[VariantValue!]!required

Variant values used in Variant type. For example, variant type: Size. Variant values can be thought of as S, M, L, XL. It is unique according to the value name.Values array size must have at least one element.

VariantTypeTranslation

type VariantTypeTranslation {
locale: String!
name: String
values: [VariantValueTranslation!]
}

Fields

localeString!required

It is the name information of the translation.

nameString

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

It is the translation information of the values of variant types.

Queries

List Variant Types

Using this api, you can view the variant types of products.

listVariantType(
id: StringFilterInput
name: StringFilterInput
updatedAt: DateFilterInput
): [VariantType!]!

Arguments

You can filter by product variant type name.

Return Type

VariantTypeVariantType

Mutations

Save Variant Type

Using this api, you can update the variant types of products.

saveVariantType(
input: VariantTypeInput!
): VariantType!

Arguments

inputVariantTypeInput!required

Return Type

VariantTypeVariantType

Delete Variant Type List

Using this api, you can delete the variant types of products.

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

Arguments

idList[String!]!required

Return Type

BooleanBoolean

The Boolean scalar type represents true or false.

Examples

Retrieves a list of variant types

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":"{ listVariantType { id name } }"}'

Response

{
"data": {
"listVariantType": [
{
"id": "a8befae6-2cb9-487a-bd7f-5e0bfff3676b",
"name": "Variant type name"
}
]
}
}