GraphQL
GraphQL is a powerful data query and manipulation language, created by Facebook. Essentially GraphQL is an alternative to REST. GraphQL exceeds REpresentational State Transfer because it facilitates data queries which manipulate the shape of returned data from a web api. It allows web API-driven applications to be structured in a much more flexible and efficient way.
Day509 of #365DaysOfCode @CareerDevs@GraphQLEditor is an awesome schema editor for #GraphQL that's super easy to use!https://t.co/Nhd2e3SEG1#100DaysOfCode #CareerDevs #SiliconRhode pic.twitter.com/GShyRYHX5R
— Zack Hartmann (@zack_hartmann) October 5, 2019
The Client Decides what Data to Receive
GraphQL can operate over HTTP, like REST. Because the client can define the shape of data, an operation that may have required multiple REST queries can be accomplished in a single query with GraphQL. Flexible data querying means less code to maintain. Instead of multiple API endpoints, GraphQL can use one API endpoint.
GraphQL Operations Terminology
- Query - fetch data (get)
- Mutation - modify data (create / update / delete)
- Subscription - Watch for data changes in real time