DEV Community

Discussion on: Why I no longer use GraphQL for new projects

Collapse
kasvith profile image
Kasun Vithanage • Edited on
  • Adding dataloader is not that hard, you just need to detect where you will need this. For example in a field resolver

  • In REST its true that we can protect routes using a middleware or something. but when you develop a large scale project involving multiple level authorizations, things started to get messy. For example take a route like GET /api/invoice/1. There can be additional fields that are hidden or shown based on the user authorization level. Implementing this in REST is a mess, even though documenting it even harder...serialization goes the same

But in GraphQL this is already solved, you can have granular field level authorization which is lot easier to implement and maintain.

  • Its true, writing a GraphQL API requires you to have the knowledge. Its not like REST which is simply passing data around. Onboarding an engineer takes time. I agree

So my conclusion is, if your API is getting complex, involving authorization levels, having multiple people working in different client applications...GraphQL worth the shot. It may take some time, but once you get it going you will see the result

Collapse
casualmatt profile image
casualmatt

The new HTTP QUERY Method, is designed to compensate that.
It will be possible to use Rest as you use it now in elastic, so you can use it to get just some data, and to grab relational data too.

a good open source project that take already advantage of that is directus9.
RelationalData
Search Method