Hacker News new | ask | show | jobs
by hakanito 2418 days ago
Basically GraphQL is an API contract between a client and a server. The contract defines what data, through types and fields, is available.

The server must fulfil this contract by providing methods (called resolvers) for each field.

The client must fulfil this contract by only asking for available fields.

The query language is built to support highly nested data.

Now, the N+1 problem you are talking about is not a GraphQL problem, but an implementation problem. Depending on how you write your server methods you can get it down to very few db calls (some use a thing called dataloader. Other tools are hasura or postgraphile)