DEV Community

Discussion on: GraphQL Resources: top tools, extensions & tutorials for beginners

Collapse
 
itmayziii profile image
Tommy May III • Edited

In case anyone is nervous about moving to GraphQL let me tell you I have built many REST APIs for fortune 500 companies and for myself. After using GraphQL these last 6 months I am proud to say I will never build another REST API willingly. I'm often very cautious of people that use the word "never" in this industry so that should tell you how strongly I feel about it.

Benefits of GraphQL for me ordered from most important to least important

  • Typed API schema so there is no guesswork about what an API will return you. There is no guessing what query parameters need to exists for the API to work.
  • Expressing related data is extremely easy partly because of the point I made about about typed schemas.
  • The API only has to return to the client what the client asked for. This has the benefit of preventing the API from doing more work than it needs to and smaller payload sizes since the client will not ask for things it does not need.
  • Status codes have become kind of irrelevant where every response returns a 200 status code. This may be implementation specific, I'm not sure if it's actually part of the spec, but I use Apollo Server. This is a benefit because the use of status codes from developer to developer and API to API is so inconsistent.
  • Only one endpoint so there is no guesswork in figuring out what endpoints exist.

Thank you for writing this post. I hope more people start giving GraphQL a chance because of it.