Why Use GraphQL
GraphQL is the new hotness and being a technology that is just over 2 years old at time of writing still a very new technology but one that has gained quite some traction and the more I look at it the more I like to believe there is a good reason why GraphQL has gained so much ground and why it will continue to balloon out and grow. What is GraphQL --------------- GraphQL is somewhat of a strange name for a Query Language that resembles JSON much more than anything else, Maybe Facebook just liked the way it sounded but GraphQL has nothing to do with graphing data, it is more of a programmatic way to query endpoints and return data all in a JSON standard that makes for cross integration in numerous services. What is nice about GraphQL is how it maps queries to modals and allows for much more consistent design across lager services. Why GraphQL ----------- What I find quite interesting about GraphQL is how many people keep heralding this as the end of RESTful services, personally, I don't see that happening anytime soon as REST works overall fairly well and is such an industry standard at this point it isn't going to be canned anytime soon, I do however expect more GraphQL use and even taking away from REST in some areas but generally I think this is more likely to be a case where they will both be used. I expect that GraphQL will be used as a middleware to go between the server side items: REST, Databases, Microservices, etc... and the client side creating a much more unified way for both sides to work together. I do believe this is the great power of GraphQL its ability to unify a very fractured ecosystem creating one common endpoint that can be queried using more programmatic language than that of a list of endpoints to hit, GraphQL works very well as a new way to abstract server side items into just one common place where everything can be passed between. What works great about this somewhat middleware implementation is that it means it will allow for gradual role out of the service, rather than requiring on changing everything and causing many issues. In most cases I expect more platforms will put in a GraphQL server between the backend and the frontend to create a common endpoint to query, and allow for the backend to grow in anyway the developers see fit as GraphQL works connecting to pretty much anything and what is great is that the frontend developers only need to keep in mind the GraphQL models rather than all the convoluted different schemas and REST objects making it easier to normalise a lot of the data. Getting Started --------------- GraphQL is pretty easy to work with, although I would not recommend it to anyone still in the early stages of their development journey as it is not really that vital initially. However if you have worked with REST, Databases a responsive dynamic frontend and want to explore the next big technology then GraphQL is very much for you. Apollo is a fantastic framework that has both a server and client side framework and [pretty great documentation] that goes over the basics in a very accessible manner for anyone familiar with NodeJS on the server side. Conclusion ---------- GraphQL is a response to us working in an ever fractured ecosystems and to its credit it does a very good job of actually doing its job and making developers lives a little easier. I do expect it to be a technology that will be used in ever greater amounts in the next few years, however I do not believe it will result in any other technology being made obsolete as that is not really the purpose of GraphQL. What is really nice about GraphQL is how easy it is for anyone to jump into and has a lot of awesome features that just work. Now for small projects this is not going to be useful, however once you have several small projects all using different endpoints GraphQL is probably your next step in creating a common endpoint and it is pretty awesome. : https://www.apollographql.com/docs/apollo-server/
Last edited: Jan. 27, 2019, 8:41 a.m.