Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spike: Consider creating a transformer plugin #19

Closed
JanLenoch opened this issue Oct 31, 2018 · 2 comments
Closed

Spike: Consider creating a transformer plugin #19

JanLenoch opened this issue Oct 31, 2018 · 2 comments
Labels
enhancement New feature or request groomed help wanted Extra attention is needed spike up-for-grabs

Comments

@JanLenoch
Copy link
Contributor

JanLenoch commented Oct 31, 2018

Expected result

The JS SDK allows the developer to define so called link resolvers and rich text resolvers. These are methods that operate on Kentico Cloud Rich text elements and produce HTML with hyperlinks and embedded content items.

The source plugin currently builds the _nodes sibling GraphQL properties that contain GraphQL links to content items in a given Rich text element. It also lacks the support for creating (or enriching) the _nodes sibling property based on links. It doesn't do any transformation of the rich text element HTML data.

Such a transformation should be dealt with separately using a Gatsby transformer plugin.

Find out:

  • what it takes to create a transformer plugin that transforms links and content items in Rich text
  • if the resolvers could be written by developers using the same notation as the JS SDK uses

Also, Gatsby have recently updated their best practice and recommend doing any "enhancement" of source nodes via a transformer plugin (not through a source plugin).

Therefore, consider moving the code that creates the _nodes sibling properties into the new transformer plugin.

Resources

@Simply007
Copy link
Contributor

Just adding showcase, how does the resolution looks like:

links: object containing properties by its ID
modular content: an array with id'S for the items

  • image
  • image

@JanLenoch JanLenoch self-assigned this Dec 31, 2018
@JanLenoch JanLenoch removed their assignment Jan 9, 2019
@Simply007
Copy link
Contributor

Simply007 commented Feb 25, 2019

This feature is already implemented in v3 and described in Readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request groomed help wanted Extra attention is needed spike up-for-grabs
Projects
No open projects
Prioritization
  
Priority
Development

No branches or pull requests

2 participants