-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat(multiple clients): add ability to define multiple clients #13
Conversation
Thanks @samturrell, I can't review it at the moment but will jump on it as soon as I can. Also, as many people only use one endpoint, couldn't we just e.g: With one client: const countries = await $graphql.request(countriesQuery, variables); With multiple clients: const countries = await $graphql.default.request(countriesQuery, variables);
const planets = await $graphql.planets.request(query); |
Great idea to have the one client and multiple client approaches. |
@Gomah I thought about doing the same, but didn't want to make the API too confusing. Would also be a pain to upgrade in the future if users decide they need another endpoint, they would have to go through every request and update. Happy to implement though if that's how you'd prefer it! |
@Gomah any updates on this? |
Hey @samturrell, sorry I was away. I will try to have a look in the next coming weeks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @samturrell,
Sorry for the delay, I just added a few comments before I can merge this one!
I'll make sure the docs are up to date with your changes & adjust the types
…emove clients output
…emove clients output
…-graphql-request into feature/multiple-clients # Conflicts: # README.md
@Gomah - I've amended in line with most of your comments. Let me know next steps whenever you can. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @samturrell! Will merge this to develop
& work on the docs + types before the release!
Adds the ability to define multiple clients.
Builds on top of #12 with its runtime config functionality.