bypass arguments parsing when target type is a map
This allows for unparsed forwarding of graphql arguments, in the case something application specific has to be done with the arguments.
The library already supports passing all of the input as a map, by specifying an argument as @Argument args: Map<String, ?>.
This PR adds support for doing this for individual arguments.
For example to distinguish between unspecified and null values;
input SomeInput {
name: String
}
type Mutation {
perform(input: SomeInput!): ...
}
Kotlin:
@MutationMapping
fun perform(@Argument input: Map<String, Any?>): ... {
if (input.contains("name")) {
if (input["name"] == null) {
// throw error
} else {
// ...
}
}
}
Java:
@MutationMapping
... perform(@Argument Map<String, ?> input) {
if (input.containsKey("name")) {
if (input["name"] == null) {
// throw error
} else {
// ...
}
}
}
@rstoyanchev and I discussed a few options for this and other related use cases. We've marked #140 for team-discussion and we might come back with proposals. Let's pause this one until #140 is addressed.
Let's pause this one until #140 is addressed.
Sure. I just figured that since this proposal is more versatile it would have a bigger chance of landing in the framework.
This should be taken care of with #449, but also supported at nested levels.