Graphql
GraphQL
Intro
- An architectural and conceptual improvement over REST.
- GraphQL is a data query language developed internally by Facebook in 2012 before being publicly released in 2015.
- It provides an alternative to REST and ad-hoc webservice architectures.
REST vs GraphQL
Lets say, we are consuming Facebook API
A typical nested field data distribution:
| FACEBOOK
|
|------ USERS
| |------- TORAN
| |----- INFO
| |
| |
| |
| |----- ASSETS
| |
|
- GraphQL can retrieve various fields from different endpoint routes in fewer or single query
- whereas REST requires multiple calls for each fields
- e.g.
- REST
Terminologies
Schema
Field
Explore
Authenticating with GraphQL
The GraphQL endpoint
Communicating with GraphQL
About query and mutation operations
Working with variables
Query
Mutation