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. Application & Data
  3. Languages
  4. Query Languages
  5. GraphQL vs JSON-RPC

GraphQL vs JSON-RPC

OverviewComparisonAlternatives

Overview

GraphQL
GraphQL
Stacks34.9K
Followers28.1K
Votes309
JSON-RPC
JSON-RPC
Stacks33
Followers53
Votes0

GraphQL vs JSON-RPC: What are the differences?

Introduction

GraphQL and JSON-RPC are both popular data querying and manipulation protocols used in web development. While both serve a similar purpose, there are several key differences between the two that make them stand out in their own ways.

  1. Schema-based vs. Schema-less: One of the fundamental differences between GraphQL and JSON-RPC is their approach to data modeling. GraphQL relies on a strong schema, where the structure and types of the data are defined upfront. This allows clients to request only the specific data they need, reducing unnecessary payload. On the other hand, JSON-RPC is schema-less, meaning there is no predefined structure or type validation for requests or responses.

  2. Flexible vs. Fixed Response: GraphQL provides flexibility in terms of response structure. Clients can specify the fields they want to retrieve, and the server returns only those fields. This minimizes the over-fetching of data and reduces network bandwidth. In contrast, JSON-RPC has a fixed response structure defined by the server, where clients receive the entire response object regardless of their specific needs.

  3. Single Endpoint vs. Multiple Endpoints: GraphQL uses a single endpoint for all the data fetching and manipulation operations. Clients send a single request to this endpoint, which is then processed by the server to fetch the required data. JSON-RPC, on the other hand, typically involves multiple endpoints, with each endpoint serving a specific operation or method. Clients need to make separate requests to different endpoints for different operations.

  4. Strong Typing vs. Dynamic Typing: In GraphQL, strong typing is enforced at the schema level, ensuring that the data passed conforms to the specified types. This provides early validation and reduces the risk of runtime errors. JSON-RPC, being schema-less, allows for dynamic typing, where parameters and return values can have different types in different requests and responses.

  5. Bi-directional Communication vs. Request-Response: GraphQL supports bi-directional communication between the client and server. This means that not only can the client request data, but it can also push data to the server using subscriptions and real-time updates. JSON-RPC, on the other hand, operates on a request-response paradigm, where the client sends a request to the server and waits for the response.

  6. Cached Responses vs. Fresh Responses: GraphQL enables clients to cache responses efficiently. Since clients specify the exact data they need, they can reuse the cached responses for subsequent requests. This reduces the number of network requests and improves performance. In JSON-RPC, the entire response is sent every time with no built-in caching mechanism, requiring the server to process the request and generate a fresh response for every call.

In summary, GraphQL and JSON-RPC differ in their approach to data modeling, response flexibility, endpoint structure, typing, communication paradigm, and caching. Choosing between them depends on the specific requirements of the application and the desired trade-offs between flexibility and structure.

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

GraphQL
GraphQL
JSON-RPC
JSON-RPC

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.

It is a very simple protocol, defining only a few data types and commands. It allows for notifications (data sent to the server that does not require a response) and for multiple calls to be sent to the server which may be answered out of order.

Hierarchical;Product-centric;Client-specified queries;Backwards Compatible;Structured, Arbitrary Code;Application-Layer Protocol;Strongly-typed;Introspective
-
Statistics
Stacks
34.9K
Stacks
33
Followers
28.1K
Followers
53
Votes
309
Votes
0
Pros & Cons
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
No community feedback yet
Integrations
No integrations available
Python
Python
MQTT
MQTT

What are some alternatives to GraphQL, JSON-RPC?

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.

REST

REST

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

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.

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