I'm using the nodes client to perform an introspection query (based upon one I found that is used by GraphiQL). Using the response from that I am attempting to generate novel (data access object) classes using the Javassist bytecode manipulation library.
My issue is that the runtime generated DAOs are not being serialized to correctly formulate the query; e.g. if I have a Class<?> representing a vehicle, so effectively:
public class Vehicle {
private int id;
private String type;
private String modelCode;
private String brandName;
private LocalDate launchDate;
private transient String formattedDate;
// Getters and setters
...
}
and a Class<?> class forming the query for vehicles {ATM ignoring arguments that the query will need down the line}:
@GraphQLProperty(name="query")
public class QueryContainer {
private List<Vehicle> vehicles;
public List<Vehicle> getVehicles() { return vehicles; }
public void setVehicles(List<Vehicles> vehicleList) { vehicles = vehicleList; }
}
the serialized query being sent across the wire is:
{"query":"query { vehicles } ","variables":{}}
which produces the (sensible/expected) error response:
{"data":null,"errors":[{"message":"Validation error of type SubSelectionRequired: Sub selection required for type null of field vehicles @ 'vehicles'","locations": [{"line":1,"column":9,"sourceName":null}],"description":"Sub selection required for type null of field vehicles","validationErrorType":"SubSelectionRequired","queryPath":["vehicles"],"errorType":"ValidationError","path":null,"extensions":null}]}
I'm concerned that I'm being hampered by the bytecode generation library respecting type erasure and hence my generated List being a List of Objects, and the serialization process then finding no object fields from which to generate the fields of the query. However, if that were the case, I'm not certain how the serialization could ever work, given that it is being mapped from a Class?
Has there been any instance of nodes being used in this manner, and am I going about it in the right way? Any help would be greatly appreciated.
I'm using the nodes client to perform an introspection query (based upon one I found that is used by GraphiQL). Using the response from that I am attempting to generate novel (data access object) classes using the Javassist bytecode manipulation library.
My issue is that the runtime generated DAOs are not being serialized to correctly formulate the query; e.g. if I have a Class<?> representing a vehicle, so effectively:
and a Class<?> class forming the query for vehicles {ATM ignoring arguments that the query will need down the line}:
the serialized query being sent across the wire is:
which produces the (sensible/expected) error response:
I'm concerned that I'm being hampered by the bytecode generation library respecting type erasure and hence my generated List being a List of Objects, and the serialization process then finding no object fields from which to generate the fields of the query. However, if that were the case, I'm not certain how the serialization could ever work, given that it is being mapped from a Class?
Has there been any instance of nodes being used in this manner, and am I going about it in the right way? Any help would be greatly appreciated.