-
Notifications
You must be signed in to change notification settings - Fork 8
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
Spread syntax for query/mutation args #56
Comments
Hi @RobertVillalba! glad you find this library useful! It's an interesting suggestion, but I'm not sure about the cost/benefit of adding the spread operator in input arguments. It would lead to some clunky edge cases, like what if you have directives in the The truth is that structural entities ( I think it's worth deferring this as much as possible until enough use-cases are gathered in order to know what is the best way of implementing this. |
Hmm ok those are all fair points, perhaps what I want is something more simple. So let me preface this all with the fact that I'm fairly new to GQL and there is a great deal of things I'm not going to be familiar with or aware of. My background is more closely aligned with TS so I'm probably just wanting to bring some of those features to GQL. Not that TS has this exact same thing but, here is what I think would make GQL easier and would be great to see graphqxl allow. (a bit of a detour follows, but promise it will get back to this subject) I'm not a big fan of the separation between inputs and types. I sort of get why inputs have to be separated, but a lot of times I find that I'm just using simple inputs and types that could have been used interchangeably if it was not for GQL limitations. This lib greatly helps with this issue, but I find that it doesn't cover the case where I have inputs inside of inputs. I can't spread those so I need some repetition
To make the above example work, we'd have to make a
that would generate
If we place a restriction that templates must be simple then we can perhaps also allow spreading them inside of functions as well since it might eliminate some of the mentioned concerns? Sorry I know that was fairly drawn out and perhaps a separate ticket, but they seemed somewhat related. |
First of all I want to say that this is some awesome work! I've been hunting for something like it and none of the other solutions I've seen feel anywhere near as clean as this project. I feel like the repetition of GQL is one of the things that have hit me the hardest when defining schemas. So all in all thank you for this awesome project!
With regards to the project, I was wondering if there are any plans to support the use of the spread syntax inside of queries/mutation args. Currently I have a query and I would like to be able to pass in some pagination args that I have defined in an input, but I believe this is not supported.
The text was updated successfully, but these errors were encountered: