TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Would anyone recommend GraphQL over REST for teams just starting up?

2 点作者 ksaxena超过 1 年前
I'm working with a team building out our first MVP, which is a basic iOS App with about 12 screens. So far, we have built out REST APIs (about 15 APIs support our entire MVP). We are now moving toward building a v2, which is a significant change and we were wondering if we should consider GraphQL (with Hasura) instead of REST. Has anyone been in a similar situation and decided between these options? How did you make your decision? What were the parameters you evaluated?

4 条评论

injb超过 1 年前
I would be inclined not to. IMO GraphQL is great when you have a frontend team that wants to make changes without requiring a new backend build. If your team isn't structured that way (i.e. you have full stack devs and/or very frequent, low overhead backend releases), or the nature of the changes is that they frequently don't require backend changes anyway, then I would just stick with REST.
linkdd超过 1 年前
GraphQL shines when your data model is already a graph, when you have polymorphism and expose nodes&#x2F;edges and follow the &quot;Relay&quot; pattern.<p>But it shines only for the frontend. It is a nightmare on the backend to implement efficiently.<p>Then, you have Hasura, which will compile the GraphQL request into an SQL request. Hasura provides a REST-like schema with GraphQL syntax. At that point, just stick with REST.
tusharmath超过 1 年前
Yes, that is the best time to build a GraphQL API. It will save you many hours later. Like it or not, eventually if you are building a mobile app, you will move to GraphQL eventually. It&#x27;s a massive pain to do it when you have everything running. GraphQL will save you from embarrassing errors on the client and improve performance for sure. My recommendation is — Build API and expose them using REST or GRPC. Use a solution like <a href="https:&#x2F;&#x2F;tailcall.run&#x2F;" rel="nofollow">https:&#x2F;&#x2F;tailcall.run&#x2F;</a> to create a GraphQL facade on top of it for your clients to consume.
评论 #39116310 未加载
GiorgioG超过 1 年前
No. Just don&#x27;t do it.