On this page

Naming Convention Transform

GraphQL Mesh v0 documentation (superseded by v1): Transform the response of your GraphQL API with naming-convention. Apply casing and other conventions to your response with ease.

The naming-convention transforms allow you to apply casing and other conventions to your response.

Installation

npm i @graphql-mesh/transform-naming-convention

How to use?

Add the following configuration to your Mesh config file:

.meshrc.yaml
transforms:
  - namingConvention:
      mode: bare | wrap
      typeNames: pascalCase
      enumValues: upperCase
      fieldNames: camelCase
      fieldArgumentNames: camelCase

Config API Reference

  • mode (type: String (bare | wrap)) - Specify to apply naming-convention transforms to bare schema or by wrapping original schema
  • typeNames (type: String (camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase | upperCase | lowerCase))
  • fieldNames (type: String (camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase | upperCase | lowerCase))
  • enumValues (type: String (camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase | upperCase | lowerCase))
  • fieldArgumentNames (type: String (camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase | upperCase | lowerCase))