• Docs
  • Transforms
  • Naming Convention

Naming Convention Transform

The naming-convention transform allows applying naming convention to GraphQL types and GraphQL fields easily.

yarn add @graphql-mesh/transform-naming-convention

How to use?

Add the following configuration to your Mesh config file:

transforms:
  - namingConvention:
      mode: bare | wrap
      typeNames: pascalCase
      enumValues: upperCase
      fieldNames: camelCase
      fieldArgumentNames: camelCase
💡

For information about "bare" and "wrap" modes, please read the dedicated section.

💡

You can see our gRPC example that uses this transform to see its application. Click here to open the example on GitHub.

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))
Last updated on September 14, 2022