graphql-playground
graphql-playground copied to clipboard
Export/Import of queries/mutations
Would be cool to have a format for exporting/importing queries and mutations. This way you could easily get started on an existing project, or work on the same project from different machines.
Could you elaborate a bit based on an example?
I think maybe the idea would be able to dump and restore the playground as a json file.
Yes, that's what I had in mind! 🙂
So i am guessing this was never added?
@MooreDevelopment @marktani I had to switch to a Linux VM from the Windows host and didn't want to recreate the dozens of tabs in the playground, so here's what I ended up doing (and you can do too):
- Install the Chrome LocalStorage Manager extension from https://chrome.google.com/webstore/detail/localstorage-manager/fkhoimdhngkiicbjobkinobjkoefhkap/related
- Export the Local Storage object from the playground ("graphql-playground" ...) to a file
- Copy the file over to the destination
- Copy the file contents to clipboard
- Use the Import option in the Chrome extension
- Refresh the playground to see your restored tabs
Missing this feature too. It would act as the Postman collections, which are a very useful to share a getting started toolkit for an API.
This feature is needed, and the workaround @ReallyVirtual provided does not work due to https://github.com/graphql/graphql-playground/issues/797
Share queries and mutations between the team, just restore and use later. As "Postman" GraphQL playground also must have it.
What is the status of this? It would be really helpful (Switching from windows to macbook, and don't want to install chrome with browser sync there)
I also would love to have this. This is the only thing keeping playground from falling short of postman.
UP!
You can do it also without plugin:
- Open developer console
- At the console, run:
localStorage.getItem('graphql-playground')
- Copy the result (if it is too long, click first on "Show more" at the and)
- At the destination, at the playground page, open the developer console -> console, and write
localStorage.setItem('graphql-playground', <paste here the result from step 3>)
- Reload, and all your playground tabs are there