Hello everyone,
this might be a silly question maybe, I am not a graph expert, butā¦ wanted to know if is possible to sort my query here:
query Models($locale: SiteLocale) {
allCatalogColours (locale: $locale, first: 100, orderBy: colorName_ASC){
colorName
slug
colourDescription
colourHex {
hex
}
colourSerie
familyColour {
nameFamily
id
}
id
secondaryColour
relatedModels {
id
modelName
index
}
imageDisplay {
url
filename
}
}
}
Exactly this part
relatedModels {
id
modelName
index
}
by the index field, which basically is a type of fav range, introduced manually by the editors. So I return the fields in that exact order.
Also asking about graph side, because I tried with vue 3, but no luck. I have this specific part in a āv-forā so for āv-for model in colour.relatedModelsā. Was basically trying something āsuper experimentalā that actually donāt know if I should be doing it , but at the end it didnāt work anyways
<span
**v-for="model in sortIndex(colour.relatedModels)"**
:key="model.id"
:style="{ color: colour.colourHex.hex }">
<span style="color:#000"> {{model.index}}</span>
<pill-search
@pushUp="pushUp($event)"
:primColor="colour.primaryColour"
:secColor="colour.secondaryColour"
:slug="colour.slug"
:modelName="model.modelName"
></pill-search>
</span>
where sortIndex is a method that returns:
return _.orderBy(arrayModels, [arrayModels.index]);
And Iām probably going to have all the āthe vue godsā ripping their clothes off after reading this.
So any help or advise will be helpful