3 ms·
IMO every technology have some minimal accepted level of code quality. Usually it depends on the community or ecosystem, not the tech per say. I.e. usually the
by nivertech 5y ago
IMO every technology have some minimal accepted level of code quality. Usually it depends on the community or ecosystem, not the tech per say. I.e. usually the code quality of Matlab code will be lower than of C++.
IMO code quality of projects using REST-like HTTP APIs is usually lower than the corresponding projects using GraphQL APIs. Just like some people do not care to learn Javascript properly because of its perceived simplicity, for the same reason they are also don't care to learn REST properly.
How many of HTTP APIs have a corresponding OpenAPI spec?
And if they have, is it actually kept in sync with the code?
Does it have proper type definitions, or everything is of a type "string"?
If you are a Stripe you can design a perfect RESTful HTTP API, but for a smaller shop it's much easier to build a moderately good GraphQL API than a corresponding quality HTTP API.
GraphQL forces you:
1. to learn it, instead of blindly using code generated by your web framework
2. to think about your schema
3. to think about backward and forward compatibility, how you your schema will evolve
3. to apply CQS (Command/Query separation)
4. to think how to properly do pagination
5. to think about security
6. to think about error handling, error retries and idempotency of your mutations
etc.
EDIT: For me personally GraphQL was one of the triggers to start serious research on Software Engineering, Software Correctness and Code Quality.
- aniforprez 5y ago> IMO code quality of projects using REST-like HTTP APIs is usually lower than the corresponding projects using GraphQL APIs > How many of HTTP APIs have a corresponding OpenAPI spec? And if they have, is it actually kept in sync with the code Umm what? Is this specific to NodeJS or something? Cause Django and DRF allow one to very easily and very quickly creating high quality REST APIs that are self-documenting and trivial to maintain. Pretty sure rails and go have similar packages and methods to allow for making excellent REST APIs. In fact I've found it a massive pain and a huge performance cost to add GraphQL to such projects. It's far slower than the REST calls