2 ms·
This is absolutely not correct, but it is a common misunderstanding I've seen with how people use GraphQL. I've posted this before, but I despise how GraphQL h
by hn_throwaway_99 8y ago
This is absolutely not correct, but it is a common misunderstanding I've seen with how people use GraphQL.
I've posted this before, but I despise how GraphQL has "QL" in the name, so folks think it is similar to SQL in that you should expose your database tables as-is with GraphQL queries. You should absolutely not do this.
You should design your GraphQL contracts to closely match the views displayed in your UIs - it even says this in the GraphQL spec: "Product‐centric: GraphQL is unapologetically driven by the requirements of views and the front‐end engineers that write them. GraphQL starts with their way of thinking and requirements and builds the language and runtime necessary to enable that."
If your GraphQL types closely hew to the design of your views, it shouldn't matter how you store them under the covers, and clients should have no need to know any details about the underlying storage schema.