As discussed privately in Slack.
Possibility to be able to annotate a resolver method argument to be "spread". Happy to discuss alternate names, just thought it kinda works like a JS spread operator on an object.
```c#
// Resolver method
public Uri GetQuoteUrl(
[Spread] QuoteUrlParameters input)
=> _mediator.Send(input);
// Input class
public class QuoteUrlParameters
{
///
public string VehicleMake { get; }
/// <summary>A vehicle's model, e.g. Fiesta</summary>
public string? VehicleModel { get; }
[GraphQLIgnore] public string Ignored { get; set; }
// ctor
}
```graphql
type query {
quoteUrl(
"A vehicle's make, e.g. Ford"
vehicleMake: String!,
"A vehicle's model, e.g. Fiesta"
vehicleModel: String
): Uri!
}
IRequestSpreadAttributeQuoteUrlParameters) in scenario above (to be applied in all uses).All above would use a descriptor to then set a flag that can be picked up by the type interceptor.
Use a type interceptor. Examples:
Would replace the annotated arg with the arg's type's properties/fields as per current HC type reflection method.
Would hook up a middleware that takes the arguments and instantiates the full type as per current HC object input arg creation.
Feel free to chuck some thinking on here @michaelstaib / @PascalSenn .
I think the annotating part would be easy enough, I just need more details/design on how the rewriting arg and instantiating it on use would work. Given those concepts already exist in HC, it'd be great to be able to re-use existing functionality that knows how to build args list for a type T and similarly the functionality that knows how to pluck args and use T's ctor.
@maraisr this will interest you and allow us to not use the input: SomeInput convention in queries too for the convenience it provides. Best of both worlds :)
@benmccallum The issue I created a while ago would be #773
Most helpful comment
@maraisr this will interest you and allow us to not use the
input: SomeInputconvention in queries too for the convenience it provides. Best of both worlds :)