ClojureScript with Apollo Server

I understand that Apollo Client can and has been used with ClojureScript (and React). However, I’m curious to learn if anyone has tried using Apollo Server with ClojureScript.

I’d particularly like to learn how is the (interop) experience of ClojureScript + Apollo Server, and more generally how is the experience of using ClojureScript - with NodeJs deps - for backend development.

Looking forward to the shared insights and experiences. Thanks!

At my last gig, we built our website as a shared Node.js + browser ClojureScript app. It worked okay, but compared to the quality of libraries and tooling on the JVM Clojure side, it isn’t something that I would recommend unless you had a use case that required using Node.js. For us, it was the ability to render our reagent application on the server. YMMV.

For GraphQL, there is a high quality Clojure library called lacinia that we used to build our GraphQL service. It isn’t as feature rich as Apollo Server, but met our needs well at the time and I think hits the 80% that most teams need.

The use case is SSR. To your knowledge is there an idiomatic SSR practice for ClojureScript?

Keeping the breadth and quality of JVM (Clojure) in mind, have you tried SSR (or even simple transpilation/execution) via GraalVM? If yes, was it a better/worse experience than ClojureScript + NodeJS?

SSR w/ ClojureScript is not a well-paved path, but it’s fairly straight forward if you’re already familiar with Node.js and ClojureScript.

I have not worked with GraalVM at all; my expectation is that this would be far more complex, but I’d like to be surprised :slight_smile:

Like I alluded to in my first post, we used Lacinia + JVM Clojure for our GraphQL server, and then had a separate ClojureScript server that just handled SSR of our webpages. Both the SSR server and our front-end application would send requests to our GraphQL server for data. This allowed us to use the best tools for the job.