I have a requirement where i have to accept the list of objects.
The method in mutation class looks like this
@GraphQLMutation //1
public void ack(@GraphQLInputField List<PingEntity> pingEntityList) { //2
log.info("Handling ack calls.");
pingEntityRepository.savePingEntityList(pingEntityList);
}
PingEntity looks like this
@Data
//@Document(collection="pingdatastore")
@AllArgsConstructor
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class PingEntity {
private String id;
@JsonProperty("action")
private String action;
@JsonProperty("message")
private String message;
@JsonProperty("timestamp")
private Long timestamp;
@JsonProperty("transactionId")
private String transactionId;
@JsonProperty("type")
private Integer type;
private String imei;
}
my query looks like this
mutation ack {
ack(pingEntityList: [{action: "KEEP-ALIVE2", message: "Keep alive message at regular intervals", timestamp: 1462747047}]) {
id
}
}
I got the Error like this:
"data": null,
"errors": [
{
"validationErrorType": "SubSelectionNotAllowed",
"message": "Validation error of type SubSelectionNotAllowed: Sub selection not allowed on leaf type Boolean",
"locations": [
{
"line": 2,
"column": 3
}
],
"errorType": "ValidationError"
}
]
}
I tried giving different annotations. i am not able to solve this issue.. need help in this issue
Thanks in advance :)