Hacker News new | ask | show | jobs
by pferdone 2559 days ago
> With GraphQL, my understanding is that there is zero back end work. You just tell the GraphQL engine what data you need and it magically arrives into your browser.

It doesn‘t quite work like that. Someone still has to implement the backend (resolvers). If you want to request dogs from your backend someone still has to implement the dogs query, but (and I think that‘s one of the greatest things about GQL) as soon as it is implemented, you can introspect your backend and see exactly which properties a dog can have. So you know whether the dog object has a name property, or an isHungry property and so on. So now you can specifically ask for a dog and its name if that‘s all your view needs. Another view might only need the breed, so that‘s what you query for...view specific queries.