StackShareStackShare
Follow on
StackShare

Discover and share technology stacks from companies around the world.

Follow on

© 2025 StackShare. All rights reserved.

Product

  • Stacks
  • Tools
  • Feed

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  1. Stackups
  2. Utilities
  3. API Tools
  4. Remote Procedure Call
  5. GraphQL vs REST

GraphQL vs REST

OverviewComparisonAlternatives

Overview

REST
REST
Stacks239
Followers198
Votes0
GraphQL
GraphQL
Stacks34.9K
Followers28.1K
Votes309

GraphQL vs REST: What are the differences?

1. **Data Fetching**: In GraphQL, the client can specify exactly what data it needs, allowing for fetching of only required data in a single request, reducing over-fetching. In contrast, REST endpoints return fixed data structures that may include excess or insufficient information, resulting in over-fetching or under-fetching. 2. **Overhead**: REST endpoints often require multiple requests to fetch related resources, leading to additional overhead in terms of network requests and data processing. On the other hand, GraphQL allows for fetching all necessary resources in a single request, reducing network overhead and improving performance. 3. **Versioning**: GraphQL does not require versioning of APIs as clients can request only the fields they need, and schema changes can be managed without impacting existing queries. In REST, versioning is important to maintain backward compatibility for clients, requiring explicit versioning in endpoints or headers. 4. **Response structure**: REST APIs have predefined response structures determined by the server, leading to potential issues when clients do not need all the data. GraphQL, on the other hand, allows clients to request data in the structure they desire, enabling flexible and precise data retrieval. 5. **Caching**: REST APIs rely on standard HTTP caching mechanisms like ETag or Last-Modified headers for caching responses, which can be complex to manage. GraphQL provides a built-in caching layer that allows for more granular control over data caching, improving efficiency and reducing redundant data fetches. 6. **Documentation**: In GraphQL, the schema serves as the source of truth for the API, providing detailed documentation and enabling introspection capabilities for clients to explore available data and operations. In REST, documentation is typically external to the API, leading to potential inconsistencies between the documentation and the actual API implementation.

In Summary, GraphQL and REST differ in data fetching efficiency, network overhead, versioning requirements, response structure flexibility, caching mechanisms, and documentation integration.

Share your Stack

Help developers discover the tools you use. Get visibility for your team's tech choices and contribute to the community's knowledge.

View Docs
CLI (Node.js)
or
Manual

Detailed Comparison

REST
REST
GraphQL
GraphQL

An architectural style for developing web services. A distributed system framework that uses Web protocols and technologies.

GraphQL is a data query language and runtime designed and used at Facebook to request and deliver data to mobile and web apps since 2012.

-
Hierarchical;Product-centric;Client-specified queries;Backwards Compatible;Structured, Arbitrary Code;Application-Layer Protocol;Strongly-typed;Introspective
Statistics
Stacks
239
Stacks
34.9K
Followers
198
Followers
28.1K
Votes
0
Votes
309
Pros & Cons
Pros
  • 4
    Popularity
Pros
  • 75
    Schemas defined by the requests made by the user
  • 63
    Will replace RESTful interfaces
  • 62
    The future of API's
  • 49
    The future of databases
  • 12
    Get many resources in a single request
Cons
  • 4
    Hard to migrate from GraphQL to another technology
  • 4
    More code to type.
  • 2
    Takes longer to build compared to schemaless.
  • 1
    No support for caching
  • 1
    No built in security

What are some alternatives to REST, GraphQL?

gRPC

gRPC

gRPC is a modern open source high performance RPC framework that can run in any environment. It can efficiently connect services in and across data centers with pluggable support for load balancing, tracing, health checking...

Prisma

Prisma

Prisma is an open-source database toolkit. It replaces traditional ORMs and makes database access easy with an auto-generated query builder for TypeScript & Node.js.

PostGraphile

PostGraphile

Execute one command (or mount one Node.js middleware) and get an instant high-performance GraphQL API for your PostgreSQL database

OData

OData

It is an ISO/IEC approved, OASIS standard that defines a set of best practices for building and consuming RESTful APIs. It helps you focus on your business logic while building RESTful APIs without having to worry about the various approaches to define request and response headers, status codes, HTTP methods, URL conventions, media types, payload formats, query options, etc.

Oracle PL/SQL

Oracle PL/SQL

It is a powerful, yet straightforward database programming language. It is easy to both write and read, and comes packed with lots of out-of-the-box optimizations and security features.

SQL

SQL

SQL is designed for managing data held in a relational database management system (RDBMS), or for stream processing in a relational data stream management system (RDSMS).

Graphene

Graphene

Graphene is a Python library for building GraphQL schemas/types fast and easily.

JSON API

JSON API

It is most widely used data format for data interchange on the web. This data interchange can happen between two computers applications at different geographical locations or running within same hardware machine.

graphql.js

graphql.js

Lightest GraphQL client with intelligent features. You can download graphql.js directly, or you can use Bower or NPM.

JsonAPI

JsonAPI

t is a format that works with HTTP. A main goal of the specification is to optimize HTTP requests both in terms of the number of requests and the size of data packages exchanged between clients and servers.

Related Comparisons

Bootstrap
Materialize

Bootstrap vs Materialize

Laravel
Django

Django vs Laravel vs Node.js

Bootstrap
Foundation

Bootstrap vs Foundation vs Material UI

Node.js
Spring Boot

Node.js vs Spring-Boot

Liquibase
Flyway

Flyway vs Liquibase