Hello, I’m trying to make a query using graphiQL interface in the browser, I’m using the getTasks query but I’m getting an error saying:
Error trying to resolve getTasks
“Message”: “Object reference not set to an instance of an object.”
I’m writing the query like this
{
getTasks(taskType:“Preorders”) {
id
}
}
and graphQL is not showing an error in the query, please help! thank you
To add to this, there’s more than just an entry in the VersionInfo table. Changes have been made to the database schema. If columns have been renamed, removed, data type changed there could be problems at runtime.
If you HAVE to do it by GQL, then this won’t be viable but the same can be done through SQL query in script.
So the query itself would be:
SELECT Id
FROM Tasks
JOIN TaskTypes ON TaskTypeId = TaskTypes.Id
WHERE TaskTypes.Name = 'Preorders'
And in the script it would look something like:
var query = "SELECT Id " +
"From Tasks " +
"JOIN TaskTypes ON TaskTypeId = TaskTypes.Id " +
"WHERE TaskTypes.Name = 'Preorders'"
To query you can put the sql.Query() in a try/catch block(which tries the query, and if there is an error, will display said error without crashing the program)
var result;
var isSuccessful = host.tryCatch
(
function(){
result = sql.Query(qry).All;
}, function(exception) {
hostException = exception;
return true;
});
if (!isSuccessful){
exceptionMessage = hostException.GetBaseException().ToString();
dlg.ShowMessage(exceptionMessage);
}
return result;
This was allegedly fixed (getTasks) in the latest update but I still can’t get it to work. Does anyone have a very basic query for getTasks that is known to work that I can use to test my setup? For examples sake I have this ToDo list implemented in my setup. I just need a baseline query that I know works to get the structure of this thing down.