The order of columns returned by this GraphQL query might not be what you think v2

Hi developers,

This is an aditional comment for original post “The order of columns returned by this GraphQL query might not be what you think” published by basdebruin at august’2020, but that thread is actually closed and I can’t response in it.

An easiest way to obtain “columns_values” in the expected order is to fetch that field twice in the same query. Something like this:

image

This code genetares a conflict error due to use of differents arguments for fetching the same field, but by the oder hand, the warnig popup gives you the solution, the use of aliases.

image

Finally, to use aliases in queries, only is neccesary to prepend the ‘alias:’ to the fetched field in order to give it an unical reference…

image

The result is not only that the fields have the same order as in the query, but also they have an alias for json parsing tasks

I attach some pictures using real data of my boards.

1 Like

Hey @TexlaRenovables :wave:

What a powerful intro to the community! Thanks so much for sharing this with us, and cross-referencing a post where this could have been helpful as well. I really appreciate your help here and this solution seems really cool too :slight_smile:

Again, thanks so much for sharing your knowledge here. I hope you enjoy your stay with us!

-Alex