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

Consider not mutating client #28

Closed
aeruhxi opened this issue Jul 4, 2018 · 1 comment
Closed

Consider not mutating client #28

aeruhxi opened this issue Jul 4, 2018 · 1 comment
Labels
⚠️ duplicate This issue or pull request already exists

Comments

@aeruhxi
Copy link

aeruhxi commented Jul 4, 2018

Problem

I think the way client is being initialized by mutating global variable inside the library is bad and confusing, and will eventually bite someone. I recently, out of habit of making everything final, made the client final and wasted time figuring out what was wrong.

Proposed Solution

Let users create their own client and add methods like query and mutation in it like Apollo Client does. Also let the user specify token in the constructor itself instead of setting it later.

@HofmannZ HofmannZ added the ⚠️ duplicate This issue or pull request already exists label Jul 5, 2018
@HofmannZ
Copy link
Member

HofmannZ commented Jul 5, 2018

There is already a PR open implementing it #24, based on this issue #16.

@HofmannZ HofmannZ closed this as completed Jul 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠️ duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants