Akryum / Akryum/vue-cli-plugin-apollo

'ApolloLink' is not assignable to type 'string' on ApolloClientClientConfig.link

Offen
#590 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
477
Forks
109
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I am unable to setup Apollo using the Vue CLI plugin, due to a typing error.

The following example will fail because `Type 'ApolloLink' is not assignable to type 'string'.`

```
const apolloClient = new ApolloClient({
link: httpLink,
cache,
})
```

I tracked this to `ApolloClientClientConfig` in `types.d.ts`, where `link` is defined as:
```
// Custom starting link.
// If you want to replace the default HttpLink, set `defaultHttpLink` to false
link?: string
```

Going by the comments, it seems that `link` was not intended to be `string` only.
Would it help if I created a pull request to change the type of `link` to `string | ApolloLink`?

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.