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 may be related to the use of Kotlin data classes in my code.
For the following API and model
@GraphQlClientApi(endpoint = "https://api.com/graphql")
interface Client {
fun query(foo : String): Response
}
data class Project( var apiObject : ApiObject)
data class ApiObject(
var id: String = "",
var name: String = "" // This second field must be added or graphql client thinks that `Project` is a `String` due to its "scalar constructor"
)
In this case, if ApiObject only has id, graphql request with be apiObject, instead of apiObject{ id }. Adding a second field will result in apiObject{ id name }
I think this is exactly what we discussed in eclipse/microprofile-graphql#251: a single-string constructor is currently considered as defining a custom wrapper class.
Yea this was my worry in applying that by default. I think we need to apply this with some annotation so that it's a more explicit decision from the user.
This may be related to the use of Kotlin data classes in my code.
For the following API and model
In this case, if
ApiObject
only hasid
, graphql request with beapiObject
, instead ofapiObject{ id }
. Adding a second field will result inapiObject{ id name }
Seems caused by this chain:
smallrye-graphql/client/implementation/src/main/java/io/smallrye/graphql/client/typesafe/impl/GraphQlClientProxy.java
Line 86 in a9f7313
smallrye-graphql/client/implementation/src/main/java/io/smallrye/graphql/client/typesafe/impl/reflection/TypeInfo.java
Line 122 in a9f7313
smallrye-graphql/client/implementation/src/main/java/io/smallrye/graphql/client/typesafe/impl/reflection/TypeInfo.java
Line 136 in a9f7313
The text was updated successfully, but these errors were encountered: