mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-25 05:01:01 +02:00
Filtering is fixed
This commit is contained in:
parent
30a9bcd6c1
commit
0f016b48ce
1 changed files with 7 additions and 1 deletions
|
|
@ -331,14 +331,19 @@ class Processor(FlowProcessor):
|
||||||
|
|
||||||
conditions = {}
|
conditions = {}
|
||||||
|
|
||||||
|
logger.info(f"Parsing where clause: {where_obj}")
|
||||||
|
|
||||||
for field_name, filter_obj in where_obj.__dict__.items():
|
for field_name, filter_obj in where_obj.__dict__.items():
|
||||||
if filter_obj is None:
|
if filter_obj is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
logger.info(f"Processing field {field_name} with filter_obj: {filter_obj}")
|
||||||
|
|
||||||
if hasattr(filter_obj, '__dict__'):
|
if hasattr(filter_obj, '__dict__'):
|
||||||
# This is a filter object (StringFilter, IntFilter, etc.)
|
# This is a filter object (StringFilter, IntFilter, etc.)
|
||||||
for operator, value in filter_obj.__dict__.items():
|
for operator, value in filter_obj.__dict__.items():
|
||||||
if value is not None:
|
if value is not None:
|
||||||
|
logger.info(f"Found operator {operator} with value {value}")
|
||||||
# Map GraphQL operators to our internal format
|
# Map GraphQL operators to our internal format
|
||||||
if operator == "eq":
|
if operator == "eq":
|
||||||
conditions[field_name] = value
|
conditions[field_name] = value
|
||||||
|
|
@ -349,6 +354,7 @@ class Processor(FlowProcessor):
|
||||||
elif operator == "contains":
|
elif operator == "contains":
|
||||||
conditions[f"{field_name}_contains"] = value
|
conditions[f"{field_name}_contains"] = value
|
||||||
|
|
||||||
|
logger.info(f"Final parsed conditions: {conditions}")
|
||||||
return conditions
|
return conditions
|
||||||
|
|
||||||
def generate_graphql_schema(self):
|
def generate_graphql_schema(self):
|
||||||
|
|
@ -462,7 +468,7 @@ class Processor(FlowProcessor):
|
||||||
schema_field = f
|
schema_field = f
|
||||||
break
|
break
|
||||||
|
|
||||||
if schema_field and (schema_field.indexed or schema_field.primary):
|
if schema_field:
|
||||||
safe_field = self.sanitize_name(field_name)
|
safe_field = self.sanitize_name(field_name)
|
||||||
|
|
||||||
# Build WHERE clause based on operator
|
# Build WHERE clause based on operator
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue