What is the difference between Mesh, Federation, Hasura, and GraphQL Tools?
GraphQL Mesh v0 documentation (superseded by v1): Learn about GraphQL Mesh - a configuration-based gateway solution that supports a wide range of sub-services and databases for a productive and maintainable unified schema.
As stated in the introduction page, many approaches exist to build a GraphQL Gateway:
- creating an Apollo Server with Apollo DataSource to query sub-services
- creating a GraphQL Gateway from scratch using
GraphQL tools (ex:
stitchSchemas()) - use Apollo Federation
- use Hasura on top of a Postgres with custom Actions
The comparison table below evaluates all those solutions based on 3 criteria:
- How is the solution helping you build Unified Schema Gateway in a productive and maintainable way?
- Is the solution provides all the features to build a well-designed Unified GraphQL Schema? (comprehensive, simplified abstraction of a set of sub-services)
- Which sub services types the solution supports?
| Productivity / Maintainability | Unified Schema design | Sub-services support | |
|---|---|---|---|
| GraphQL Mesh | ๐ข Packages with a server, caching, Envelop plugins, and large sub-service types support. Configuration-based with custom resolvers. | ๐ข Flexible Schema design with Transforms and custom resolvers support. | ๐ข Support for a large range of types of sub-service and databases. |
| GraphQL Tools | ๐ Programmatic approach at the Gateway level. Type merging makes it easier to deal with sub-services conflicts. | ๐ข Access to all GraphQL Schema building libraries. | ๐ Only supports GraphQL sub-services out of the box. Other sub-service types can be supported with Schema extensions at the Gateway level. |
| Apollo Server with DataSources | ๐ด Requires a lot of coding and maintenance work at the DataSources level. | ๐ข Access to all GraphQL Schema building libraries. | ๐ Integrating with some type of sub-services might require some extra work. |
| Apollo Federation | ๐ข Rover CLI and Apollo Studio. Only the Apollo Gateway needs maintenance. | ๐ข Access to all GraphQL Schema building libraries. | ๐ด Only supports โFederation compliantโ GraphQL sub-services. |
| Hasura | ๐ข Plug and play solution. Configuration-based with custom resolvers. | ๐ The Unified Schema is directly linked to the underlying database schema or sub-services design. | ๐ Only supports GraphQL and REST sub-services and, a set of databases. |