Hey @JBrake
So I haven’t tested this, but in theory the following query should represent this logical expression:
publish_status=“published” AND (
(publish_date <= $today AND expiry_date >= $tomorrow)
OR
(publish_date <= $today AND expiry_date == null)
OR
(publish_date == null AND expiry_date >= $tomorrow)
OR
(publish_date == null AND expiry_date == null)
)
# $today: {{ unixtimestamp(today()) }}
# $tomorrow {{ unixtimestamp(today().plusDays(1)) }}
query LoadMyObjectList($today: Date, $tomorrow: Date) {
CRM {
MyObjects: p_myobject_collection(
orderBy: start_date__desc
offset: $page
limit: $limit
filter: {publish_status__eq: "published",
OR: [
{publish_date__lte: $today, expiry_date__gte: $tomorrow},
{publish_date__lte: $today, expiry_date__null: true},
{publish_date__null: true, expiry_date__gte: $tomorrow},
{publish_date__null: true, expiry_date__null: true},
]}
) {
total
limit
offset
items {
hs_object_id
name
description
link
publish_status
publish_date
start_date
}
}
}
}
I believe this is what you’re looking for.
You also had a missing “)” when defining your $today variable
Hopefully this gets you moving!
If I can clarify anything please don’t hesitate to reach out!