Skip to content

Commit ee59014

Browse files
authored
feat: allow getAuth to return a promise (#296)
https://www.apollographql.com/docs/link/links/context/
1 parent a64f183 commit ee59014

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graphql-client/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ export function createApolloClient ({
7272
}
7373

7474
// HTTP Auth header injection
75-
authLink = setContext((_, { headers }) => {
76-
const authorization = getAuth(tokenName)
75+
authLink = setContext(async (_, { headers }) => {
76+
const authorization = await getAuth(tokenName)
7777
const authorizationHeader = authorization ? { authorization } : {}
7878
return {
7979
headers: {

0 commit comments

Comments
 (0)