mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
21 lines
531 B
JavaScript
21 lines
531 B
JavaScript
import ApolloClient from "apollo-client";
|
|
import dotenv from "dotenv";
|
|
import gql from 'graphql-tag'
|
|
import fetch from "node-fetch";
|
|
import { HttpLink } from "apollo-link-http";
|
|
import { InMemoryCache } from "apollo-cache-inmemory";
|
|
import Seed from './data/index'
|
|
|
|
dotenv.config();
|
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
throw new Error('YOU CAN`T SEED IN PRODUCTION MODE')
|
|
}
|
|
|
|
const client = new ApolloClient({
|
|
link: new HttpLink({ uri: process.env.GRAPHQL_URI, fetch }),
|
|
cache: new InMemoryCache()
|
|
});
|
|
|
|
Seed(client)
|