Using this to get below working:
public class t12345 implements Database.Batchable<sObject> {
String query;
Boolean xyz;
public t12345(String query){
this.query= query;
}
public Database.QueryLocator start(Database.BatchableContext bC){
return Database.getQueryLocator(query);
}
}
and when I run below from developer console,
Type api = Type.forName('t12345');
Object apiCall = JSON.deserialize('{"query":"hello world"}',api);
Database.executeBatch((Database.Batchable<sObject>) apiCall);
above execution results in error Argument 1 cannot be null
which is coming from start method of batch where query value is still null as constructor with query is not invoked