v0
Config Reference
⚠️
This is the documentation for the old GraphQL Mesh version v0. We recommend upgrading to the latest GraphQL Mesh version v1.

Migrate to GraphQL Mesh v1

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
  • batchingLimit (type: Int) - Enable and define a limit for Request Batching
  • healthCheckEndpoint (type: String) - Endpoint for Health Check
  • extraParamNames (type: Array of String) - By default, GraphQL Mesh does not allow parameters in the request body except query, variables, extensions, and operationName.

This option allows you to specify additional parameters that are allowed in the request body.

@default []

@example [‘doc_id’, ‘id’]

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

require

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