0

I'm learning Relay and GraphQL with the Relay starter kit from Facebook. I want to create a simple storage for my data, basically just to keep my GraphQL mutations somewhere. I will deal with a proper ORM and database later.

Could I just dump the data as JSON into a flat file? How would I do this? (No need for concurrency, security and such, I'm still learning all of this.)

Thanks in advance!

user2983816
  • 113
  • 1
  • 6

1 Answers1

1

The simplest way is going to be to keep the objects in memory, as the starter kit example does.

So, yes, you could store it as a JSON file and require that if you wanted to.

Greg Hurrell
  • 5,177
  • 23
  • 27
  • Thank you! At what point would I insert the command to dump everything from memory to a file that I then require again? Sorry, I'm really new to this. :-/ – user2983816 Sep 23 '15 at 21:24