News for hackers. Stuff that matters.
Re:A first GraphQL Server by silversmith on Monday July 13, 2015 @03:24AM (#9876827)
What's I'm missing from all the GraphQL examples seen out there is some kind of interaction with database.

I think I understand how to `resolve` a path into a object. Array of objects should be similar, right? And how do I then describe that object with GraphQL terms? Can `resolve` function of fields get this object passed in?

Re:A first GraphQL Server by jawr on Monday July 13, 2015 @05:00AM (#9877048)
Here's my toy attempt at implementing it https://gist.github.com/jawr/b4c585b69b8e83255513
Re:A first GraphQL Server by schrockn on Monday July 13, 2015 @02:04PM (#9879830)
resolve() takes the current field AST node as one of its arguments. Mappings to more complicated backends will demonstrate use cases of where this is needed. From that field AST you can arbitrarily descend into a ton of information, e.g. the subfields of the current field.
Re:A first GraphQL Server by jimmyhmiller on Monday July 13, 2015 @03:35PM (#9880480)
How does resolve deal with asynchronous calls? The name almost suggests that you might be able to return a promise?
Re:A first GraphQL Server by funksta on Monday July 13, 2015 @04:26PM (#9880810)
Yes, you can return a Promise in resolve(). I believe it's mentioned in the first half of this talk: https://www.youtube.com/watch?v=gY48GW87Feo