• Docs
  • Config Reference

Config Reference

Commonly, configuration file is named .meshrc.yaml and placed in the root of your project.

yml, json, .ts, .js and .cjs files are also supported.

sources

Mandatory field. Defines the list of your external data sources for your API mesh.

Acceptable external sources, with detailed specific configurations, available in the Handlers section.

transforms

Defines the list of manipulations to apply to the unified mesh schema.

Available transforms available in the Transforms section.

additionalTypeDefs

Additional type definitions, or type definitions overrides you wish to add to the schema mesh. Read more

additionalResolvers

Additional resolvers, or resolvers overrides you wish to add to the schema mesh. Read more

plugins

Extend the mesh schema's capabilities with additional plugins.

additionalEnvelopPlugins

Additional plugins from Envelop Ecosystem. Read more

cache

Configure the caching strategy for your unified schema.

serve

Mesh as a server configuration. Read more

Serve config reference:

  • fork - - Spawn multiple server instances as node clusters (default: 1) One of:
    • Int
    • Boolean
  • port - - TCP Port to listen (default: 4000) One of:
    • Int
    • String
  • hostname (type: String) - The binding hostname (default: localhost)
  • cors (type: Object) - Configuration for CORS:
    • origin (type: Any)
    • allowedHeaders (type: Array of String)
    • exposedHeaders (type: Array of String)
    • credentials (type: Boolean)
    • maxAge (type: Int)
    • preflightContinue (type: Boolean)
    • optionsSuccessStatus (type: Int)
  • staticFiles (type: String) - Path to your static files you want to be served with GraphQL Mesh HTTP Server
  • playground (type: Boolean) - Show GraphiQL Playground
  • sslCredentials (type: Object) - SSL Credentials for HTTPS Server If this is provided, Mesh will be served via HTTPS:
    • key (type: String, required)
    • cert (type: String, required)
  • endpoint (type: String) - Path to GraphQL Endpoint (default: /graphql)
  • browser - - Path to the browser that will be used by mesh serve to open a playground window in development mode This feature can be disabled by passing false One of:
    • String
    • Boolean
  • playgroundTitle (type: String) - Title of GraphiQL Playground
  • trustProxy (type: String) - Configure Express Proxy Handling Learn more

sdk

SDK generation configurations. Read more

SDK config reference:

  • generateOperations (type: Object) - Use this only if you don't want to use documents for SDK, and let Mesh generate them for you:
    • selectionSetDepth (type: Int)

documents

Provide a query or queries for GraphQL Playground, validation and SDK Generation. The value can be the file path, glob expression for the file paths or the SDL. .js, .jsx, .graphql, .gql, .ts and .tsx files are supported. Read more

customFetch

Path to a custom W3 Compatible Fetch Implementation. Example

logger

Logger instance that matches Console interface of NodeJS.

merger

Merge method. Either 'stitching', 'bare' or 'federation' are acceptable.

pubsub

PubSub Implementation.

skipSSLValidation

Allow connections to an SSL endpoint without certificates (type: Boolean).

codegen

GraphQL Code Generator Configuration. [Read more](/docs/guides/graphql-code-generator#customizing-the-graphql-code-generator-configuration

require

Loads specific require extensions before running the GraphQL Code Generator and reading the configuration.

Last updated on October 18, 2022