Skip to content
uencoder

GraphQL

GraphQL is a strongly typed API query language developed by Facebook: the client declares the fields it needs and the server returns exactly matching data, avoiding over- and under-fetching.

Purpose

It offers a single on-demand query endpoint for APIs, solving REST's over-fetching and multiple-request problems, with strong typing and introspection.

Mechanism

The client sends a query/mutation/subscription document; the server validates it against the schema, runs resolver functions to fetch the data, and returns JSON matching the query's shape. The schema defines the types and entry points.

Use cases

  • API data queries
  • On-demand data fetching on mobile
  • Unified API gateways

Related tools

References