<p>On my learning process of GraphQL, i was looking for a use-case to get started, so I decided to write a wrapper in Golang for the Docker API.</p>
<p>Then I found myself learning two things at once, GraphQL and the Docker API, pretty exciting though.</p>
<p>So here's the project in case someone wants to give it a try, it's not fully implemented. Query-ready fields can be found in the description, on the TODO list. Of course it is available as a docker image as well :) </p>
<p>Project: <a href="https://github.com/klud1/graphql-docker-api">https://github.com/klud1/graphql-docker-api</a></p>
<hr/>**评论:**<br/><br/>daenney: <pre><p>Thank you so much for this! I've been toying with GraphQL myself but the lack of good resources for Go has hampered my progress in the area. It's great to be able to read someone else's code, get a sense for how they structured things, defining the schema and queries etc.</p></pre>SeerUD: <pre><p>I recently did some performance testing with the particular library for GraphQL being used here, and it's actually less performant than the Node.js version, and the code ends up being littered with <code>interface{}</code>. I recently tried the same thing with <a href="https://github.com/neelance/graphql-go">this library</a>, and found the code to be far more idiomatic, without <code>interface{}</code>, and it was a <em>lot</em> faster too.</p>
<p>It does seem however that the none of the Go implementations are mature, and none of them are well documented. The Node.js one in particular is excellent in this regard, which is unfortunate. I'd like to see more people use GraphQL with go, and help push the libraries forward however, and that's also what I intend to do once I get started on something a bit meatier...</p></pre>Rhelza: <pre><p>this is insteresting to read, i should take a look to that one, didnt know about it...yeah the <code>interface{}</code> thingy ends up being kinda exhausting :/ </p></pre>kromem: <pre><p>The neelance library is really easy to implement, but lacking in documentation.</p>
<p>But if you read the code in the "example" directory, it's not hard to figure out.</p></pre>daenney: <pre><p>Thanks for this, I'll definetly take a look. One of my issues was indeed the whole "everything goes through <code>interface{}</code>", which just doesn't sit right with me. You lose many benefits of the language and tooling around it because of it, and it usually detrimental to performance too.</p></pre>Rhelza: <pre><p>Been playing with neelance library, it's pretty straightforward...i'll use that library for the project, here are the changes <a href="https://github.com/klud1/graphql-docker-api/tree/migrate-lib" rel="nofollow">https://github.com/klud1/graphql-docker-api/tree/migrate-lib</a></p></pre>Rhelza: <pre><p>Glad it helps, though i'm far from being an expert at any of the fields covered in the project, i'm doing my best to make things work, help would be highly appreciated <sup>_^</sup></p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传