A graph is a very generic data structure, so it should be possible to express the data of any application in the form of a graph. And this graph, formed by all application data, is what we call the graph in GraphQL.

With GraphQL we look at the overall set of data that is exposed by an API provider. All this data is exposed via a single endpoint. Compared to REST endpoints, the single GraphQL endpoint exposes a lot of data. This comprehensive set of data with its entities and relationships between the various entities forms the graph of GraphQL. To retrieve any data at all, one needs to navigate the graph.

When using other philosophies for building APIs, such as REST, we usually create several API endpoints and whatever is exposed by any single one of the API endpoints is typically not a generic graph, but rather a single entity or a list of entities. But there can be graph-like relationships across all API endpoints of an API provider. And this is in fact attempted by REST: resources are linked by URLs.

Both philosophies are capable of expressing application data in form of a graph, with GraphQL the graph is more explicit since it is served on a single endpoint.

Where is the Graph in GraphQL?
Tagged on:     

Matthias Biehl

As API strategist, Matthias helps clients discover their opportunities for innovation with APIs & ecosystems and turn them into actionable digital strategies. Based on his experience in leading large-scale API initiatives in both business and technology roles, he shares best practices and provides both strategic and practical guidance. He has stayed a techie at heart and at some point, got a Ph.D. Matthias publishes a blog at api-university.com, is the author of several books on APIs, and regularly speaks at technology conferences.