GraphQL is a modern way of building and querying APIs. It is a syntax that describes how to ask for data, and is generally used to load data from a server to a client.
With GraphQL, you can make an API request to fetch only the required information instead of constructing several REST requests. The GraphQL API has a single endpoint, that remains constant no matter what operation is performed.
GraphQL is backed by your existing code and data, and it is not tied to any specific database or storage engine.
When creating a GraphQL service, you must first define types and fields on these types, and then provide functions for each field on each type.
After a GraphQL service is running, typically at a URL on a web service, it can receive GraphQL queries to validate and execute. A GraphQL query is a string that is sent to a server to be interpreted and fulfilled. The service checks the query to ensure it only refers to the types and fields defined. It then runs the provided functions to produce a result and return a JSON response back to the client.
This guide cannot cover all the details about GraphQL. Here are some starting points to help you find more details: