Shopify allows us to use GraphQL and REST API, which allows us to communicate with the back end of the store from the perspective of the code on the front. In the past REST has been a generally accepted standard in the design and development of APIs, but for a few years GraphQL has been gaining popularity and gaining more and more fans.
Facebook presented GraphQL as a revolutionary alternative to REST APIs, so the difference between the two approaches is considerable. REST is the general architectural standard for creating APIs, while GraphQL is also a query language and a set of tools that operate on one endpoint using HTTP protocol.
For example, imagine that we have a movie board where each object contains information about a single movie; title, description, director, etc., and we want to display only movie titles on the front. Using GraphQL, we can specify the request to get data from a particular field, e.g. ‘title’, and we don’t have to wait for the server to return the whole set of data to display the movie titles themselves later.
This is more than the API
As I mentioned above, GraphQL is also a set of tools, as GraphiQL is an example. It is an integrated environment, a tool that helps us to build the correct query structure and mutations (a newer and more interesting equivalent of this IDE is GraphQL Playground). Thanks to Apollo we have access to the client (CLI), which allows us to manage the state of applications in React based on smooth GraphQL operations. Learning curve can also be a disadvantage of this environment, but the time spent on learning it will certainly pay off.