---
title: "GraphQL: flexible query language for APIs"
description: "GraphQL (Open Source July 2015) by Facebook: query language for APIs, type system, single endpoint, client specifies what it needs. Apollo Server/Client, Relay, Hasura. Alternative to REST for multi-source data aggregation."
url: "https://www.noze.it/en/insights/graphql-spec/"
lang: "en"
alternate: "https://www.noze.it/insights/graphql-spec/"
published: "2015-10-20"
author: "noze S.r.l."
keywords: "Open Source, Web, GraphQL, Facebook, Meta, Apollo, Relay, API"
---

# GraphQL: flexible query language for APIs

GraphQL (Open Source July 2015) by Facebook: query language for APIs, type system, single endpoint, client specifies what it needs. Apollo Server/Client, Relay, Hasura. Alternative to REST for multi-source data aggregation.

20 October 2015

## REST’s limit

Typical **REST** APIs have two problems for mobile/SPA clients:

- **Over-fetching** — endpoint returns more data than needed
- **Under-fetching** — an operation requires calls to N endpoints

Facebook internally (2012) develops GraphQL to feed the iOS/Android mobile app with heterogeneous data (profile, feed, notifications) in a single optimised call.

## The release

**GraphQL spec** is released as **Open Source by Facebook on 14 July 2015**. Leads: **Lee Byron**, **Dan Schafer**, **Nick Schrock**. **MIT** licence.

## Concepts

- **Schema** — strongly typed type system with scalars, objects, interfaces, unions, enums
- **Query** — read operation, client specifies data shape
- **Mutation** — write operation
- **Subscription** — real-time stream (typically over WebSocket)
- **Resolver** — server functions that resolve each field

```
type User {
  id: ID!
  name: String!
  posts: [Post!]!
}

query {
  user(id: "123") {
    name
    posts { title }
  }
}
```

## Advantages

- **Single endpoint** `/graphql` for everything
- **Client-specified data** — no over/under-fetching
- **Typed schema** — introspection, tooling
- **Versionless** — evolution via deprecation
- **Strong tooling** — GraphiQL, Apollo Studio, Insomnia, Postman

## Disadvantages

- **N+1 queries** — naive resolvers devastating; requires **DataLoader**
- **Caching** — more complex than REST/HTTP cache
- **Complexity attacks** — deep queries expensive; needs **depth limit**, **cost analysis**
- **Over-engineering** for simple APIs

## Implementations

- **graphql-js** — reference, Node.js
- **Apollo Server/Client** — most widespread ecosystem
- **Relay** — Meta client for React
- **Hasura** — GraphQL auto-generated from Postgres
- **PostGraphile** — Postgres → GraphQL
- **Strawberry** (Python), **graphql-ruby**, **sangria** (Scala), **graphql-java**, **HotChocolate** (.NET)

## Composition and gateway

- **Schema stitching** — composing multiple GraphQL schemas into a super-schema
- **GraphQL Mesh** (in ideation) — multi-source gateway

## In the Italian context

GraphQL is spreading into headless e-commerce projects, media publishing, mobile apps with BFFs and internal admin tools for multi-source data aggregation.

Update — 2026

From 2018 the spec moves under the **GraphQL Foundation** (Linux Foundation). **Apollo Federation** v1 (2019) and v2 (2021) introduce sub-graph composition into super-graph. After the 2016-2020 enthusiasm many companies return to **REST**, **OpenAPI-first** and **tRPC** (end-to-end type safety for fullstack TypeScript stacks): Apollo becomes more commercial, HTTP caching remains complex and players like Netflix and Twitter deprecate internal use. GraphQL remains dominant where multi-source aggregation is needed (BFF, API composition, public dev portals).

---

_References: GraphQL Open Source (14 July 2015). Facebook/Meta. Lee Byron, Dan Schafer, Nick Schrock. MIT licence. Apollo Server/Client._
