graphql-playground icon indicating copy to clipboard operation
graphql-playground copied to clipboard

Export/Import of queries/mutations

Open marktani opened this issue 6 years ago • 12 comments

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.

marktani avatar Jul 26 '17 15:07 marktani

Could you elaborate a bit based on an example?

schickling avatar Aug 06 '17 16:08 schickling

I think maybe the idea would be able to dump and restore the playground as a json file.

tlvenn avatar Sep 28 '17 16:09 tlvenn

Yes, that's what I had in mind! 🙂

marktani avatar Sep 28 '17 16:09 marktani

So i am guessing this was never added?

ghost avatar Apr 13 '19 13:04 ghost

@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

ReallyVirtual avatar Jun 05 '19 01:06 ReallyVirtual

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.

j0nd0n7 avatar Feb 06 '20 13:02 j0nd0n7

This feature is needed, and the workaround @ReallyVirtual provided does not work due to https://github.com/graphql/graphql-playground/issues/797

ds-steven-matison avatar Nov 17 '20 18:11 ds-steven-matison

Share queries and mutations between the team, just restore and use later. As "Postman" GraphQL playground also must have it.

lasharela avatar Jan 25 '21 16:01 lasharela

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)

Artimunor avatar Nov 13 '21 07:11 Artimunor

I also would love to have this. This is the only thing keeping playground from falling short of postman.

aharris avatar Jun 18 '22 04:06 aharris

UP!

ahmadxgani avatar Dec 23 '22 07:12 ahmadxgani

You can do it also without plugin:

  1. Open developer console
  2. At the console, run: localStorage.getItem('graphql-playground')
  3. Copy the result (if it is too long, click first on "Show more" at the and)
  4. 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>)
  5. Reload, and all your playground tabs are there

mirkogeest avatar Feb 27 '23 09:02 mirkogeest