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 1 year ago

anshumansworld commented 1 year ago

Is it possible to use near filter on location data?

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

marcelofinamorvieira commented 1 year 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 1 year ago

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