You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works fine, I get the data in my GraphQL responses, but fullName is reported as unmapped field. For this simple case I can change that to a synthesized getter and the reporting is gone:
data classAuthor(
valid:String,
valfirstName:String,
vallastName:String,
valbirthDate:LocalDate,
) {
val fullName get() ="$firstName$lastName"
}
But we have cases where we need the implementation as a function and cannot switch to a property.
Is there a possibility to recognize these fields as mapped?
The text was updated successfully, but these errors were encountered:
rstoyanchev
changed the title
Unmapped field reported for a field implemented as function in Kotlin
Field mapped to Kotlin function reported as unmapped by SchemaMappingInspector
Jun 26, 2024
It looks like at runtime, GraphQL Java matches the function with a predicate for "record-like" methods. Essentially, public methods without arguments that return a value. I've added a similar check that should make this work. It's in 1.3.2-SNAPSHOT if you're able to give it a try.
I have the following schema:
This is implemented with a Kotlin data class like
This works fine, I get the data in my GraphQL responses, but
fullName
is reported as unmapped field. For this simple case I can change that to a synthesized getter and the reporting is gone:But we have cases where we need the implementation as a function and cannot switch to a property.
Is there a possibility to recognize these fields as mapped?
The text was updated successfully, but these errors were encountered: