Tech

GraphQL

Definition

A query language and runtime for APIs developed by Facebook that allows clients to request exactly the data they need, reducing over-fetching and under-fetching common with REST APIs.

Try the free calculator

Use our JSON Formatter to run the numbers yourself.

GraphQL is a specification for building APIs that provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need, and makes it easier to evolve APIs over time. Unlike REST APIs where each endpoint returns a fixed data structure, GraphQL uses a single endpoint where clients specify their data requirements through queries.

A GraphQL schema defines the types of data available and the relationships between them using a strongly-typed system. Clients send queries that mirror the shape of the desired response, requesting only the specific fields needed. This eliminates over-fetching, where REST endpoints return more data than needed, and under-fetching, where multiple REST calls are required to assemble the necessary data.

GraphQL has been adopted by major companies including GitHub, Shopify, Twitter, and Airbnb. Its benefits include reduced network traffic, better developer experience with built-in documentation and type checking, and easier API evolution since new fields can be added without versioning. However, GraphQL introduces complexity in areas like caching, rate limiting, and query optimization, and may be overkill for simple APIs with straightforward data requirements.

Get weekly tips for GraphQL & more

No spam. Unsubscribe anytime.

Related Calculators

Related Terms

Related Articles

Stay Updated

Get notified about new tools, features, and exclusive deals. No spam, ever.