graphql-compose / graphql-compose-elasticsearch

Hide Elastic Search REST API behind GraphQL.
https://graphql-compose.herokuapp.com/elasticsearch/
MIT License
583 stars 77 forks source link

sort option not working in search #67

Open thejibz opened 5 years ago

thejibz commented 5 years ago

When using the search query helper if you set the sort option using the enum generated you get an error like: Query:

{
elastic(q: "hazelcast", limit: 3, sort:Id__raw__asc) {
    hits { ... }
}

Response: "message": "Variable \"$_v1_sort\" got invalid value [{ Id.raw: \"asc\" }]; Expected type elasticSortEnum at value[0]."

It seems that the lib convert the enum to string too early in the process and the graphql parser which expect an Enum get a String instead.

voratham commented 4 years ago

Please advise for the workaround of sort enum?