DEV Community

Sacha Greif
Sacha Greif

Posted on

Devographics API Update, April 2023

I've spent the last couple months working on a total rewrite of the API layer that powers the State of JavaScript, State of CSS, and State of GraphQL surveys.

The core issue was that this API had initially been conceived for to handle the State of JavaScript data. Then, when we decided to branch out into CSS land, I bolted on additional types and fields to support that – and again when it came time to add the GraphQL survey.

As you can imagine, the resulting mess was far from ideal. So with this rewrite, I wanted to throw out all the vast majority of our manually-defined GraphQL types and instead generate the entire API from the same YAML files that define the contents of each survey.

A better GraphQL structure

The result is a much cleaner API structure, as you can see in the GraphiQL Explorer. It's literally the same structure as the survey results, which makes it a lot easier to explore our data!

GraphiQL Explorer showing a sample query for Astro data

All the filters!

A nice side-effect of everything in the API being dynamically generated is that you can now filter any question by any other question!

Filtering a question

A more useful Data Explorer

The same is true of the Data Explorer. You can now compare any two questions, such as React vs Next.js use:

React vs Next.js use

Thanking our supporters

It would be impossible for me to just take two months to work full-time on such a big rewrite without the support of the companies sponsoring my work, and I want to especially thank the folks in the Google Chrome team, as well as Nijibox here in Japan for believing in the project!

A big thanks as well to all the people who chose to sponsor a chart directly. It means a lot to know that the community itself also supports the surveys!

Try it out!

You can try out the new version of the State of JavaScript 2022 Survey Results right now.

Astro vs Company Size

It might not seem like much has changed, but try playing with the filters or the Data Explorer and you might find some interesting new insights – or more likely find some bugs, in which case do leave an issue!

Top comments (0)