---
description:
  GraphQL Mesh allows you to create a unified GraphQL schema from multiple sources, using handlers
  and transforms. Configure sources, handlers, and transforms in a .mesh.yaml file to build your
  first gateway.
---

# Overview

Working with Mesh means dealing with 4 main concepts: _Sources_, _Handlers_, _Transforms_ and
_Unified Schema_:

1. In Mesh, a sub-service (GraphQL API, REST API) is called a _Source_.
2. Sources are translated to GraphQL Schemas with the appropriate _Handler_.
3. All Sources' GraphQL Schema are merged into a final _Unified Schema_.
4. Finally, if applicable, configured transformations, called _Transforms_, are applied to the
   _Unified Schema_.

```mermaid
graph LR;
subgraph A [GraphQL Mesh server]
A0[Unified Schema]
subgraph A1 [Configured sources]
subgraph A11 [City Source]
A111[City Source GraphQL Schema]
end
subgraph A12 [Population Source]
A121[Population GraphQL Schema]
end
subgraph A31 [Weather Source]
A311[Weather GraphQL Schema]
end
end
end
A111 & A121 & A311-- merged in --> A0
subgraph B [Services]
subgraph B1 [City REST API]
B11[Swagger definition file]
end
subgraph B2 [Population GraphQL API]
B21[GraphQL Schema]
end
subgraph B3 [Weather REST API]
B31[RAML definition file]
end
end
B11--translated to GraphQL Schemas by handler-->A111
B21--translated to GraphQL Schemas by handler-->A121
B31--translated to GraphQL Schemas by handler-->A311
```

The above GraphQL Mesh Gateway has 3 configured _Sources_:

1. The "City" _Source_ configured with the `@graphql-mesh/openapi` _Handler_.
2. The "Population" _Source_ configured with the `@graphql-mesh/graphql` _Handler_.
3. The "Weather" _Source_ configured with the `@graphql-mesh/raml` _Handler_.

_Sources_, _Handlers_, _Transforms_ are configured in a `.mesh.yaml` (or `.json`, `.js`, `.ts`)
configuration file that defines:

- How to fetch the definition of the sub-services (GraphQL API, REST API, and more)
- What transformations should be applied to the unified schema (_optional_)
- The path to the declaration of custom resolvers (_optional_)
- Which cache strategy should be used? (_optional_)
- Which envelop plugins should be loaded and configured at the server level? (_optional_)

Let's have a closer look to a `.mesh.yaml` configuration file by
[installing Mesh](/docs/getting-started/installation) and
[building our first Gateway](/docs/getting-started/your-first-mesh-gateway)!
