About GraphQL

GraphQL is a query language for APIs and a runtime for executing those queries with existing data. Unlike REST, it lets you structure your request however you prefer.

What is GraphQL?

When you think of Facebook, you probably imagine cat pictures and distant relatives—but they also create useful technologies like GraphQL.

In the words of the official GraphQL website:

GraphQL is a query language for APIs and a runtime for executing those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.

In other words, it’s an alternative to REST for making API requests. You can choose which information to return and run multiple independent queries in a single request. It’s also very convenient for us on the API side, since we don’t need to constantly change endpoints to support new features.

Why are we using GraphQL?

GraphQL helps us build more dynamic applications and serve our API clients more efficiently—without making changes that affect everyone.

You know that moment when your backend is so full of hacks and last-minute features that it becomes a spaghetti mess no one understands anymore? Like those COBOL-based systems that charge a fortune for small changes because no one knows what might break? That’s reason number one. (And also a good reason to rebuild things from time to time.)

GraphQL makes our lives easier by reducing the number of MVC controllers. And it brings several advantages for you too:

  • Fewer requests to the API by chaining independent queries into a single request

  • Strong typing helps avoid bugs from unexpected data formats

  • Smaller and faster responses since you only ask for what you need

We're enjoying working with GraphQL, and we hope you’ll enjoy playing with queries and using the code generators that come with having a full API schema.

You can better understand everything you can do with GraphQL at graphql.org Or check out this awesome list of GraphQL resources: github.com/chentsulin/awesome-graphql

Last updated

Was this helpful?