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
pnpm add @graphql-mesh/transform-naming-convention
npm install @graphql-mesh/transform-naming-convention
How to use?#
Add the following configuration to your Mesh config file:
transforms:
- namingConvention:
typeNames: pascalCase
enumValues: upperCase
fieldNames: camelCase
fieldArgumentNames: camelCase
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#
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)
)