naming-convention transform
naming-convention transforms allow you to apply casing and other conventions to your response. In the example below, enumValues fields are converted to uppercase, while fieldNames are converted to camel case to enforce consistency.
{
"meshConfig": {
"sources": [
{
"name": "PWA",
"handler": {
"graphql": {
"endpoint": "https://example2.com/graphql"
}
},
"transforms": [
{
"namingConvention": {
"enumValues": "upperCase",
"fieldNames": "camelCase"
}
}
]
}
]
},
}
Usage
The following example converts all of your fieldNames to lower case in the Adobe Commerce source:
{
"meshConfig": {
"sources": [
{
"name": "AdobeCommerce",
"transforms": [
{
"namingConvention": {
"fieldNames": "lowerCase"
}
}
],
"handler": {
"graphql": {
"endpoint": "https://venia.magento.com/graphql"
}
}
}
]
}
}
data-variant=info
data-slots=text
Config API Reference
data-variant=info
data-slots=text
The following case options should not be used because they violate the GraphQL spec. These options will likely be deprecated in the future.
capitalCasedotCaseheaderCasenoCaseparamCasepathCasesentenceCase
</p>
mode(type: String (bare|wrap)) - Specify to apply naming-convention transforms to bare schema or by wrapping original schematypeNames(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))