Is @InputArgument necessary for each type parameter of a query? #529
-
From the docs I understand that @DgsQuery
public Long countMovies(
Long countryId,
String movieTitle,
Long director,
Genre genre
) {
return null;
} Is it only necessary for Input types? Or I'm missing something here. In the Java project example you guys have all parameters are tagged with The funny thing is that if I put @DgsQuery
public Long countMovies(
@InputArgument Long countryId,
@InputArgument String movieTitle,
@InputArgument Long director,
@InputArgument Genre genre
) {
return null;
}
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
When no annotation is found, there is some fallback logic that tries to match the arguments by name. This only works if the compiler settings preserve argument names, so it's not recommended to rely on it. I'm not sure why in your example it didn't work with |
Beta Was this translation helpful? Give feedback.
When no annotation is found, there is some fallback logic that tries to match the arguments by name. This only works if the compiler settings preserve argument names, so it's not recommended to rely on it.
I'm not sure why in your example it didn't work with
@InputArgument
. Assuming the schema and query were defined correctly that should definitely work.We did make some significant changes in the latest release candidate (
4.6.0-rc.5
), which improves how input arguments are processed. Might be worth trying with that release.