kontent-ai / delivery-sdk-js

Kontent Delivery SDK for Javascript
https://kontent.ai
MIT License
50 stars 34 forks source link

Do not remove the array of modular (linked) item codenames #78

Closed JanLenoch closed 6 years ago

JanLenoch commented 6 years ago

Motivation

The SDK uses rich text resolvers to transform modular (linked) item references found in rich text elements into HTML (or other output format). This is great but the SDK also removes the property that holds the array of codenames from the original response.

In Gatsby, the internal GraphQL store abstracts from presentation and the codenames of items is exactly what is needed to build the standard relationships among nodes. In order for the Gatsby source plugin to work, I have to refill the missing modular_content array from the debug part of the response.

Proposed solution

If possible, do not strip the modular_content array from the rich text element JavaScript objects.

Enngage commented 6 years ago

Available in https://www.npmjs.com/package/kentico-cloud-delivery/v/5.0.0-beta.6