Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creates duplicate columns when changing values (GQL) #31

Open
sanderWDale opened this issue Jul 1, 2022 · 9 comments
Open

Creates duplicate columns when changing values (GQL) #31

sanderWDale opened this issue Jul 1, 2022 · 9 comments

Comments

@sanderWDale
Copy link

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

  1. Create a value.
  2. Update value.
  3. Duplicate appears.

Additional info

  • Plugin version: dev-craft-4 as 4.0.1
  • Craft version: 4.0.4
  • Multi-site: Yes

Additional context

@engram-design
Copy link
Member

Can you please provide the mutation query you're using?

@sanderWDale
Copy link
Author

We do not use GQL to update/create the table. This happens when we are grabbing the table info from the CMS with GQL.

@engram-design
Copy link
Member

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.

CleanShot 2022-07-04 at 17 19 35

image

@sanderWDale
Copy link
Author

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.

@engram-design
Copy link
Member

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?

@sanderWDale
Copy link
Author

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.

@engram-design
Copy link
Member

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.

@sanderWDale
Copy link
Author

Screenshot-1
Screenshot-1
Screenshot-2
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.

@engram-design
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants