Edit in GitHubLog an issue

prefix transform

The prefix transform allows you to prefix GraphQL types and GraphQL root operations (under Query/Mutation). prefix is similar to rename in that it allows you to modify names to avoid conflicts, simplify complicated names, and change the appearance of your query. In contrast with rename, prefix is simpler and only allows you to append a prefix to the existing name.

You can use it to easily "namespace" APIs in your unified API and avoid conflicts.

Usage

The following example adds the commerce_ prefix to all Adobe Commerce source types:

Copied to your clipboard
{
"meshConfig": {
"sources": [
{
"name": "AdobeCommerce",
"transforms": [
{
"prefix": {
"mode": "wrap",
"value": "commerce_"
}
}
],
"handler": {
"graphql": {
"endpoint": "https://venia.magento.com/graphql"
}
}
}
]
}
}

Config API Reference

  • mode (type: String (bare | wrap)) - Specify to apply prefix transform to bare schema or by wrapping original schema
  • value (type: String) - The prefix to apply to the schema types. By default, the prefix is the API name.
  • ignore (type: Array of String, required) - List of ignored types
  • includeRootOperations (type: Boolean) - Changes root types and changes the field names (default: false)
  • includeTypes (type: Boolean) - Changes types (default: true)
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.