datocms / plugins

Repository providing samples using the Plugins SDK
MIT License
33 stars 47 forks source link

[Table Editor] GraphQL results order #60

Closed erik-seifert closed 2 years ago

erik-seifert commented 2 years ago

First: Nice plugin.

But when i change the table, row are sorted different.

Table in Editor

| Years | Chrome | Mozilla | Safari |

| 1995 | 100 | 150 | 200 |

Output: {Chrome: 100, Mozilla: 150, Safari: 200, Years: 1995}

erik-seifert commented 2 years ago

Could be there:

https://github.com/datocms/plugins/blob/master/table-editor/src/types.ts#L52

stefanoverna commented 2 years ago

The output is an hash, where order of properties is not guaranteed. Please use .columns to know the correct order to use!