Akryum / Akryum/vue-cli-plugin-apollo
Why the type of the link property in ApolloClientConfig is string instead of ApolloLink
- Langage dominant
- JavaScript
- Étoiles
- 477
- Forks
- 109
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
### Question
Why the type of the link property in ApolloClientConfig is String instead of ApolloLink
### Description
I want to use my 'authMiddlewareLink' instead of the default link。
But I got these problems from VSCode
> Type 'ApolloLink' is not assignable to type 'string'.
### Code
```
const authMiddlewareLink = new ApolloLink((operation, forward) => {
const token = getUserToken();
const headers = token ? { 'API-TOKEN': token } : {};
operation.setContext({
headers,
});
return forward(operation);
});
export const { apolloClient } = createApolloClient({
link: authMiddlewareLink,
...defaultOptions,
});
```
### Version
0.21.3
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.