mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 20:49:02 +00:00
22 lines
563 B
JavaScript
22 lines
563 B
JavaScript
import ApolloClient from "apollo-client";
|
|
import gql from "graphql-tag";
|
|
import dotenv from "dotenv";
|
|
import seedmutations from "./seed-mutations";
|
|
import fetch from "node-fetch";
|
|
import { HttpLink } from "apollo-link-http";
|
|
import { InMemoryCache } from "apollo-cache-inmemory";
|
|
|
|
dotenv.config();
|
|
|
|
const client = new ApolloClient({
|
|
link: new HttpLink({ uri: process.env.GRAPHQL_URI, fetch }),
|
|
cache: new InMemoryCache()
|
|
});
|
|
|
|
client
|
|
.mutate({
|
|
mutation: gql(seedmutations)
|
|
})
|
|
.then(data => console.log(data))
|
|
.catch(error => console.error(error));
|