Akryum / Akryum/vue-cli-plugin-apollo
Why the type of the link property in ApolloClientConfig is string instead of ApolloLink
- Lenguaje dominante
- JavaScript
- Estrellas
- 477
- Forks
- 109
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
### 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
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.