Skip to content
New issue

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

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

Already on GitHub? # to your account

feat: set endpoint after the GraphQLClient has been initialized #291

Merged
merged 4 commits into from
Oct 12, 2021

Conversation

tianqiwuben
Copy link
Contributor

This PR is requesting to support set endpoint after the GraphQLClient has been initialized.

One use case is the Redux RTK-query. The client needs to get initialized before the Redux store is configured, however if the endpoint is based on user-input, or comes from an async process, the endpoint needs to get updated accordingly, similar to setHeader.

Ref: https://www.graphql-code-generator.com/docs/plugins/typescript-rtk-query

Copy link
Member

@jasonkuhrt jasonkuhrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test and then we can ship this.

@tianqiwuben
Copy link
Contributor Author

Please add a test and then we can ship this.

Test added. Thanks.

@jasonkuhrt jasonkuhrt changed the title Support set endpoint after the GraphQLClient has been initialized feat: set endpoint after the GraphQLClient has been initialized Oct 6, 2021
Copy link
Member

@jasonkuhrt jasonkuhrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jasonkuhrt jasonkuhrt merged commit 87ec21b into graffle-js:master Oct 12, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants