How can I export GraphQL API query results in i.e. Excel as a CSV?

Is there an easy way to export the data received so it can be used in Excel?

Thank you in advance!

2 Likes

Unfortunately, not really. CSV is designed for tabular data, in other words it is designed for data formatted as columns and rows. JSON, the kind of data that GraphQL returns, is designed for hierarchical data, in other words it is designed for data formatted as a set of hierarchical, nested objects.

If you formatted your query very specifically, to only return flat rows, or if you post-processed the information you received to turn it from hierarchical data to tabular data, then you could convert it to CSV. But there’s no simple way to take the result of any GraphQL query and convert it to CSV.

I hope that helps. Let us know if you have more questions.

1 Like

Awesome online tool to convert GraphQL JSON to CSV:
https://konklone.io/json/

2 Likes

Just following up on this thread to reiterate that @lee-dohm’s post is accurate to what’s available within the GitHub platform itself.

Though I do love @commonsensej’s suggested conversion tool! However, there is some concern there about potentially converting sensitive data. Which furthers the need to an official GitHub offering for JSON >> CSV formatting.

If anyone has this need and would like to see this built into GitHub itself, I strongly recommend submitting your suggestion via our feedback form, here:

:bow: