mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-05 11:54:38 -05:00
Update graphql-playground endpoint
This commit is contained in:
@@ -7,16 +7,14 @@
|
||||
|
||||
package suwayomi.tachidesk.graphql
|
||||
|
||||
import io.javalin.apibuilder.ApiBuilder.get
|
||||
import io.javalin.apibuilder.ApiBuilder.post
|
||||
import io.javalin.apibuilder.ApiBuilder.*
|
||||
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")
|
||||
}
|
||||
|
||||
// graphql playground
|
||||
get("graphql", GraphQLController::playground)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user