Hello! I'm having a small issue with a graphQL request that returns an empty list. I'm currently querying the Shopify Bulk Ingestion with a request payload that looks like:
query {
bulkOperationRunQuery (query:"long query") {
userErrors {
field
message
} bulkOperation {
id
status
}
}
}
public class BulkIngestionQueryOperation {
@GraphQLArgument(name="query", type="String")
private BulkOperationRunQuery bulkOperationRunQuery;
public BulkOperationRunQuery getBulkOperationRunQuery() {
return bulkOperationRunQuery;
}
public void setBulkOperationRunQuery(BulkOperationRunQuery bulkOperationRunQuery) {
this.bulkOperationRunQuery = bulkOperationRunQuery;
}
}
@GraphQLProperty(name="bulkOperationRunQuery", arguments={
@GraphQLArgument(name="query")
})
public class BulkOperationRunQuery {
private BulkOperation bulkOperation;
private UserErrors userErrors;
public BulkOperation getBulkOperation() {
return bulkOperation;
}
public void setBulkOperation(BulkOperation bulkOperation) {
this.bulkOperation = bulkOperation;
}
public UserErrors getUserErrors() {
return userErrors;
}
public void setUserErrors(UserErrors userErrors) {
this.userErrors = userErrors;
}
}
public class UserErrors {
private String message;
private String field;
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getField() {
return field;
}
public void setField(String field) {
this.field = field;
}
public String toString() {
return "error on " + field + " due to " + message;
}
}
When I screw up the user fields and I get a UserError, my request deserializes correctly. However, when the request is successful, I get an empty list of UserErros to which I get the error,
'Cannot deserialize instance of `com.attentivemobile.bulk.ingestion.processor.model.graphql.UserErrors` out of START_ARRAY token
at [Source: (String)"{"bulkOperationRunQuery":{"userErrors":[],"bulkOperation":{"id":"gid://shopify/BulkOperation/xxxxxxxxxxx","status":"CREATED"}}}"; line: 1, column: 40]
Is there a feature or trick with that I'm not aware of or is this a known issue?
I know there are similar issues here, but they have a very different schema, doesn't involve an empty list and the solution involves moving the arguments to the nested object which is already the case here.
Hello! I'm having a small issue with a graphQL request that returns an empty list. I'm currently querying the Shopify Bulk Ingestion with a request payload that looks like:
which has a response that looks like
I have my objects that look like
When I screw up the user fields and I get a UserError, my request deserializes correctly. However, when the request is successful, I get an empty list of UserErros to which I get the error,
Is there a feature or trick with that I'm not aware of or is this a known issue?
I know there are similar issues here, but they have a very different schema, doesn't involve an empty list and the solution involves moving the arguments to the nested object which is already the case here.
Thanks so much in advance!!
Tyler