I am developing an internal TypeScript library which needs to call a couple of GraphQL endpoints. The library is supposed be imported in front end projects, but it is not dependent on any specific framework (like angular or react).
I would like to be able to use a GraphQL library for GraphQL calls. I checked Apollo, but it brings react with it (which I don't need). In the graphql-js documentation, it states that it can be used in browser, at the same time they only provide code samples for server-side code.
So far, I am just making plain rest class, but I am interested in generating at least types automatically as it is inconvenient.
Q: How to use graphql-js in the client code? Or is there any other way to call graphql endpoints without having to import Apollo with react?
Any suggestion is appreciated.