we need a backend endpoint with the requisites coordinates and categories where the coordinates are my coordinates and the category for which categories you need to filter information and send a response to the client in the same way as before
I don’t understand the question to be honest.
The closest thing I can think that may be what you’re asking about is the geo
query supported by Hypi. See https://docs.hypi.app/docs/arcql/#geo-location
Can you provide pseudo code of some example you would like to see/use. The question isn’t at all clear to me.
Thank you for the reply. Let me clarify the issue, the Front end should send to your API user geo coordinates afterwards the backend should provide the respond with the existing venues around the user by categories. We need an API for it to send the request to.
Okay, the geo
query I linked to above sounds like what you need. Again, see https://docs.hypi.app/docs/arcql/#geo-location for the documentation and example.
You say you have a Venue
so when you create/edit the venue, add the coordinates to this venue and the geo
query can then be used to find any venue within a given distance of the user.
- Add co-ordinates to your
Venue
table:
type Venue {
name: String
x: Float
y: Float
}
- Add the venue’s location/coordinates when creating/updating it
mutation {
upsert(
values: {
Venue: [
{x: 0.55835374214, y: 0.6084901767 , name: "My venue 1"}
]
}
)
}
- Query the venues within a given distance
{
find(type: Venue, arcql: "geo(0.55835374214,0.60852837672,0.5,'x','y')") {
edges {
node {
... on Venue {
name
x
y
}
}
}
}
}
This query finds venues within 500 (0.5KM = 500M) meters of the user’s co-ordinates that are provided in this query.
NOTE: Hypi’s geo
accepts radians NOT degrees.
We should get the venues from google, the venues are not created by us. We send only the coordinates of the user and backend gives the available venues mentioned on google map around.
Yes you should. Get the venue and the venue’s co-ordinates from Google. Hypi does not provide a geo database. Google maps or another service can be used to find a venue and its coordinates and then you add those coordinates to the venue table in Hypi.