Michał Tyszkiewicz
10/12/2022
The authors of State of JavaScript had been including GraphQL in their survey for a while, though it was a bit hidden under the Data Layer subcategory. It did tell us a lot about the incredible growth of GraphQL over the last few years. Usage skyrocketed from just 6% in 2016 all the way up to 47% in 2020 and other metrics were even more impressive. It recorded very high satisfaction at 94%, interest at 87% and awareness at 98% topping each of the three categories. In 2021 the authors opted to remove it from the State of JS survey as it was a bit out of place there, but now we have a dedicated version: the first ever State of GraphQL survey where we can do a deeper dive into the rapidly growing ecosystem.
Feature knowledge and usage is indicative of the fact that GraphQL is a rapidly growing but still fairly new language. Core features were pretty well known and used but as far as directives only @deprecated
was used by more than 40% of respondents, similarly for security & performance features only authentication cracked 50%. As for custom features subscriptions were by far the most used with over 40%, with schema stitching a distant second at 26%. All of that was pretty well illustrated in the knowledge score where the biggest group of respondents ranked at the bottom with 0-10% knowledge of the features, although on the whole over half of the respondents knew at least 50% of the features in the survey which hints at a pretty big group of GraphQL experts.
As far as actual usage of the language goes, the libraries were divided into 4 categories: Servers, Clients, API Generators and Schema Builders and ranked based on usage, retention, interest and awareness. Looking at usage first, obviously Apollo beats everyone else and that’s also reflected in the overall results for Servers and Clients (due to how widely used Apollo Server and Client is) but taking a closer look at the data reveals a few more interesting facts.
A quite broad category encompassing various different tools that help with creating an API. It showed a diverse field with no clear winner in terms of popularity or usage, but some important hints in regards to high interest combined with high user retention, which are important strengths that can mean a lot of future growth.
Its no surprise both the Server and Client section showed a clear dominance of the Apollo Server and Client libraries. Though both were beaten by other libraries in terms of interest and user retention, which might signal users' willingness to jump ship to other libraries over time, especially if provided with a better alternative. The Schema Builders section also had one clear leader
Guild’s GraphQL Code Generator which ranked 1st in all categories, but we're very happy to see our own [[GraphQL Zeus](/docs/zeus)](https://github.com/graphql-editor/graphql-zeus) also appear there.It wouldn't be a complete survey without looking at other use cases and tools used in conjunction with GraphQL so the authors put the remainder in the 'other tools' section and ranked them based on declared usage:
For API types, exposed APIs intended for use with own website/apps and private unexposed APIs for internal usage accounted for 75% of use cases. This highlights a lot of interest in the language but a bit of a hesitancy to using it for publicly available APIs. As for API clients, browsers were the unsurprising overwhelming choice with mobile apps a distant second. The data sources category showed a significant number of respondents still using REST backends as REST APIs were second only to databases. As for industry sectors Programming was obviously first, but with barely 16% it does highlight that GraphQL is now used broadly and in almost every business sector.
This section showed the main reasons for using GraphQL: Type-Safety, avoiding over-fetching, introspection and aggregating results as the main reasons. While community ranked last for strong points, it's not like it's some damnation of it as tooling and ecosystem ranked pretty high. It’s likely simply a question of its size, as even though it is rapidly growing it still is very little compared to other languages, but looking at the broader picture we can be certain that will surely change. For pain points the main selected were error handling, performance, security and client-side caching which should also indicate a direction for the community.
GraphQL is now clearly a mainstay on the programming scene and it's hardly a suprise to see it used more and more for application development. The ecosystem and community is still rapidly growing though and there is a lot of space for improvement and building on top of its strengths. As far as pain points go, there is a growing number of tools and companies dedicated to finding better solutions for security, caching, error tracing and more so it only remains to be seen how those will be handled in the future. Regardless of that it’s clear that the community is growing and interested in trying out a variety of new tools and libraries which makes it apparent the overall growth trend will probably only continue down the line. It also obviously means growth for us as well! We're very grateful 🎉 to the community for appreciating both GraphQL Editor and GraphQL Zeus and we promise we're going to keep improving them both and climbing the ranks in the survey in the future 🚀.
view the survey directly at stateofgraphql.com