datocms / gatsby-source-datocms

Official GatsbyJS source plugin to pull content from DatoCMS
MIT License
140 stars 50 forks source link

How to use near query #224

Closed anshumansworld closed 10 months ago

anshumansworld commented 11 months ago

Is it possible to use near filter on location data?

e.g. filter: {location: {near: {latitude: "", longitude: "", radius: ""}}}

marcelofinamorvieira commented 10 months ago

Hello @anshumansworld you can do them as such: https://www.datocms.com/docs/content-delivery-api/filtering-records#lat_lon

The radius is specified in meters, forming a circle with the central point being the latitude and longitude you specified

anshumansworld commented 10 months ago

The question was related to gatsby plugin. How can I do the same in gatsby plugin? @marcelofinamorvieira