Deleting a field in a model is not deleting related data from the content. The data is then still present in the API calls.
- Add 2+ fields to a model
- Populate an instance of that model so that all the fields have data
- Delete one of fields
- Check the api data and you will see that the data from that deleted field is still present.
Deleting a field from a model should also delete the relevant data from content that was using that field.
The content from the API still contains the data from the models which have since been deleted.
Yesterday, about 16-20 hours ago, I was experimenting and created:
- A list;
- 2 Boolean fields (not contained within this list);
These fields were nested in other models, the hierarchy being:
Data → List → Object
I populated some of the content items using these new fields. I decided to not use these fields and deleted them.
When I check the call on my side, the items are still present. I’ve cleared cache and public folders, and restarted the server multiple times since yesterday.
Deleting an item is probably going to fix it in my current case. However, this is not a good solution as a field could have assets or data that can not easily be reproduced. This can also lead to a lot of unnecessary data that is being pulled from the API which adds unneeded overhead to both my project as well as Builder.io’s API.
Here is a screenshot of an API call where I’ve pointed at the fields that should no longer be present and has been included for the sake of completion.