Encapsulate Transform
GraphQL Mesh v0 documentation (superseded by v1): Improve your GraphQL schema organization with encapsulate transform. Easily encapsulate a specific schema into a single field with GraphQL Mesh.
The encapsulate transform allows to easily encapsulate a specific schema into a single field under
the root type.
For instance, if your handler created a schema like this, named mySchema:
The encapsulate transform will change your schema to this:
This transformer is useful when you have multiple APIs in your Mesh Gateway and you wish to have it wrapped with a name to better understand where each field is coming from.
To get started with this transform, install it:
How to use?
Config API Reference
name(type:String) - Optional, name to use for grouping under the root types. If not specific, the API name is used.applyTo(type:Object) - Allow you to choose which root operations you would like to apply. By default, it’s applied to all root types.:query(type:Boolean)mutation(type:Boolean)subscription(type:Boolean)