Akryum / Akryum/vue-cli-plugin-apollo

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

Đang mở
#590 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
477
Fork
109
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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`?

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.