8 ms·
People seem to be complaining about the server component of GraphQL being too hard to maintain, but I'm curious what language and tools they are using. I find t
by retrodaredevil 4y ago
People seem to be complaining about the server component of GraphQL being too hard to maintain, but I'm curious what language and tools they are using. I find that using a code first approach with a language such as Java can provide pretty much the same maintenance as something like a REST API, but for me it naturally fits into a GraphQL API as well. Plus, possible server side calculations (e.i. asking for Fahrenheit instead of Celsius) just don't get executed if they don't need to be. I find the tooling around all of this quite natural (at least for a code first approach).
Some people want GraphQL to provide more advanced features such as filtering or some part of the query involving some business logic when, you can just create a specialized query for that. You would likely create a specialized query if you were using a REST API, unless of course you decide to needlessly complicate your REST API.
Consuming GraphQL APIs is also very pleasant. In a React web project I was working on I was able to set up some code generation from a GraphQL schema so I could get type checking in my TypeScript code. I'm sure this is all possible using some sort of schema for your REST API, but it's going to be more difficult. Of course, if you are trying to handle everything in the frontend and just want a blob of JSON data, then GraphQL may not be for you.