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

Adding the ability to provider custom GraphQLClient #281

Open
ngoctranfire opened this issue May 15, 2023 · 3 comments
Open

Adding the ability to provider custom GraphQLClient #281

ngoctranfire opened this issue May 15, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@ngoctranfire
Copy link

Currently, we have the ability to provide 2 different scopes for schemas. However, this all generates our extensions to only the GraphQL Client. It would be great if we can specify which schemas belong to which GraphQL client and which functions belong to each individual client. For example,
Let's say I have two scopes:
scopes:
-graph1l/schema/graph_1.schema
-graph2l/schema/graph_2.schema

I should be able to set the client too, let's say I have Graph1Client (which extends GraphQLClient), and another Graph2Client.
In addition, we should be able to specify which client the schema and functions the GraphQL Client belongs to.

Not sure what is the best way to do it, but I think this would be a good addition!

@github-actions
Copy link

👋 @ngoctranfire
Thank you for raising an issue. I will investigate the issue and get back to you as soon as possible.
Please make sure you have provided enough context.

This library is created and maintained by me, @budde377. Please consider supporting my work and ensure our survival by donating here.

@budde377
Copy link
Contributor

It is an interesting idea. The API works by extension methods that can extend any client. How would you provision the different clients?

@budde377 budde377 added the enhancement New feature or request label May 15, 2023
@nocturnalflame
Copy link

nocturnalflame commented May 15, 2023

@budde377 I think we can change it so that when someone adds "scope", they have to also add if they want a custom client, and a name for the custom client:

For example:

scopes:
     graph1l/schema/graph_1.schema
          client: url<to>/Graph1Client
     graph2l/schema/graph_2.schema
          client: url<to>/Graph2Client
          
This way, when we generate the files, it generates it and attaches it to the client. If none is specified, it automatically just attaches it to GraphQLClient by default.

As for their client, they should make it themselves. (as us generating it for them wouldn't make sense, as there is way too much customizability and functionality we can't account for).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants