-
Notifications
You must be signed in to change notification settings - Fork 327
Closed
Labels
in: webIssues related to web handlingIssues related to web handlingtype: bugA general bugA general bug
Milestone
Description
Hello, thank you for the great work on this project.
I am currently facing an issue where HttpSyncGraphQlClient seems to return a List instead of the specified target type list when using toEntityList.
I expected the response to be deserialized into my data class, but I am receiving a list of Maps instead. Please let me know if I am missing any configuration or if there is a mistake in how I am using the client code.
Steps to Reproduce
GraphQL Schema:
type Query {
exampleResources: [ExampleResource!]!
}
type ExampleResource {
id: ID!
name: String
}Client code:
// Target Data Class
data class ExampleResource(
val id: String,
val name: String?
)
// Client Implementation
val client = HttpSyncGraphQlClient.builder()
.url("http://localhost:8080/graphql")
.build()
// The issue occurs here: data becomes List<LinkedHashMap>
val data = client.document("query { exampleResources { id name } }")
.retrieveSync("exampleResources")
.toEntityList<ExampleResource>()The data variable is returned as a List, resulting in type mismatch issues.
Environment
- java: 21
- kotlin: 2.2.21
- spring boot: 4.0.0
I would appreciate any guidance or advice you could provide. Thank you!
Metadata
Metadata
Assignees
Labels
in: webIssues related to web handlingIssues related to web handlingtype: bugA general bugA general bug