@contentstack/utils
Version:
Contentstack utilities for Javascript
11 lines (10 loc) • 540 B
TypeScript
/**
* Updates asset URLs in a GraphQL response in-place. Walks the response data,
* finds RTE fields that have `embedded_itemsConnection`, and sets each
* embedded asset's `asset-link` attribute in the JSON to the asset's `url`
* from the response. Use after fetching content via GraphQL so RTE JSON
* contains correct asset URLs for rendering.
*
* @param gqlResponse - The raw GraphQL response object (e.g. `{ data: { ... } }`). Modified in place.
*/
export declare function updateAssetURLForGQL(gqlResponse: any): void;