json-graphql-server
json-graphql-server copied to clipboard
Persistent Storage feature
Description
I have created new parameters to be able to store the data in a json file instead of being only in memory data With this new parameters we can :
- save the in memory data in the json file given in input
- create a copy of this json file at every action, this way we keep an history of the mutation and if we want to revert a change and come back to a previous version, we can replace the input file with the backup
- provide a directory where those copies will be saved
- add some logs
The parameters to use are:
- --persistent : enable the persistent feature that will save the in memory data in the json file
- --keep-change-history : enable a feature that will create a copy of the json file everytime there is an action
- --persistent-dir (string) : path where the data copy will be saved
- --verbose : to have some logs
Related Issue
I had the same need as the user in this ticket
https://github.com/marmelab/json-graphql-server/issues/96
I dont know if you will want to include it to your repo, but it might help other people :D
Best regards,