FQL Revamp for TypeScript

So currently we write FQL with TypeScript like:

query.If(
  query.Exists(
    query.Match(
      query.Index('myIndex'),
      ...someValues
    )
  ),
  ...do something,
  null
);

Last I heard there was a plan to change this functional approach to something else which will be more readable and will require less nesting. Is there any news on whether that’s gonna go out soon or not yet?

I also have just found this FaunaDB support · Issue #2445 · prisma/prisma · GitHub which was 2 years ago but there seems to be no update there so it’s likely that we’re not gonna be able to use Prisma with FaunaDB soon, but I think it’s a good thing if FaunaDB itself will be able to create a tool similar to Prisma (including the schema.prisma file). While FQL is a really powerful language for FaunaDB, it can become really deeply nested.

Hi @aprilmintacpineda,

Thanks for reaching out. I’d like to share what we’ve been thinking about here, and get your input regarding the query language and integrations. I’ll reach out with a Zoom invite.

Hi April,

Indeed our improved query language is much more readable and elegant. For instance, if we take your example query and apply it to a collection called Product, it would look like this

let someProduct = Product.byType( "Electronics" ).first() 
if ( someProduct != null ) {
  log( "do something here" )
}

Check out our blog to learn more about the language and how to get started with the beta release! Introducing FQL X: The future of Fauna’s database language

Hi @aprilmintacpineda -

As you may have seen, we’ve GA’ed FQL v10! Check it out, I think you are going to like it. I am closing this issue now.

1 Like