I’m evaluating Fauna for a new project which will be written in Haskell. Is it possible to drop down to a lower-level HTTP API for unsupported languages? Or can you do everything via GraphQL?
In essence, yeah, perfectly feasible to do that in GraphQL + UDFs, some things might be cumbersome though.
Yes you could do everything in GraphQL that is normal querying since you can just write resolvers in GraphQL that call User Defined Functions functions which are written in FQL and therefore give you access to the full power of the database, essentially an escape hatch in case there is something you are unable to do in GraphQL. It might be slightly more cumbersome to have to define a User Defined Function (and make sure that the result is accepted by GraphQL) for each thing you want to do though but some people do that and are very successful doing it.
It’s not either FQL or GraphQL, you can use both together via GraphQL resolvers that call UDFs.
Of course ,you do not get the composition that the host language normally provides you (you can easily plug an FQL function in another FQL function since it’s all functions, something you probably appreciate a lot considering you work with Haskell).
It might be cumbersome to provision User Defined Functions and/or Roles since I typically do that via a script that sends FQL statements (e.g. via a language driver), this is discussed here.
In theory you can write a driver for FaunaDB since FQL is compiled to a kind of json-like syntax under the hood (correct me if I’m wrong fellow Faungineers) but I’m not 100% sure whether that syntax is not subject to change so I can’t say whether it’s a good idea or not. If that’s something you would want to do I can double-check whether you should be worried about that or not.
Thanks for answering my question, very helpful.
I’d be willing to write a haskell driver for fauna if the lower-level HTTP+JSON API is officially supported and has documentation. I contributed to rethinkdb’s driver (Rest in peace, rethinkdb!) and the query languages seem like they have similar goals and underlying technologies.
I verified to be certain and have to disappoint you. We do not have the wire protocol documented which makes writing a custom driver a risk. For someone else reading this, if you do want to dive in, the best approach is to inspect the drivers source code, looking at the serialisation etc, its “developer friendly” enough but we cant guarantee compatibility for future releases so I wouldn’t advice to do so personally.
Cool, thanks for your help. I’ll probably have to pass on FaunaDB for now. But I’ll come back in the future if it becomes possible to work in it with Haskell.