Akryum / Akryum/vue-cli-plugin-apollo

Change endpoints after client created?

Đang mở
#302 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ả

Hi, I create a new client like:
```
const { apolloClient, wsClient } = createApolloClient({
httpEndpoint: clientdata.httpEndpoint,
wsEndpoint: clientdata.wsEndpoint,
websocketsOnly: clientdata.websocketsOnly
})
apolloClient.wsClient = wsClient
```

I want the clientdata to be changeable, so a user can edit endpoint data in the interface. I cannot work out how to do this. Is this possible?

I'm currently trying to delete the entire client and recreate it with partial success (it doesn't delete any smart queries/subscription created so they keep failing in the background, cannot work out how to delete them):
```
delete this.$apollo.provider.clients[apiData.key]
this.createClient(apiData.key, apiData)
```
Where are the old queries/subscriptions held? They're not in $apollo.queries or $apollo.subscriptions.

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.