Blog / How the internet works /
REST vs GraphQL in plain words
Short answer: if you run a WordPress or Shopify site and just need to read or publish content, you’ll meet REST and rarely need to think about GraphQL. If you’re building an app where screens need exactly the right slice of data from many places, GraphQL starts to earn its keep. Most people should start with REST and move only when it hurts.
Both are ways for one piece of software to ask another for data. If you want the basics first, APIs explained for website owners is the starting point. Here, we’re comparing two styles of asking.
The restaurant analogy
Imagine ordering food.
REST is a set-menu restaurant with a fixed list of dishes. You ask for “dish 12” and you get dish 12, whole: the main, the side and the sauce. Want the side of a different dish? Order that dish too, and get the extras you didn’t need.
GraphQL is a kitchen that takes a custom order. You write down exactly what you want: “the rice from dish 12, the sauce from dish 7”. You get that and nothing else, in one trip.
That’s the core difference. REST gives you what the server decided a “thing” looks like. GraphQL lets you describe the shape you want.
How REST works
REST organises everything as resources, each with its own address (URL). You use standard HTTP verbs on them:
GET /posts/42reads post 42POST /postscreates a postPUTorPATCHon/posts/42updates itDELETE /posts/42removes it
The server answers with data (usually JSON) and a status code, such as 200 or 404. If you know how HTTP status codes work, you already understand half of REST.
WordPress ships with a REST API. Shopify has REST endpoints for parts of its Admin API, though it has been steering developers toward GraphQL for newer work. If you want the WordPress angle, see WooCommerce and the WordPress REST API for content publishing.
How GraphQL works
GraphQL usually has one address for everything. You send a query describing the data you want, and the server returns a response matching that shape.
A query might look like this:
{
post(id: 42) {
title
author { name }
comments { text }
}
}
You get the title, the author’s name and the comments’ text. No more. The server’s schema defines what can be asked, so tools can autocomplete and check queries before they run.
Shopify’s Storefront and Admin APIs offer GraphQL, and many modern front ends use it to pull exactly what a page needs.
Side by side
| REST | GraphQL | |
|---|---|---|
| Addresses | Many (one per resource) | Usually one |
| What you get back | The server’s fixed shape | The shape you ask for |
| Over-fetching | Common (extra fields) | Avoided by design |
| Under-fetching | Common (need several calls) | One query can combine |
| Caching | Easy; plain HTTP caching works | Harder; needs extra work |
| Learning curve | Gentle | Steeper |
| Tooling and docs | Everywhere | Strong, but you must learn the query language |
| Best for | Simple CRUD, public APIs, content | Complex screens, mobile apps, many data sources |
What actually matters day to day
Over-fetching and extra trips
Say you want a list of article titles. A REST endpoint might return the full body of every article, which is wasted data. Say you want articles with their authors and comment counts: that may take three separate calls. On a fast office connection, nobody notices. On a mobile network with a high round-trip cost, those extra trips add up. Think back to the sequence in what happens in the first second of loading a page: each request has a wait attached.
GraphQL’s pitch is that you get it all in one request, with only the fields you need.
Caching
REST has the advantage here. Because each resource has its own URL and uses GET, browsers, CDNs and servers can cache responses without special effort. GraphQL queries usually go through a single POST address, so standard caching doesn’t apply, and you need tools designed for it. If your site depends on a CDN doing lots of work, that matters. See caching explained.
Complexity and cost
GraphQL moves power to the client, which means the client can ask for expensive things. A badly written query can request enormous nested data and strain the server. Teams set limits on query depth and cost. REST endpoints are easier to reason about because the server decides what each one does.
Security
Neither is safer by nature. Both need authentication, permission checks, and limits on how much one caller can ask for. A pattern that protects you with either: keys stay on the server and out of browser code, as in never put API keys in front-end code.
Learning and debugging
REST is easy to try. Paste a URL into a browser and you see the response. GraphQL needs a tool or a small script, because queries are sent in the request body. That’s a small barrier, but real for beginners.
Common myths
- “GraphQL replaced REST.” It didn’t. Both are widely used, and many products offer both.
- “REST is old, so it’s worse.” It’s simple and well understood, and plenty of excellent APIs use it.
- “GraphQL is always faster.” It can reduce trips and payload size, but badly designed queries can be slow. Speed comes from design, not the label.
- “You must pick one.” A project can use REST for simple jobs and GraphQL for complex ones.
Who should care
If you manage a business site, you mostly need to recognise the names. When a developer says “we’ll pull this over GraphQL,” you now know it means “we’ll ask for exactly the fields the page needs.” When a plugin says “uses the REST API,” you know it means standard URLs that return JSON, and that security settings on those endpoints are worth understanding (see XML-RPC, the REST API and what to lock down).
If you’re building something yourself, perhaps with AI helping you write the code, REST is usually the quicker start. Ask the tool to generate a few endpoints, test them in the browser, and only reach for GraphQL if you find yourself making lots of calls to assemble one screen.
Pick REST if… pick GraphQL if…
Pick REST if:
– You’re reading or writing content on WordPress or similar.
– You want simple URLs, easy testing and straightforward caching.
– Your data is fairly flat and your team is small.
– You’re publishing a public API and want it easy to adopt.
Pick GraphQL if:
– Screens assemble data from many related objects.
– You build for mobile, where fewer round trips matter.
– Different clients need different slices of the same data.
– You’re using a platform that already exposes a strong GraphQL API, such as Shopify’s.
Key takeaways
- REST: many URLs, fixed shapes, easy caching. GraphQL: one endpoint, you choose the shape.
- GraphQL reduces over-fetching and extra trips; REST is simpler and caches better.
- Neither is automatically faster or safer.
- Start with REST unless your data shape gives you a clear reason not to.
FAQ
Do I need to learn GraphQL to work with Shopify?
Not for everyday store management. Theme and app developers meet it more, because many of Shopify’s newer API features are in GraphQL.
Can one site use both?
Yes. WordPress can expose GraphQL through add-ons while keeping its built-in REST API. Just keep security settings in mind for both.
Related reading
If you had to describe your own site’s data in one sentence, would a fixed menu or a custom order suit it better?