Open andrewfairlie opened 1 year ago
to the following solves the suffix bug.
use craft\helpers\ElementHelper;
$column = ElementHelper::fieldColumnFromField($this);
$query->subQuery->andWhere(Db::parseDateParam("content.$column", $value));
However this then reveals a second bug on this part where you can't actually query based on time
{
events:entries(section:"events", calendarDatesStart: ">now"){
title
... on events_default_Entry {
calendarDatesEnd
}
}
}
"errors": [
{
"debugMessage": "SQLSTATE[HY000]: General error: 1525 Incorrect DATETIME value: 'now'",
"message": "Internal server error",
"extensions": {
"category": "internal"
},
@jalendport is this one you would be able to look into please?
Craft introduced column suffixes for new fields, but it seems like the GraphQL queries on Preparse fields aren't querying against the field column. Unsure if this is a Craft bug or Preparse Field bug.
EG: Our test query
Returns the following SQL error
The column is actually
content.field_calendarDatesEnd_urqjyipm
because of the suffix Craft adds.