Disable routing package

This commit is contained in:
SachaG 2018-09-24 10:26:56 +09:00
parent 7b9da35b19
commit 4c500e856e
6 changed files with 37 additions and 13 deletions

View file

@ -1 +1,3 @@
export * from '../modules/index.js';
export * from './start.jsx';

View file

@ -12,7 +12,6 @@ Package.onUse(function (api) {
'vulcan:lib@1.12.8',
'vulcan:i18n@1.12.8',
'vulcan:users@1.12.8',
'vulcan:routing@1.12.8',
'vulcan:debug@1.12.8'
]);

View file

@ -1,12 +1,37 @@
import ApolloClient from "apollo-boost";
import { Accounts } from 'meteor/accounts-base'
import { ApolloClient } from 'apollo-client';
import { InMemoryCache } from 'apollo-cache-inmemory';
import { HttpLink } from 'apollo-link-http';
import { onError } from 'apollo-link-error';
import { ApolloLink } from 'apollo-link';
import WatchedMutationLink from 'apollo-link-watched-mutation';
import { MeteorAccountsLink } from 'meteor/apollo';
import { WatchedMutations } from '../modules/updates';
const cache = new InMemoryCache();
const watchedMutationLink = new WatchedMutationLink(cache, WatchedMutations);
const errorLink = onError(({ graphQLErrors, networkError }) => {
if (graphQLErrors)
graphQLErrors.map(({ message, locations, path }) =>
console.log(`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`)
);
if (networkError) console.log(`[Network error]: ${networkError}`);
});
const httpLink = new HttpLink({
uri: '/graphql',
credentials: 'same-origin',
});
const meteorAccountsLink = new MeteorAccountsLink();
export const apolloClient = new ApolloClient({
uri: '/graphql',
request: operation =>
operation.setContext(() => ({
headers: {
authorization: Accounts._storedLoginToken()
}
}))
})
link: ApolloLink.from([
watchedMutationLink,
errorLink,
meteorAccountsLink,
httpLink
]),
cache,
});

View file

@ -1 +0,0 @@
import './init';

View file

@ -1 +0,0 @@
// import './routing.jsx';