Assuming the sorting you’re wanting to do would be is something like return the countries by number of cases ascending/descending. What you could do is to add args to the countries field
And then instead of simply returning res.data, you would look at those args being passed in and decide how to sort them inside your resolver before returning.
Assuming the sorting you’re wanting to do would be is something like return the countries by number of cases ascending/descending. What you could do is to add
args
to thecountries
fieldAnd then instead of simply returning
res.data
, you would look at thoseargs
being passed in and decide how to sort them inside your resolver before returning.disclaimer: the code might not be perfect, it was something i just threw together, but this approach is how I’ve done it previously
Thanks will look at this