daddy/backend/config/seed.js

33 lines
544 B
JavaScript
Raw Normal View History

// Voir https://supergraph.dev/docs/seed
2020-06-15 14:58:59 +02:00
var users = [
{
full_name: 'Admin',
email: 'admin@cadoles.com',
role: 'admin',
},
{
full_name: 'User 1',
email: 'user1@cadoles.com',
role: 'user',
},
{
full_name: 'User 2',
email: 'user2@cadoles.com',
role: 'user',
},
{
full_name: 'User 3',
email: 'user3@cadoles.com',
role: 'user',
}
];
2020-06-15 14:58:59 +02:00
for (var user, i = 0; (user = users[i]); i++) {
var res = graphql(" \
2020-06-15 14:58:59 +02:00
mutation { \
user(insert: $data) { \
id \
} \
}", { data: user });
2020-06-15 14:58:59 +02:00
}