Edit in GitHubLog an issue

replaceField transform

The replaceField transform is deprecated. If you attempt to create an edge mesh with the replaceField transform, your edge mesh will not progress past the provisioning status. Alternatively, you can use the following additonalResolvers method.

Replacing fields with additionalResolvers

Previously, the replaceField transform allowed you to replace the configuration properties of one field with another, hoisting field values from a subfield to its parent. This transform allowed you to clean up redundant queries or replace field types.

Since the replaceField transform is deprecated, you can achieve the same functionality by using additionalResolvers in your mesh configuration. The additionalResolvers property allows you to add custom resolvers to your mesh. These resolvers can replace fields, hoist values, or perform other custom logic.

The following example hoists the Adobe Commerce name field from the ProductInterface to the label field of ProductImage by adding the replace.js resolver to the mesh configuration.

Copied to your clipboard
{
"meshConfig": {
"sources": [
{
"name": "AdobeCommerce",
"handler": {
"graphql": {
"endpoint": "https://venia.magento.com/graphql"
}
},
}
]
"additionalResolvers": ["./replace.js"]
}
}
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.