Since they're 2 separate properties, I can't even ...
# orm-help
k
Since they're 2 separate properties, I can't even use
orderBy
. Do I have to query for every item and do the sorting on the server?
m
You can create
distance
resolver which takes parent object and returns value based on
longitude
and
latitude
from that parent
k
If I add a resolver I can show the distance from the specified coordinate (passed in
args
), but how can I use sort (use orderBy) based on it? The field is not stored in the the db so it's not in
ApartmentOrderByInput
E.g. I want to show the nearest 5 locations from the user's current location