New to GraphQL and trying to setup an initial POC. We have our backend services in Kotlin and exploring Apollo GraphQL as a BFF for our Android, iOS, PWA clients. Most of the articles and training material for Apollo server is using Node and express and node packages. Wanted to know if anyone has tried to setup the Apollo server on Kotlin and if that is recommended?
Hi ! Apollo Server is mainly meant to be used with Node.js. If you’re looking into more Kotlin-y alternatives, you can take a look at:
- GitHub - ExpediaGroup/graphql-kotlin: Libraries for running GraphQL in Kotlin (code-first)
- Tutorial with Spring Boot | GraphQL Java (schema-first)
And plenty more options at https://graphql.org/code/#java-kotlin
That said, it’s definitely possible to consume Node.js backends in Kotlin so you can mix and match. The possibilities are endless
Hi Thanks a lot for the response. Wanted to understand from a scalability perspective considering that Apollo server supports federation/sub graphs etc to move more towards a micro service architecture, how much of a challenge it would be to customize/build this using some of the other GraphQL server libraries that you mentioned.
Also, from a deployment perspective in terms of managing the infrastructure would you suggest using something like AWS AppSync.
how much of a challenge it would be to customize/build this using some of the other GraphQL server libraries that you mentioned.
The vast majority of Kotlin/JVM libs have federation support:
- graphql-kotlin has builtin federation support. You can read more at Apollo Federation | GraphQL Kotlin
- graphql-java has GitHub - apollographql/federation-jvm: JVM support for Apollo federation
I don’t know much about AppSync so not sure I can help much there.