mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Add the remaining seeds
This commit is contained in:
parent
859b2b8779
commit
ab78785a43
@ -4,7 +4,8 @@ import helper from '../seed-helpers'
|
|||||||
const seed = {
|
const seed = {
|
||||||
Badges: require('./badges.js').default,
|
Badges: require('./badges.js').default,
|
||||||
User: require('./users.js').default,
|
User: require('./users.js').default,
|
||||||
UserBadges: require('./users-badges.js').default
|
UserBadges: require('./users-badges.js').default,
|
||||||
|
Miscellaneous: require('./miscellaneous.js').default
|
||||||
};
|
};
|
||||||
|
|
||||||
let data = {}
|
let data = {}
|
||||||
|
|||||||
@ -1,86 +1,11 @@
|
|||||||
import faker from 'faker'
|
import faker from 'faker'
|
||||||
|
|
||||||
export default `
|
export default () => {
|
||||||
mutation {
|
return `mutation {
|
||||||
|
|
||||||
# Users
|
|
||||||
u1: CreateUser(
|
|
||||||
id: "u1",
|
|
||||||
name: "Peter Lustig",
|
|
||||||
password: "1234",
|
|
||||||
email: "admin@example.org",
|
|
||||||
avatar: "${faker.internet.avatar()}",
|
|
||||||
role: admin,
|
|
||||||
disabled: false,
|
|
||||||
deleted: false) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
email
|
|
||||||
avatar
|
|
||||||
role
|
|
||||||
}
|
|
||||||
u2: CreateUser(
|
|
||||||
id: "u2",
|
|
||||||
name: "Bob der Bausmeister",
|
|
||||||
password: "1234",
|
|
||||||
email: "moderator@example.org",
|
|
||||||
avatar: "${faker.internet.avatar()}",
|
|
||||||
role: moderator,
|
|
||||||
disabled: false,
|
|
||||||
deleted: false) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
email
|
|
||||||
avatar
|
|
||||||
role
|
|
||||||
}
|
|
||||||
u3: CreateUser(
|
|
||||||
id: "u3",
|
|
||||||
name: "Jenny Rostock",
|
|
||||||
password: "1234",
|
|
||||||
email: "user@example.org",
|
|
||||||
avatar: "${faker.internet.avatar()}",
|
|
||||||
role: user,
|
|
||||||
disabled: false,
|
|
||||||
deleted: false) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
email
|
|
||||||
avatar
|
|
||||||
role
|
|
||||||
}
|
|
||||||
u4: CreateUser(
|
|
||||||
id: "u4",
|
|
||||||
name: "Angie Banjie",
|
|
||||||
password: "1234",
|
|
||||||
email: "angie@example.org",
|
|
||||||
avatar: "${faker.internet.avatar()}",
|
|
||||||
role: user,
|
|
||||||
disabled: false,
|
|
||||||
deleted: false) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
email
|
|
||||||
avatar
|
|
||||||
role
|
|
||||||
}
|
|
||||||
|
|
||||||
u1_blacklist_u4: AddUserBlacklisted(from: { id: "u1" }, to: { id: "u4" }) { from { id } }
|
u1_blacklist_u4: AddUserBlacklisted(from: { id: "u1" }, to: { id: "u4" }) { from { id } }
|
||||||
|
|
||||||
# Badges
|
|
||||||
b1: CreateBadge(id: "b1", key: "indiegogo_en_racoon", type: crowdfunding, status: permanent, icon: "http://localhost:3000/img/badges/indiegogo_en_racoon.svg") { id }
|
|
||||||
b2: CreateBadge(id: "b2", key: "indiegogo_en_rabbit", type: crowdfunding, status: permanent, icon: "http://localhost:3000/img/badges/indiegogo_en_rabbit.svg") { id }
|
|
||||||
b3: CreateBadge(id: "b3", key: "indiegogo_en_wolf", type: crowdfunding, status: permanent, icon: "http://localhost:3000/img/badges/indiegogo_en_wolf.svg") { id }
|
|
||||||
b4: CreateBadge(id: "b4", key: "indiegogo_en_bear", type: crowdfunding, status: permanent, icon: "http://localhost:3000/img/badges/indiegogo_en_bear.svg") { id }
|
|
||||||
b5: CreateBadge(id: "b5", key: "indiegogo_en_turtle", type: crowdfunding, status: permanent, icon: "http://localhost:3000/img/badges/indiegogo_en_turtle.svg") { id }
|
|
||||||
b6: CreateBadge(id: "b6", key: "indiegogo_en_rhino", type: crowdfunding, status: permanent, icon: "http://localhost:3000/img/badges/indiegogo_en_rhino.svg") { id }
|
|
||||||
|
|
||||||
b1_u1: AddUserBadges(from: {id: "b1"}, to: {id: "u1"}) { from { id } }
|
|
||||||
b2_u1: AddUserBadges(from: {id: "b2"}, to: {id: "u1"}) { from { id } }
|
|
||||||
b3_u1: AddUserBadges(from: {id: "b3"}, to: {id: "u1"}) { from { id } }
|
|
||||||
b6_u2: AddUserBadges(from: {id: "b6"}, to: {id: "u2"}) { from { id } }
|
|
||||||
b3_u3: AddUserBadges(from: {id: "b3"}, to: {id: "u3"}) { from { id } }
|
|
||||||
b5_u4: AddUserBadges(from: {id: "b5"}, to: {id: "u4"}) { from { id } }
|
|
||||||
|
|
||||||
# categories
|
# categories
|
||||||
cat1: CreateCategory( id: "cat1", name: "Just For Fun", slug: "justforfun", icon: "categories-justforfun" ) { name }
|
cat1: CreateCategory( id: "cat1", name: "Just For Fun", slug: "justforfun", icon: "categories-justforfun" ) { name }
|
||||||
@ -418,3 +343,4 @@ export default `
|
|||||||
) { from { id } }
|
) { from { id } }
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
}
|
||||||
@ -1,7 +1,6 @@
|
|||||||
import ApolloClient from "apollo-client";
|
import ApolloClient from "apollo-client";
|
||||||
import dotenv from "dotenv";
|
import dotenv from "dotenv";
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import seedMutations from "./seed-mutations";
|
|
||||||
import fetch from "node-fetch";
|
import fetch from "node-fetch";
|
||||||
import { HttpLink } from "apollo-link-http";
|
import { HttpLink } from "apollo-link-http";
|
||||||
import { InMemoryCache } from "apollo-cache-inmemory";
|
import { InMemoryCache } from "apollo-cache-inmemory";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user