Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Clients for later initiation #303

Merged
merged 1 commit into from
Feb 14, 2021

Conversation

BradenM
Copy link
Contributor

@BradenM BradenM commented Jan 18, 2021

This PR exposes gqlHttpClient and gqlWsClient by moving them to MSTGQLStore's volatile state and providing setter actions.

This is so either client can be initiated / changed at a later time instead of being de-referenced from the mst env.

Personally needed this because my env had an initial state that defined gqlWsClient as null and later initiated it when it could be provided with an authentication token. But, since the current behavior de-references the clients, reassigning it from my env would not propagate to mst-gql and it would throw an error.

@beepsoft
Copy link
Collaborator

This is really great, I've also had problems reconfiguring clients - especially the WS client - when authentication changes. @chrisdrackett can you please take a look at this?

@chrisdrackett
Copy link
Collaborator

@beepsoft I'm probably not going to be able to get to looking at this as we're no longer using this library and my free time is extremely limited (#302)

@jesse-savary
Copy link
Member

Looks good, thanks a lot @BradenM

@jesse-savary jesse-savary merged commit ca01ec7 into mobxjs:main Feb 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants