Skip to content

Comment on A first GraphQL Serverparent

Comments

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.

How does resolve deal with asynchronous calls? The name almost suggests that you might be able to return a promise?

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

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.