Skip to content

Commit 11a475b

Browse files
committed
feature: add accesstoken in connection params
1 parent 075ebb1 commit 11a475b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/apollo.client.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,16 @@ export const createApolloClient = (httpUrl: string) => {
2929
},
3030
};
3131
});
32+
var accessToken = localStorage.getItem(ACCESS_TOKEN_KEY);
3233

3334
const wsLink = new GraphQLWsLink(
3435
createClient({
3536
url: wsUrl,
37+
connectionParams: accessToken
38+
? {
39+
authToken: accessToken,
40+
}
41+
: {},
3642
})
3743
);
3844

0 commit comments

Comments
 (0)