Glossary

What Is GraphQL?

GraphQL is a query language for APIs that lets clients request exactly the data they need — no over-fetching, no under-fetching, and a strongly typed schema as the contract.

GraphQL was developed by Facebook in 2012 and open-sourced in 2015. Instead of fixed endpoints that return a predetermined shape, GraphQL exposes a single endpoint where clients describe exactly what data they want.

GraphQL vs REST:

# GraphQL — client controls the shape
query {
  user(id: "42") {
    name
    email
    subscriptions {
      planName
      status
    }
  }
}

With REST, you'd call /users/42 (maybe over-fetches 20 fields you don't need) and /users/42/subscriptions (a second round-trip). GraphQL gets both in one request, with only the fields you asked for.

When GraphQL makes sense:

  • Multiple client types (web, mobile, third-party) with different data needs
  • Complex nested data relationships that REST would require many requests to fetch
  • Teams with clear frontend/backend separation who want a typed contract

When REST is better:

  • Simple CRUD with predictable data shapes
  • Small teams where the API and frontend are built by the same person
  • When caching matters — GraphQL POST requests are harder to cache than REST GET responses

GraphQL in practice: Supabase exposes a GraphQL API alongside its REST API automatically. For most SaaS MVPs, the REST API is simpler to start with. GraphQL becomes valuable when you have multiple client apps with meaningfully different data requirements.

Related Terms

Want this built?