FetchLinks for rich text field only retrieves first paragraph

Hello Prismic Community,

I hope this message finds you well. I wanted to bring attention to an issue I've encountered regarding the Rich Text field within a Custom Type. Despite having allowed paragraphs and line breaks in my Prismic settings for the Rich Text field, I am facing difficulties when accessing the field data using fetchlink.

The problem is that the Rich Text field content, which may include paragraphs or new lines, is not being properly supported when retrieved through fetchlink. Even though paragraph formatting is permitted in the Prismic settings for this field, the data object received through fetchlink seems to ignore these line breaks.

I would appreciate any insights or assistance from the community to resolve this issue. Has anyone else encountered a similar problem, and are there any recommended solutions or workarounds?

Thank you for your time and assistance.


2 Likes

Hey @varsha.rana,

fetchLinks actually doesn't have full support for rich text. As per the docs:

fetchLinks can not retrieve the following fields:

  • Rich text (anything other than the first element)
  • Any field in a slice (only the slice zone)

I would recommend using GraphQuery for this use case.

Sam

1 Like

Hello Sam,

Thank you for your prompt response and valuable information. I appreciate your recommendation to use GraphQuery for handling rich text within a Custom Type. I will explore this approach and see how it addresses the challenges I've encountered.

Thanks,

Varsha

1 Like