The mutation request works but delete all existing ones. So I’m just able to add one entry and unfortunately delete all existing ones. How can I just add new dynamic components to a collection type. Also how I can delete a specific component of a collection type. I searched the trough the internet but didn’t find a suitable answer. Hope you guys can help me.
When adding a new one, you will need to include the old ones as well (else how would you delete one? )
As you figured out, to delete you just need to omit the entry from the mutation or simply provide an empty array if you need to delete the last one in the array.
Thanks for your advice. I already thought that would be the way to achieve what I want. I know it’s not a strapi specific request but how can I get an array as a variable for graphql? Like to achieve what you suggested.
I will now fetch the data and transfer it into the variables. Now when I like to add something to a dynamic zone, I will take all data and add new data on top. Bring all together in the variables and mutate it. Bam! If I like to delete a specific one I will remove it from the fetched data and mutate it again.