En este tutorial vamos a crear un servidor GraphQL básica con Kotlin y la librería graphql-kotlin de Expedia group.
GraphQL kotlin es una colección de librerias que facilitan el desarrollo de servidores GraphQL con Kotlin.
El paquete starter de Spring Boot nos ofrece, autoconfiguración, funcionalidades generación de schema GraphQL automático, IDE Playground y soporte de programación asincrona con corrutinas de kotlin.
En este tutorial estaremos trabajando en un servidor para un almacen de armas mágicas.
Crea un proyecto gradle para kotlin en Spring initializr:
Este proyecto utiliza las siguientes dependencias:
Para este proyecto, por facilidad, vamos a usar la…
In this tutorial, we are going to build a simple API with the GraphQL kotlin libraries from Expedia Group.
GraphQL kotlin provides collection of libraries to ease the development of GraphQL applications with kotlin.
GraphQL Kotlin documentation:
https://expediagroup.github.io/graphql-kotlin/docs/getting-started.html
In this example we use the Spring boot autoconfiguration library graphql-kotlin-spring-server. This library built on top of Spring Webflux, provides us with automatic schema generation, graphql-playground and out of the box support for kotlin coroutines.
Create a Kotlin project with gradle in spring initializr:
This project uses the following dependencies:
This project runs with h2 database. As reference, I also added…
I'm a software developer with interest in frontend development, mobile functional and reactive programming.