News for hackers. Stuff that matters.

greencurry43

Re:Using GraphQL with REST APIs on Wednesday March 20, 2019 @12:52PM (#19444074)
Author here. Sounds like I won you over :)

Thanks for the feedback here. I modified the post a bit to not show the arrays because the library doesn't return arrays but rather aync generators. The power of this is that you have a single interface for interacting with all data no matter if there are zero or many results.

This is library is a proof of concept. In a perfect world, there would be a nice wrapper around this query result for interacting with the data.

  queryResult.get('order').first()
This would provide a single order by calling the first yield for the generator. No need to worry about the underlying result.

With all of this said, it doesn't have to be this way. I'm exploring ideas here. The important concept is that GraphQL can be used to express the expectations of the client and a library like Graphable JSON can go find the needed data in the API. This gives the expressiveness of GraphQL with the benefits of REST. The sky is the limit. Thanks again for the feedback!

I wrote my own feedback below but left out this crucial piece you've mentioned here. I think to add to it, my family treats it as if I'm not there. I can't watch the kiddos for a few minutes or help get the laundry during work time. It's easy to do a lot of small things and have a completely disjointed day.

And the opposite is true, when I'm off work I'm off. My team can't treat me as always available because I'm remote. That takes time to establish.

Good point to mention.

Re:How to Version an API on Thursday June 08, 2017 @04:30PM (#14516962)
I've seen some use a versioned media typed like GitHub [0] or add a version parameter like "vnd.example-com.foo+json; version=1.0" [1]. People may use this version for the entire API or for versions of that specific resource as well.

[0] https://developer.github.com/v3/media/ [1] http://blog.steveklabnik.com/posts/2011-07-03-nobody-underst...

Re:Hugo: A fast and modern static website engine on Sunday October 09, 2016 @06:34PM (#12673942)
I think one the biggest draws of something like Hugo would be that it's amazingly fast. You can check out the video [0] here that shows a benchmark. It generates 5,000 pages in around 6-7.

Another is that it's a single file to deal with. This may be different when you get into making your own themes, but to get going you just need to download the single file for your platform.

[0]: https://gohugo.io/overview/introduction/