super-graph/tmpl/seed.js
2019-09-29 15:20:59 -04:00

19 lines
272 B
JavaScript

// Example script to seed database
var users = [];
for (i = 0; i < 10; i++) {
var data = {
full_name: fake.name(),
email: fake.email()
}
var res = graphql(" \
mutation { \
user(insert: $data) { \
id \
} \
}", { data: data })
users.push(res.user)
}