Reputation: 41
We have a site where users can explore a database, and we show visualizations and stuff. I'd like to be able to direct people to the graphql playground with specific queries, in case they want to download the raw JSON for further analysis, or to add things to the query to dig into the data in their own way.
It'd be cool if I could present them with a link to the playground, and pre-populate the query field with whatever I want. Is there a way to do that?
Upvotes: 2
Views: 399
Reputation: 539
Add ?query={encoded query}
to your url, where the encoded query
value is your graphql query, encoded. This will populate the query window on open.
Upvotes: 1