Ajout utilisateurs Cadoles dans les seeds

This commit is contained in:
wpetit 2020-06-21 11:30:59 +02:00
parent 6b1f56a86f
commit 569a44591c
1 changed files with 21 additions and 11 deletions

View File

@ -1,19 +1,29 @@
// Example script to seed database // Example script to seed database
var users = []; var users = [
{
full_name: 'William Petit',
email: 'wpetit@cadoles.com'
},
{
full_name: 'Teddy Cornaut',
email: 'tcornaut@cadoles.com'
},
{
full_name: 'Benjamin Gaudé',
email: 'bgaude@cadoles.com'
},
{
full_name: 'Charles Maxime Sassot',
email: 'cmsassot@cadoles.com'
}
];
for (i = 0; i < 10; i++) { for (var user, i = 0; (user = users[i]); i++) {
var data = { var res = graphql(" \
full_name: fake.name(),
email: fake.email()
}
var res = graphql(" \
mutation { \ mutation { \
user(insert: $data) { \ user(insert: $data) { \
id \ id \
} \ } \
}", { data: data }) }", { data: user });
users.push(res.user)
} }