jaydenseric / graphql-react

A GraphQL client for React using modern context and hooks APIs that is lightweight (< 4 kB) but powerful; the first Relay and Apollo alternative with server side rendering.
https://npm.im/graphql-react
MIT License
717 stars 22 forks source link

hello can you convert for native js? #40

Closed timeshift92 closed 4 years ago

jaydenseric commented 4 years ago

I'm not quite sure what you mean, exactly?

timeshift92 commented 4 years ago

I write my projects on svelte and would like to use your library but it is written only for react, is there any way to rewrite it under native js? If so, can you tell? I am ready to do it.

jaydenseric commented 4 years ago

The GraphQL class is a non-React specific GraphQL client, that could be useful for you :)

timeshift92 commented 4 years ago

cool thx =)

timeshift92 commented 4 years ago

Do you have any ideas on subscription?

jaydenseric commented 4 years ago

@timeshift92 GitHub issues are more for bugs than general conversation, but if you would like to keep up with subscriptions support you can subscribe to https://github.com/jaydenseric/graphql-react/issues/15.

Hypothetically a dedicated subscriptions client and React hook could be created, that would compliment the existing graphql-react API.

After a fair bit of dabbling, there are two main reasons I haven't shipped subscriptions support:

  1. I don't have a need for them, and there are a lot of engineering complexities that can be avoided just by polling.
  2. There is no standard GraphQL subscriptions WebSocket protocol. Apollo has made quite a few changes to their protocol, and it's not well documented.