-
Notifications
You must be signed in to change notification settings - Fork 211
Feature request : provide custom Request module when generate resolver #268
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
Comments
@moyara I think it is possible to do this using the |
But then I have to write All resolvers to apply custom request per each endpoint. I am lookinf for more general way to solve this without maintaining like 100 apis. |
@moyara I think currently we are not looking to support a number of different request modules. However, if |
For some larger context, OtG currently depends on the request module for invoking the REST API, which was a common option when we started the project. Since then, that module has actually been put into maintenance mode only. So it may generally be a good thing to reconsider whether to use another option, ideally promise-based to allow for the convenient use of The specific question raised by this issue is whether users should be allowed to provide their own library instead of whichever one OtG depends on. I see two options to make that happen:
IMO, option 2 likely opens up a bunch of challenges and I see other issues more pressing at this point. Option one sounds more feasible to me, but: I would definitely not want to impede in any way with the ease-of-use OtG currently offers. I.e., removing |
Since cost of the bundle size for Node.js does not matter that much it will be possible to use default request-like api and then allow to override it. Currently in node and browser ecosystem fetch api seems to be standard way to do things. So using fetch or request like wrapper with default implementation provided in library will be a game changer and have no drawbacks from usability and unlimited customization options This will allow various customisations like auth using cert pinning etc. Edit: |
Hello, I have a feature request for custom request.
I see resolver_builder uses built in request module.
https://github.com/IBM/openapi-to-graphql/blob/master/packages/openapi-to-graphql/src/resolver_builder.ts#L15
It will be useful to provide custom request module such as custom-configured request or 3rd party packages like https://www.npmjs.com/package/retry-request
The text was updated successfully, but these errors were encountered: