> For the complete documentation index, see [llms.txt](https://docs.serverlessapigateway.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.serverlessapigateway.com/glossary/g/graphql.md).

# GraphQL

GraphQL is a query language for APIs and a server-side runtime for executing queries against a type system defined for your data. Developed by Facebook in 2012 and open-sourced in 2015, GraphQL allows clients to request exactly the data they need, avoiding the over-fetching and under-fetching problems common with REST APIs.

A GraphQL API exposes a single endpoint and uses a schema to define available types, queries (reads), mutations (writes), and subscriptions (real-time updates). Clients send queries specifying the exact fields and relationships they need, and the server returns a JSON response matching that structure. This reduces the number of network round trips required to fetch related data.

API gateways can sit in front of GraphQL APIs to provide authentication, rate limiting, and caching. However, caching GraphQL is more complex than caching REST because queries are typically sent as POST requests with varying bodies. Some gateways also support GraphQL-to-REST translation, allowing teams to expose a GraphQL interface while routing to existing REST backend services.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.serverlessapigateway.com/glossary/g/graphql.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
