Refine data fetching process when creating components with AI
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3548429. -->
Reported by: [kunal.sachdev](https://www.drupal.org/user/3685163)
Related to !128
>>>
<h3 id="overview">Overview</h3>
<p>While testing <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3542029" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3542029</a></span> we found that the data fetching doesn't work quite correctly for some custom fields in custom content types.<br>
Some problems found:</p>
<ol>
<li>While generating the code for content fetching it includes unnecessary fields in code<br>
<pre>queryString: new DrupalJsonApiParams()<br> .addInclude()</pre><p> instead it should only include the fields which are of type entity_reference </p></li>
<li>It assumes and tries find fields which are not even present in the content type</li>
<li> It tries to read the formatted text field as a string</li>
</ol>
<h3 id="proposed-resolution">Proposed resolution</h3>
<h3 id="ui-changes">User interface changes</h3>
issue