News for hackers. Stuff that matters.
Re:Build Better GraphQL APIs: Thinking in Graphs by dmitriid on Friday December 01, 2017 @06:59AM (#15823320)
> Stop Thinking In Endpoints > How To Start Thinking In Graphs

Ok. I've started to think in graphs. You know. Neo4J, Tinkerpop Gremlin, all that.

Oh, wait. How does that help me create that graph in a sane and meaningful way from a relational database and a number of microservices, especially if all the requests can be ad-hoc graph queries?

Ah, yes. The article (and all other articles on GraphQL) never answer that, do they?

Re:Build Better GraphQL APIs: Thinking in Graphs by obi1kenobi on Friday December 01, 2017 @10:38AM (#15824409)
My company has built and open-sourced a tool that can turn your ad-hoc graph queries into database queries. We've completely abandoned GraphQL's resolver-based execution model, and we simply turn the GraphQL directly into a database query and run it on the database itself.

Check out our blog post: https://blog.kensho.com/compiled-graphql-as-a-database-query...

Open-sourced tool: https://github.com/kensho-technologies/graphql-compiler

    pip install graphql-compiler
Re:Build Better GraphQL APIs: Thinking in Graphs by taco_emoji on Friday December 01, 2017 @10:20AM (#15824267)
Yeah, IMO GraphQL is not at all hard to grok, and its benefits to an API consumer are pretty obvious. But I have no idea, as a developer, how I'm supposed to implement a GraphQL interface to my non-graphical database(s) in a secure, performant, and repeatable way.
Re:Build Better GraphQL APIs: Thinking in Graphs by jonbarker on Friday December 01, 2017 @09:52AM (#15824117)
I propose that if you have tables and want graphs, you will have to consider the tradeoff in compute resources required to generate meaningful aggregate results (count all customers, etc). So the answer is usually keep your tables and use graphs when appropriate.
Re:Build Better GraphQL APIs: Thinking in Graphs by cvburgess on Friday December 01, 2017 @07:56AM (#15823505)
There are really elegant solutions coming out around this - I suggest watching some of the talks from this years GraphQL summit.
Re:Build Better GraphQL APIs: Thinking in Graphs by ddorian43 on Friday December 01, 2017 @07:25AM (#15823409)
You build a "query language" that translates the GraphQL into a series of calls to your nanoservices ?
Re:Build Better GraphQL APIs: Thinking in Graphs by dmitriid on Sunday December 03, 2017 @08:40AM (#15837511)
Why would I want to do that though? :)

It's quite an undertaking, increases the surface of bugs and attacks etc.

Re:Build Better GraphQL APIs: Thinking in Graphs by 013a on Friday December 01, 2017 @12:31PM (#15825496)
We refer to them as picoservices, but yes.