GraphQL is a query language created by Facebook in 2012 to provide a common interface between clients and servers by defining their data capabilities and requirements.
While GraphQL is commonly thought of as an API technology for frontend applications (especially Relay), it’s generally applicable.
Here’s an example GraphQL query document that you might send to a server to query for specific user information:
Provided that the server’s GraphQL schema supported the fields you’ve requested, you’d get back exactly what you want:
If we requested fields that weren’t supported by the schema defined on the server, forgot required arguments, or passed arguments that were invalid, the server would let us know via helpful error messages, all without manual, custom-written intervention by the schema writer.
Plus, the schema can be introspected by clients.
- “GraphQL Introduction” and “GraphQL: A data query language” posts from Facebook.
- The “Your First GraphQL Server” Medium post by Clay Allsopp.
- “Learn GraphQL” by Kadira.
- The “graphql” StackOverflow tag.
The current version of the specification is the April 2016 Working Draft.