D
D
DeniSidorenko2021-03-17 11:40:17
Node.js
DeniSidorenko, 2021-03-17 11:40:17

Should GraphQL be used everywhere?

Good afternoon, the previous project implemented the REST API method, controllers, routes. In a new project, I decided to use GraphQL. I liked the query which can quickly and easily get the necessary data. But the question is whether it is now necessary to use it everywhere? For example, for receiving products, it is great. And for example, to add products, register users, it seemed to me more convenient to use the REST API. For example, for authorization where middleware is required.
As for me, it is not so suitable for mutation. The question is whether it should be used everywhere or only to receive complex queries. The question may be strange because there are no restrictions in this regard, but how many reports I watched everywhere refused about the REST API in favor of Graphql.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Belyaev, 2021-03-18
@DeniSidorenko

If you are not writing an external or public API, then GraphQL and REST will be a very disgusting choice. They limit you to low-level CRUD, create more problems than they solve, and most importantly, make it difficult to express your API in terms of domain scope.
Look in the direction of RPC protocols, and see how elegantly they can describe your domain specifically. And the choice here is huge: Apache Thrift, gRPC, JSON-RPC, as well as my favorite, but for some reason little known on the Russian-speaking Internet E/A/?T (stands for entity/action/optional-target)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question