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
Product variant type name information. For example: Size, Color, Number etc..It can be a maximum of 100 characters.
Product variant type selection type. It can be choice or color.
translations
[VariantTypeTranslation!]It is the translation information of the product variant types.
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
It is the name information of the translation.
name
StringIt 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.
updatedAt
DateFilterInputReturn Type
VariantType
VariantTypeMutations
Save Variant Type
Using this api, you can update the variant types of products.
saveVariantType(
input: VariantTypeInput!
): VariantType!
Arguments
Return Type
VariantType
VariantTypeDelete Variant Type List
Using this api, you can delete the variant types of products.
deleteVariantTypeList(
idList: [String!]!
): Boolean!
Arguments
Return Type
Boolean
BooleanThe Boolean
scalar type represents true
or false
.
Examples
Retrieves a list of variant types
- BASH
- NODE.JS
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 } }"}'
const axios = require('axios');
const data = {"query":`{
listVariantType {
id
name
}
}
`};
const config = {
method: 'POST',
url: 'https://api.myikas.com/api/v1/admin/graphql',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your_token'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
if (error.response) {
console.log(JSON.stringify(error.response.data));
}
});
Response
{
"data": {
"listVariantType": [
{
"id": "a8befae6-2cb9-487a-bd7f-5e0bfff3676b",
"name": "Variant type name"
}
]
}
}