Hi! I've got a Model where the Records' urls are based on a "Single link" field (called category) as well as the slug field, so for example I'm trying to do:
case 'article':
return `/${item.attributes.category.slug}/all/${item.attributes.slug}`;
Unfortunately, item.attributes.category seems to return the category ID rather than the object, so I can't access the category's slug.
Is there a workaround for this? I can't think of a way to get the article category slug here, other than by performing a GraphQL query in my preview-links endpoint which doesn't feel optimal.
Hi! I've got a Model where the Records' urls are based on a "Single link" field (called
category
) as well as the slug field, so for example I'm trying to do:Unfortunately,
item.attributes.category
seems to return the category ID rather than the object, so I can't access the category's slug.Is there a workaround for this? I can't think of a way to get the article category slug here, other than by performing a GraphQL query in my preview-links endpoint which doesn't feel optimal.
Thanks in advance!