Contentful "short text list" ::: graphql

What’s the appropriate gql to access all items in a short text list? I can only manage to retrieve the first one.

And how can I pair two items in a list (i.e. allow content creators to input a link and the accompanying link text)?

Seems like it should be easy to find documentation for this but I’ve begun to weary of searching with no luck.


Hi @daniel.deverell, I have tried in an example space the following and the result (as you can see) it’s in array format. Maybe you could share the snippet of code or a screenshot, so that I could better help you with the issue.

For ‘paired’ items in a list, maybe the best option could be a RichText, so that the link and the text can be analysed as 2 ‘parts’ from your client application.

Thanks Alma! I was able to get the array of list items from the API and map over them. I am, however, a little surprised that the only way to create a two-part link and link text is via the Rich Text content type.

I would have thought that, given its ubiquity, such a construct would be possible without resorting to such an all purpose data type.

I see that on creation of Rich Text there is the option to limit the types available (H2, P, A etc.). I will try to create a pair using these limitations.

Thanks again!