简单的 Golang GraphQL 服务器

Simple Golang GraphQL Server

是否存在简单且有效的 "Hello World!" Go 中的 GraphQL 服务器代码?

关于该主题的教程存在不足,特别是因为 graphql-go/graphql 当前正在进行中。

最受关注的项目是https://github.com/graphql-go/graphql,但似乎没有积极开发。

我一直在关注这个看起来很有前途的实现:https://github.com/neelance/graphql-go

一个我还需要检查的新仓库:https://github.com/playlyfe/go-graphql

我这个周末实际上花了一些时间为本周即将到来的演示文稿创建了一个 golang graphql 服务器,这与 golang graphql 无关。我不会golang,也没搭过服务器,我也扔了Neo4j,真是冒险,hello world例子如下;

https://github.com/graphql-go/graphql/blob/master/examples/hello-world/main.go

此外,我使用 graphql-go/handler 创建了一个端点;

https://github.com/graphql-go/handler

最后添加 graphiql 以查看我的查询;

https://github.com/mnmtanish/go-graphiql

我首先让 hello world 示例在 go-graphiql 中可见,但使用 handler 公开架构。