Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
maka-io authored May 23, 2019
1 parent 62dd1b7 commit 55ede82
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
AUTH_TOKEN_KEY,
} from '../constants';

export function initialize(config = {}) {
export function initialize(config = { httpLinkOptions: {} }) {
Object.assign(Config, config);
Object.freeze(Config);

Expand All @@ -36,13 +36,11 @@ export function initialize(config = {}) {
let terminatingLink;

// Allow GRAPHQL_ENDPOINT to be changed
if (config.httpLinkOptions && !config.httpLinkOptions.uri) {
config.httpLinkOptions.uri = GRAPHQL_ENDPOINT;
}
config.httpLinkOptions.uri = (config.httpLinkOptions.uri) ? config.httpLinkOptions.uri : GRAPHQL_ENDPOINT;

// We define the HTTP Link
const httpLink = new HttpLink({
...(config.httpLinkOptions || {}),
...(config.httpLinkOptions),
});

if (meteorAccountsLink) {
Expand Down

0 comments on commit 55ede82

Please sign in to comment.