Open benhutton opened 1 week ago
What does the download CSV button do?
@imolorhe the Download CSV button comes from this plugin: https://altairgraphql.dev/docs/plugins/popular-plugins#altair-graphql-plugin-json-to-csv
It takes the json, uploads it to a third party service which returns CSV, and then stores that as a file on the file system.
The code is here: https://github.com/desiringgod/altair-graphql-plugin-json-to-csv/blob/master/index.js
Thanks. Looks like that plugin will need an update. I'll reach out.
This issue should be fixed. The issue in the plugin should be fixed by this PR https://github.com/desiringgod/altair-graphql-plugin-json-to-csv/pull/10.
Please can you verify?
@imolorhe thanks
Altair 7.2.1 fixes the rendering problem. I merged the PR for the plugin... remind me what I need to do beyond that to get the plugin to load. Specifying the version (github:altair-graphql-plugin-json-to-csv@1.03::[repo]->[desiringgod/altair-graphql-plugin-json-to-csv]
) does not seem to load the plugin, and if I don't specify the version, I think I get the old broken one. What am I missing?
The plugin should be using the latest version by now if you published the new version to npm (you can check the downloaded manifest.json file, etc)
@imolorhe okay... we haven't been doing that, and I can try to figure that out.
BUT, what about running it straight off of github? Shouldn't that be working?
@imolorhe okay thanks. I've got the plugin loaded and can see the queries in the network tab.
Unfortunately, things are still failing. I am wondering if the new queryResults
has newlines and spaces in it and the old one does not? Put another way, do you think the output of queryResults
would validate with something like https://jsonlint.com/ ?
I took a look at it locally. All queryResults
are strings now and not objects (to account for the variety of responses from the server) so you shouldn't JSON.stringify anymore
okay, I've got it fixed! Thanks!
Is there an existing issue for this?
Current Behavior
Queries with results longer than a certain length (I don't know what the length is) collapse the result into a single line that doesn't render properly. They render what looks like a single line of json. This then doesn't play nice with our "Download CSV" extension.
Expected Behavior
Queries of any length should render properly across multiple lines.
Steps To Reproduce
Run an introspection query like https://gist.github.com/benhutton/3df56090a754365f35b024fcb5f4cd08 against a large schema
(This happens with other long queries. Short queries render just fine.)
Environment
Additional context
No response