Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR Welcome for Store Import/Export? #221

Open
machineghost opened this issue Nov 8, 2019 · 3 comments
Open

PR Welcome for Store Import/Export? #221

machineghost opened this issue Nov 8, 2019 · 3 comments

Comments

@machineghost
Copy link

As per #220, this tool would be A LOT more valuable with a way ... any way ... to persist effort. A quick check of the code found that the entire client state is kept in a Redux store:

https://github.com/GraphQL-Designer/graphqldesigner.com/blob/master/client/store.js

If someone were to create a PR that:

  1. Added two new options to the right of "NEW PROJECT" and "EXPORT CODE" in the upper-left:
  • IMPORT STATE
  • EXPORT STATE
  1. onClick "EXPORT STATE" would serialize the current store (possibly filtering out state that doesn't need to persist), and display a modal with that state in JSON form
  2. onClick "IMPORT STATE" would prompt the user to paste in state JSON, and then would (essentially) reload the app and reinitialize the Redux store with that state (deserialized)

Obviously 1 and 2 should be pretty trivial, while 3 will require the most effort.

But before anyone does all that ... would you accept a PR that does the above?

@machineghost
Copy link
Author

machineghost commented Nov 8, 2019

P.S. A stretch goal would be:

  1. Add an option to save to localStorage instead of making people copy/paste JSON text

@sido420
Copy link

sido420 commented Jan 6, 2020

This is a must have feature.

@machineghost I am not familiar with Redux etc. Can you share your code to import and export state so I could at least modify local project and use this feature?

Thanks.

@machineghost
Copy link
Author

There is no code ... yet. I was just saying that hypothetically a basic implementation, like the one I described, seems very doable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants