In Dgraph you can only sort entities (via params), not values. In addition, facets are not first-class citizens (Which means that it does not have some features that are exclusive to other functions - like indexing - but you can sort entities based on facets - Also means that it is more worthwhile to create a “list of entities” than a list in scalar type). Also, lists in Dgraph are like an unordered set, so non-deterministic. see => Query Language - Query language
I see that your goal is for your type list to have a sort and not for entities to have a sort. As mentioned above, no list of any kind is deterministic in Dgraph due to design factors.
It is possible to create a feature for this (orderasc: index
), I think. Just open an issue in Github repo and see what you get.
You can sort entities based on the facets you have between them. But not in value facets as far as I know. However, value facets in List Type are quite recent (it was created this year). It has never been thought to exist before. Because Facets, in general, are for adding extra information to a relationship between two entities.
In general, facets in value edges are a feature without a specific purpose. They just exist. Some people use it to add “metadata” or something like that.
I believe if we see more use good cases in relation to this (with popularity). We can perhaps improve some things in relation to Facets.