Adopted and modified from : https://github.com/excitement-engineer/ktor-graphql
This is a graphql backend for a small social networking app.
Can be found in schema.graphql
For simplicity, we are using singletons to simulate our data access layers. In the real world, usage of dataloaders is recommended. Read more about that here
Although this example uses Ktor, any Kotlin server may be used.
This example is schema first, but there are also possibilities to write code-first resolvers (aka schema is defined by the code). Examples of code-first can be found here