Scott Molinari
Jul 30, 2017 · 1 min read

Nice article.

I have to disagree slightly with one thing. Resolvers shouldn’t have direct access to a database. In fact, this is bad practice, because resolvers usually have very high fidelity in terms of the overall query being made. In other words, a resolver may only be resolving one small piece of the whole query and thus a query would cause high traffic to the database(s), which is all too often the bottleneck to an application anyway.

A resolver should be connecting to backend business logic. There, the business logic will take care of authorization and database retrieval and caching. To me, this is the equation of GraphQL which hasn’t been properly solved yet. What is a good GraphQL backend? GraphQL itself is only the API layer. What about the rest? (hah! Pun not intended! :-))

Scott

    Scott Molinari

    Written by

    Clapping is great. Buying me a coffee or a beer is even better! https://www.patreon.com/user?u=16255660