android - 如何使用 KGraphQL 连接到托管在 AWS 上的 Graph QL 服务器
问题描述
我是图形 ql 的新手。我正在尝试使用 hhtp4k 库中的 Get 方法连接到托管在 AWS 上的 Graph QL 服务器。但是,我不断收到以下错误消息:
{“消息”:“内部服务器错误”}
不知道我做错了什么。相同的代码似乎适用于演示 apollo graphql 数据库。
package me.pagidas.graphql
import org.http4k.core.HttpHandler
import org.http4k.core.Method.GET
import org.http4k.core.Request
import org.http4k.core.Response
import org.http4k.core.Status.Companion.OK
import org.http4k.core.Uri
import org.http4k.lens.Query
import org.http4k.lens.string
import org.http4k.routing.bind
import org.http4k.routing.routes
import org.http4k.server.Jetty
import org.http4k.server.asServer
import org.http4k.client.ApacheClient
fun testApp1() {
val http = ApacheClient()
http(
Request(GET, "aws-url/graphql")
.query("query",
"""
query Feed {
getFeed{
nextBatch
}
}
""".trimIndent()
)
).apply {
println("---------------------")
println("---GET ALL WRITERS---")
println("---------------------")
println(bodyString())
}
}
fun main() {
testApp1()
}
解决方案
推荐阅读
- javascript - 数组过滤器没有返回正确的零?
- python - 获取素数的片段
- sql-server - XML 和 MS SQL Server 2019,插入
- python - 在 python 中绘制一些特定的行
- python - 在一组指定的行中将数据从行移动到另一行
- node.js - Express 服务器作为 Docker 镜像容器运行,只为一些 html 页面提供服务
- c# - 在 C# 中获取给定年份的 ISO 周数
- phpmailer - PHPMailer + reCAPTCHA 或任何其他反垃圾邮件 - 问题
- python - 从另一个列表中的列表搜索中获取 2 个变量
- angular - 如何等待 http 请求以 Angular 8 完成?