Keith Kelleher
Keith Kelleher

Reputation: 41

Is there a way to open the graphql playground with a specific query?

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

Answers (1)

MickJuice
MickJuice

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

Related Questions