mirror of
https://github.com/vale981/Vulcan
synced 2025-03-05 17:41:43 -05:00
Disable routing package
This commit is contained in:
parent
7b9da35b19
commit
4c500e856e
6 changed files with 37 additions and 13 deletions
|
@ -1 +1,3 @@
|
|||
export * from '../modules/index.js';
|
||||
|
||||
export * from './start.jsx';
|
|
@ -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'
|
||||
]);
|
||||
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
import './init';
|
|
@ -1 +0,0 @@
|
|||
// import './routing.jsx';
|
Loading…
Add table
Reference in a new issue