I am using GraphQL to load a list of objects that have the publish_status of "published" AND where the publish_date is null OR the publish_date is less than or equal to today, AND where the expiry_date is null OR the expiry_date is greater than or equal to tomorrow.
Is this even possible? I've tied every combination I can think of but cannot get the out come I need.
Has anyone done some thing like this sucessfully before?
plusDays / plus_time didn't make a difference an the output is the same. I have managed to identify the problem though, and have implemented a workaround with an additional property and a workflow, while inforcing that a date is entered into the two date fields I am querying on.
The problem it seams is this:
publish_date__null: true, expiry_date__null: true
You cannot use __null or __not_null to check for null values in date fields.
I reckon you should be, null is a valid (non)value for any field.
plusDays / plus_time didn't make a difference an the output is the same. I have managed to identify the problem though, and have implemented a workaround with an additional property and a workflow, while inforcing that a date is entered into the two date fields I am querying on.
The problem it seams is this:
publish_date__null: true, expiry_date__null: true
You cannot use __null or __not_null to check for null values in date fields.
I reckon you should be, null is a valid (non)value for any field.
The "No value present" error typically occurs in GraphQL when the query attempts to access a value that is either missing or not present in the context it expects.
I would check that all variables are recieving the expected values:
$today
$tomorrow
$page
$limit
After a quick review when defining $tomorrow you might try the plus_time filter rather than the plusDays function. You may also need to throw a render filter on those today functions to ensure the correct computation order.
EDIT: I would also remove the filters slowly to id which is throwing the error.