RisingStack / graphql-server

Example GraphQL server with Mongoose (MongoDB) and Node.js
MIT License
846 stars 102 forks source link

seed data #5

Closed funkytek closed 9 years ago

funkytek commented 9 years ago

added a script to create seed data in db so example runs properly out of the box

hekike commented 9 years ago

@funkytek why don't you do just:


var users = [];

yield User.create(users);
process.exit(0);
funkytek commented 9 years ago

although it doesn't matter in this case, since we have docs that depend on previous docs, if we wanted to do more complex things referencing them we would need something like this. Updating to a batch create.

hekike commented 9 years ago

@funkytek thanks to participating in this! :ship:

funkytek commented 9 years ago

:ok_hand: