graphql-java-generator / graphql-maven-plugin-project

graphql-maven-plugin is a Maven Plugin for GraphQL, based on graphql-java. It accelerates the development for both the client and the server, by generating the Java code. It allows a quicker development when in contract-first approach, by avoiding to code the boilerplate code.
https://graphql-maven-plugin-project.graphql-java-generator.com
MIT License
115 stars 47 forks source link

how bind graphQl respone with implement java class #194

Closed superchenwei closed 9 months ago

superchenwei commented 11 months ago

Hi I'm using com.graphql-java-generator 1.18.11 client mode,here is the issue,client generate code function is ok,but when I'm testing the below code org.datahub.client.BrowseResults searchResults = queryExecutor.browse( "{start count total entities{urn name}}",input ); got error The GraphQL type 'Entity' (org.datahub.client.Entity) has no field of name 'name'

Below is the filed 'entities' defination in class 'BrowseResults' @JsonProperty("entities") @JsonDeserialize(using = CustomJacksonDeserializers.ListEntity.class) @GraphQLNonScalar( fieldName = "entities", graphQLTypeSimpleName = "Entity", javaClass = org.datahub.client.Entity.class, listDepth = 1) List entities;

org.datahub.client.Entity is a interface,there is a java class Dataset with field 'name' implement from Entity,how cloud I let the 'browse ' method know should use Dataset class bind GraphQl response but not org.datahub.client.Entity.

                                                                                                                                                                                       Thanks!
etienne-sf commented 10 months ago

Hello,

Can you copy the definition of the Entity GraphQL interface here ? Does it actually contain a name field ?

Etienne