super-graph/tmpl/seed.js

19 lines
272 B
JavaScript
Raw Permalink Normal View History

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