Add graphql playground

This commit is contained in:
Valter Martinek
2022-11-10 23:03:18 +01:00
committed by Syer10
parent 21719f4408
commit 6054c489c6
2 changed files with 63 additions and 0 deletions

View File

@@ -7,11 +7,16 @@
package suwayomi.tachidesk.graphql
import io.javalin.apibuilder.ApiBuilder.get
import io.javalin.apibuilder.ApiBuilder.post
import suwayomi.tachidesk.graphql.controller.GraphQLController
object GraphQL {
fun defineEndpoints() {
post("graphql", GraphQLController.execute)
get("graphql") { ctx ->
val html = javaClass.getResource("/graphql.html")?.readText()
ctx.html(html ?: "Could not load playground")
}
}
}