Skip to content

Commit

Permalink
Allow apollo-boost to support headers and credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
Ray Zane committed Mar 1, 2018
1 parent eb78ab9 commit 69617bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/apollo-boost/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### vNext
- Map coverage to original source
- Allow instantiating the client with `headers` and `credentials`.

### 0.1.0
- DEPRECATED: `apollo-client-preset`
Expand Down
5 changes: 4 additions & 1 deletion packages/apollo-boost/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export { gql, InMemoryCache, HttpLink };
export interface PresetConfig {
request?: (operation: Operation) => Promise<void>;
uri?: string;
credentials?: string;
headers?: any;
fetchOptions?: HttpLink.Options;
clientState?: ClientStateConfig;
onError?: ErrorLink.ErrorHandler;
Expand Down Expand Up @@ -76,7 +78,8 @@ export default class DefaultClient<TCache> extends ApolloClient<TCache> {
const httpLink = new HttpLink({
uri: (config && config.uri) || '/graphql',
fetchOptions: (config && config.fetchOptions) || {},
credentials: 'same-origin',
credentials: (config && config.credentials) || 'same-origin',
headers: (config && config.headers) || {},
});

const link = ApolloLink.from([
Expand Down

0 comments on commit 69617bc

Please sign in to comment.