Creates duplicate columns when changing values (GQL)
Description When using GQL and updating the values on a column field it creates a duplicate item in GQL in columns array. It does not create or show up in CMS just in the GQL query columns result.
Steps to reproduce
- Create a value.
- Update value.
- Duplicate appears.
Additional info
- Plugin version: dev-craft-4 as 4.0.1
- Craft version: 4.0.4
- Multi-site: Yes
Additional context
Can you please provide the mutation query you're using?
We do not use GQL to update/create the table. This happens when we are grabbing the table info from the CMS with GQL.
Ah okay, you just state "when changing values" and in your reproduction steps you state "create a value, update a value" - what value? A column in the field? A row? Or updating an other field in the entry that isn't a Table Maker field?
I can't seem to replicate this.


It happens when you for example update the width on the table columns. Write in 30%. Save and load the page. Then go back and change it to 100%. When I do this it creates a duplicate of the column.
Thanks for confirming. I've tested that and making all sorts of changes including adding/removing new columns, changing names, widths, alignments, but everything appear to be behaving. Can you provide a screenshot of the response in the GraphiQL explorer?
The duplicate column does not show up in the GQL explorer but it does show up in the frontend and when using a console.log on the query data. I recreated it again now by changing width 3 times in short succession. After that duplicates will be created on each item you update.
Hmm, shouldn't the result be the identical? It's all the same querying mechanism. It wouldn't have anything to do with local caching on the client-side or anything (if that's something in your project)?
Can you send through a screenshot from your front-end, showing the raw payload data as a network request from the GQL endpoint to illustrate? Just to see what sort of duplicate response looks like.
Screenshot-1
Screenshot-2

Here you can see the first query. It shows and array of 6 items. This is correct. On the second query after changing the width on the first column, there are now 7 items, and the column is created again at the end of the array.
There are still only 6 columns in the CMS.
Certainly seems like some form of cache or something getting mismatched with that changes data. How're you querying this data from the front end? This doesn't seem to be a GQL query format I'm familiar with (Apollo), which I've just tried out without being able to replicate your results. Strange.