diff --git a/server/src/main/kotlin/suwayomi/tachidesk/graphql/GraphQL.kt b/server/src/main/kotlin/suwayomi/tachidesk/graphql/GraphQL.kt index 6086ec00..8bc2edab 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/graphql/GraphQL.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/graphql/GraphQL.kt @@ -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") + } } } diff --git a/server/src/main/resources/graphql.html b/server/src/main/resources/graphql.html new file mode 100644 index 00000000..23825856 --- /dev/null +++ b/server/src/main/resources/graphql.html @@ -0,0 +1,58 @@ + + + + + + + GraphQL Playground + + + + + + +
+ + +
Loading + GraphQL Playground +
+
+ + + + \ No newline at end of file