Skip to content

Allow to select which scheme to use #96

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

Closed
thejibz opened this issue Jan 28, 2019 · 7 comments
Closed

Allow to select which scheme to use #96

thejibz opened this issue Jan 28, 2019 · 7 comments

Comments

@thejibz
Copy link
Contributor

thejibz commented Jan 28, 2019

When different schemes are availaible (http/https), it would be nice to select which one to use.
I will look into it, and maybe propose a PR.

@Alan-Cha
Copy link
Collaborator

I’m not too familiar with this kind of usage. Could you clarify or even provide an example?

In any case, we would be ecstatic to see people contribute to our project! That’s the whole point of open sourcing, of course. Please let me know if you need any help! I can help walk you through the code (it’s a bit complex, I have to be honest) or give you suggestions once I have a better idea of what you mean. We really want to make this as easy as possible for people to contribute!

@thejibz
Copy link
Contributor Author

thejibz commented Jan 28, 2019

Hello, thank you for your warm welcome !
I was talking of transport schemes available for servers:

Simply put, if I can hit the API with either HTTP or HTTPS or WS, how can I tell OASgraph to choose my prefered way (instead of currently taking the first server of the list ) ?

PR coming soon :)

@Alan-Cha
Copy link
Collaborator

Wow! Thank you so much! This was so quick too! I left a few comments for you to take a look at. Tell me what you think!

@Alan-Cha
Copy link
Collaborator

This is a cool change because we’ve always randomly picked a base URL. This provides some level of control. Do you think it’s worthwhile to add more fine-grained options to control the base URL? Or do you think it makes more sense just to change the OAS? I was wondering if you, as the pioneer of this idea, have any insight into this.

@thejibz
Copy link
Contributor Author

thejibz commented Jan 29, 2019

Wow! Thank you so much! This was so quick too! I left a few comments for you to take a look at. Tell me what you think!

It's my turn to congratulate you for your code base. It's fairly easy to get into it ! Well structured and commented. Appreciated working on it 👍

@thejibz
Copy link
Contributor Author

thejibz commented Jan 29, 2019

This is a cool change because we’ve always randomly picked a base URL. This provides some level of control. Do you think it’s worthwhile to add more fine-grained options to control the base URL? Or do you think it makes more sense just to change the OAS? I was wondering if you, as the pioneer of this idea, have any insight into this.

Humm, in my current use case it suffices to let me pick the protocol I prefer.

But in an ideal world we should have the means to make a round robin on a sublist of OAS' defined servers.
I could see it as a list of servers injected in the gql context and then the resolvers would use one of it, following a policy.
Tbh, It's a complete new feature that would involve a good amount of work. Maybe wait till a bunch o people ask for it ;)

Alan-Cha pushed a commit that referenced this issue Jan 29, 2019
@Alan-Cha
Copy link
Collaborator

I just approved the pull request! Again, thank you so much for contributing to our project! It makes me really happy to know that people are out there trying out OASGraph!

But in an ideal world we should have the means to make a round robin on a sublist of OAS' defined servers.

Yeah... I think it also depends on how people want to use OASGraph. Are people willing to change the OAS in order to make better use of OASGraph? Or do people expect OASGraph to house all the tools needed to customize a GraphQL interface? I brought up in some other issues the problem with generating type names. I think in that case, the only way to improve the generated interface is to modify the OAS. As a result, that sets to precedent of changing the OAS. In this case, maybe the solution is to just have different OASs for different servers or server configurations.

But yeah, for now, we'll just wait until a bunch of people ask for it haha 😆

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