Need advice about which tool to choose?Ask the StackShare community!
GraphQL vs JSON API: What are the differences?
GraphQL: A data query language and runtime. 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; JSON API: One of many data formats that is often applied to REST. 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 and JSON API can be categorized as "Query Languages" tools.
GraphQL is an open source tool with 11.8K GitHub stars and 769 GitHub forks. Here's a link to GraphQL's open source repository on GitHub.
Facebook, Instagram, and Twitter are some of the popular companies that use GraphQL, whereas JSON API is used by PACE Telematics GmbH, Ranker, and Selleo. GraphQL has a broader approval, being mentioned in 777 company stacks & 3271 developers stacks; compared to JSON API, which is listed in 12 company stacks and 13 developer stacks.
Pros of GraphQL
- Schemas defined by the requests made by the user73
- Will replace RESTful interfaces62
- The future of API's60
- The future of databases48
- Self-documenting12
- Get many resources in a single request11
- Ask for what you need, get exactly that5
- Query Language4
- Evolve your API without versions3
- Fetch different resources in one request3
- Type system3
- GraphiQL2
- Ease of client creation2
- Easy setup2
- Good for apps that query at build time. (SSR/Gatsby)1
- Backed by Facebook1
- Easy to learn1
- "Open" document1
- Better versioning1
- Standard1
- 1. Describe your data1
- Fast prototyping1
Pros of JSON API
Sign up to add or upvote prosMake informed product decisions
Cons of GraphQL
- Hard to migrate from GraphQL to another technology3
- More code to type.3
- All the pros sound like NFT pitches1
- Works just like any other API at runtime1
- Takes longer to build compared to schemaless.1