kenju's blog

About Programming and Mathematics

Reading Notes of "The Road to GraphQL": "What is GraphQL?" Section

Where can I get the book?

https://www.robinwieruch.de/the-road-to-graphql-book/

What is GraphQL?

  • an open source query language created by Facebook
  • Facebook used it internally for their mobile applications since 2012, as an alternative to the common REST architecture
  • allows requests for specific data, giving clients more control over what information is sent
  • is not opinionated about the network layer, which is often HTTP, nor about the payload format, which is usually JSON
  • is not opinionated about the application architecture

It is only a query language

GraphQL Advantages

  • declarative data fetching
  • no over-fetching with GraphQL
  • general solution over multiple frameworks (React, Angular, Node, etc.)
  • single source of truth
  • schema can be easily stitched
  • strongly typed
  • versionless (no API versions)

GraphQL Disadvantages

  • query is complex
  • rate limiting handling is complex
  • caching is more complex than REST

People often mistake GraphQL as a replacement for server-side databases, but it's just a query language