Application 2018-06-14

What is GraphQL

Understand GraphQL as a query language for APIs with flexible data selection, single endpoint, and type system advantages.

Read in: ja
What is GraphQL

What is GraphQL

Comparison of REST API and GraphQL

REST API Format

Send requests to endpoints using HTTP verbs

curl https://api.bmf-tech.com/v1/configs

[
    {
        "id": 1,
        "name": "title",
        "alias_name": "Title",
        "value": "bmf-tech",
        "created_at": "2017-09-25 23:08:23",
        "value": "bmf-tech",
        "deleted_at": null
    }
]

GraphQL API Format

Send queries to a single endpoint

curl https://api.bmf-tech.com/api

configs {
  id,
  name,
  alias_name
  value,
  created_at,
  updated_at,
  deleted_at
}
[
    {
        "id": 1,
        "name": "title",
        "alias_name": "Title",
        "value": "bmf-tech",
        "created_at": "2017-09-25 23:08:23",
        "value": "bmf-tech",
        "deleted_at": null
    }
]
REST API GraphQL
Endpoints Multiple Single
HTTP Verbs Dependent Independent
Type System None Available
Versioning Required Yes No
Documentation Required Yes No
Resource Limitation Mainly call count Handled according to resource amount

Points of Concern

Impressions

References

Tags: API HTTP REST GraphQL
Share: 𝕏 Post Facebook Hatena
✏️ View source / Discuss on GitHub
☕ Support

If you enjoy this blog, consider supporting it. Every bit helps keep it running!


Related Articles