Akryum / Akryum/vue-cli-plugin-apollo

Change endpoints after client created?

Offen
#302 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

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.

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.