Skip to content

Commit

Permalink
feat: make sure both headers and connectionParams work (#116)
Browse files Browse the repository at this point in the history
* feat: seperate connectionParams from headers options for web socket

* feat: make sure both headers and connectionParams work

Co-authored-by: dennis <dennis@emmental.co.kr>
  • Loading branch information
beeman and dennis-zent committed Apr 17, 2020
1 parent 943aef0 commit 5269eb8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/kikstart-apollo-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface KikstartGraphQLClientConfig extends KikstartGraphQLLinkConfig {
wsOptions?: any;
cache?: any;
headers?: any;
connectionParams?: any;
log?: any;
// DEPRECATED to be removed in an upcoming major release
uri?: string;
Expand Down
6 changes: 3 additions & 3 deletions src/kikstart-graphql-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ export class GraphQLClient {
config.wsUrl,
{
...config.wsOptions,
connectionParams: {
headers: config.headers || {},
},
connectionParams: config.connectionParams
? config.connectionParams
: { headers: config.headers || {} },
reconnect: true,
},
ws,
Expand Down

0 comments on commit 5269eb8

Please sign in to comment.