DEV Community

Discussion on: Geospatial Queries on FaunaDB

 
potato_potaro profile image
Taro Woollett-Chiba

Hey Jon, regarding GraphQL, I assume you're strictly using Fauna's implementation of it? If so, as you mentioned, writing a UDF along the lines of this docs.fauna.com/fauna/current/api/g... should do the trick. It might also be possible to simply rely on the @index directive, however, I haven't tested this yet.

As for passing additional search terms, your best bet is to create additional indexes and perform those searches outside of the index used for GeoSearch. The input can be cleanly combined in a UDF and assigned to a GraphQL query using @resolver.

Let me know if I missed anything or didn't satisfactorily answer your questions. Cheers.

Thread Thread
 
ryanpwaldon profile image
Ryan Waldon

Hey Taro!

I'm using GraphQL + UDFs, although I'm still unsure how to get your GeoSearch function working inside the UDF 😅

I've tried passing the FQL generated by GeoSearch into my UDF as a string, but AFAIK, there's no way to evaluate this is FQL once inside the UDF.

Any chance you could provide some insight into how to get this working?

Thanks :)