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.
How to use?
mesh.config.ts
import { createEncapsulateTransform, defineConfig, loadGraphQLHTTPSubgraph} from '@graphql-mesh/compose-cli'export const composeConfig = defineConfig({ subgraphs: [ { sourceHandler: loadGraphQLHTTPSubgraph('mySchema', { endpoint: 'http://localhost:4001/my-schema' }), transforms: [ createEncapsulateTransform({ applyTo: { // This will apply the encapsulate transform only to query fields query: true, mutation: false, subscription: false } }) ] } ]})
This site uses cookies for analytics and improving your experience.