Certain fields can have more information inferred from them, such as if a field is part of a for loop, we can reasonably infer that it is of type Iterable for example.
Another example would be within a field that is iterated through, we don't currently generate types for the fields that would be attached to that field. E.g.
{% block post_grid %}
{% for post in posts %}
<div hx-get="{{ post.slug }}" class="bg-gradient-to-br from-gray-800/50 to-gray-900/50 rounded-2xl p-6 border border-gray-700/50 card-hover">
<div class="flex items-center space-x-2 mb-4">
<span class="bg-volt-yellow/10 text-volt-yellow text-xs font-semibold px-3 py-1 rounded-full">{{ post.category }}</span>
</div>
<h3 class="text-xl font-bold mb-3 hover:text-volt-yellow transition-colors cursor-pointer">
{{ post.title }}
</h3>
<p class="text-gray-300 mb-4">
{{ post.description }}
</p>
<div class="flex items-center justify-between text-sm text-gray-400">
<span>{{ post.date }}</span>
<span>{{ post.read_time }}</span>
</div>
</div>
{% endfor %}
{% endblock %}
This generates the type posts (which should be inferred as an Iterable), but none of slug, title, description, date or read_time are generated.
Certain fields can have more information inferred from them, such as if a field is part of a
forloop, we can reasonably infer that it is of typeIterablefor example.Another example would be within a field that is iterated through, we don't currently generate types for the fields that would be attached to that field. E.g.
{% block post_grid %} {% for post in posts %} <div hx-get="{{ post.slug }}" class="bg-gradient-to-br from-gray-800/50 to-gray-900/50 rounded-2xl p-6 border border-gray-700/50 card-hover"> <div class="flex items-center space-x-2 mb-4"> <span class="bg-volt-yellow/10 text-volt-yellow text-xs font-semibold px-3 py-1 rounded-full">{{ post.category }}</span> </div> <h3 class="text-xl font-bold mb-3 hover:text-volt-yellow transition-colors cursor-pointer"> {{ post.title }} </h3> <p class="text-gray-300 mb-4"> {{ post.description }} </p> <div class="flex items-center justify-between text-sm text-gray-400"> <span>{{ post.date }}</span> <span>{{ post.read_time }}</span> </div> </div> {% endfor %} {% endblock %}This generates the type
posts(which should be inferred as anIterable), but none ofslug,title,description,dateorread_timeare generated.