Ts issue with contentrelationship fields

Describe your question/issue in detail

I'm having issues with typescript when using contentrelationship fields when I wan to use them like following:

      <div class="container">
        <div class="grid">
          <h2>{{ item.category.data.title }}</h2>
        </div>
        <div
          v-if="isFilled.contentRelationship(item.category)"
          class="grid"
        >
          <h2>{{ item.category.data.title }}</h2>
        </div>
      </div>

first error is because it could be an empty relationship field:

so I tried to fix that by using isFilled.contentRelationship, but then I get another error that I don't know how to fix/type:

would love to hear ideas how to fix that because I don't want to add every single time, feels hacky

Hi @jankohlbach,

We've discussed this previously here and you'll find the solution in that thread :slight_smile:

Thanks.

1 Like

hey, that works, amazing
just couldn't find that haha
but feels way better than adding the comments everywhere :pinched_fingers:t3:

2 Likes