ElasticGraph Query API: Geographic Filtering

Try these example queries by visiting the GraphiQL UI after booting locally.

The GeoLocation type supports a special predicate:

near
Matches records where the field’s geographic location is within a specified distance from the location identified by latitude and longitude.

When null or an empty object is passed, matches all documents.

Here’s an example of this predicate:

query FindAsianVenues {
  venues(filter: {
    location: {near: {
      latitude: 49.102271
      longitude: 87.143660
      maxDistance: 2000
      unit: MILE
    }}
  }) {
    nodes {
      name
      capacity
    }
  }
}