When you are using APIs to query data from an existing application, GraphQL is an interesting API query language to investigate, which differs from REST APIs in different ways.
GraphQL is one Facebook Opensource projects maintained by the Facebook engineering team. It was created in 2012 for describing the capabilities and requirements of data models for client-server applications. Facebook mobile apps have been powered by GraphQL since then. This is still a new and evolving language and is currently used by fast growing US companies such as GitHub, Pinterest, Intuit, Coursera, Shopify.
Here are interesting key points about GraphQL:
#1 : GraphQL queries always run predictable results: you define in your query what you want to get and you don’t get anything more or less in the response. With REST APIs, the response is up to the server, not to the API client.
#2: GraphQL APIs offer access to your data from a single endpoint, while REST APIs are organized in terms of endpoints.
#3: GraphQL APIs can get all data you need in a single request. It can fetch the main entity along with the needed referenced entities. With REST APIs, you need to make multiple calls to get all related data.
Many different programming languages support GraphQL:
- Server libraries: Node.js, Ruby, Python, Scala, Java, PHP, C# …
You can read more about GraphQL on their website: http://graphql.org/