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

Issues with typescript declarations #8

Closed
JameeKim opened this issue Aug 30, 2018 · 2 comments
Closed

Issues with typescript declarations #8

JameeKim opened this issue Aug 30, 2018 · 2 comments

Comments

@JameeKim
Copy link
Contributor

I was looking for a simple graphql client library and chose this one, and tried to use it in my typescript project. But even before I was able to setup the client instance, several problems stopped me.

  • All the interfaces are hidden (not exported), so I couldn't use them to declare types of my variables
  • As far as I understood by looking into the source code, not all properties in the interceptor objects are required, but the interface FetchQLInterceptor requires them all
  • The return types of the methods in the intercepter objects seem very odd; return Promise.reject(error) in the requestError does not work, even though the README has it as an example
  • There are some typos, like reueqstError in the interceptor or rejedct in the returned object of FetchQL instance methods (and now I realize they should return promises, I guess?)

If someone else can handle this then it is fine, but maybe I can fix some of the issues if that is needed. But I'm not sure if I will understand all underlying things going on in the source code. I also suggest adding typescript as a dev dependency and then testing if the type declarations enable users to successfully compile. Should I start working on this tomorrow? (It's late at night here so I need to go to bed)

@gucheen
Copy link
Owner

gucheen commented Sep 1, 2018

@JameeKim I've renewed the declaration file in v2.3.0. Please try the new version and check if the declaration file works well.

@gucheen
Copy link
Owner

gucheen commented Sep 1, 2018

PRs are welcome.

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

No branches or pull requests

2 participants