GraphQL is a data query and manipulation language developed by Facebook. With GraphQL, you get precisely the data you request. No more, no less. You have a single entry point, i.e., /graphql
, that you use to get the data.
You define a schema that describes all the possible data you may need to query in your application on your backend. The data is then later fetched using a syntax that replicates the data’s return shape in JSON.
Let’s take a look at one of the widely adopted practices when working with GraphQL.
It is the process of creating a single GraphQL schema from multiple underlying GraphQL APIs. You can use two or more GraphQL schemas and merge them into one endpoint to get data from all the underlying schemas. This provides you with a unified API that you can use to query multiple GraphQL schemas simultaneously. You can also use it to customize an existing GraphQL API.
With GraphQL, you do not have to wait for a single request to resolve to fetch new data based on the response of the previous request. You can just query all the data at once to one schema. As the schema grows, you might want to break it up into modules that can be developed independently.
With sitchSchemas
, you can combine multiple GraphQL APIs into one unified gateway proxy schema. It knows how different parts of the schema works, and because of this, it delegates portions of the requests to the relevant underlying subschemas.
Here are some of its use cases: