From 5a6a5234b4148b0d437dc13674edfd5427efe1d6 Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Wed, 3 Sep 2025 21:53:02 +0100 Subject: [PATCH] Query is working --- .../trustgraph/query/objects/cassandra/service.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/trustgraph-flow/trustgraph/query/objects/cassandra/service.py b/trustgraph-flow/trustgraph/query/objects/cassandra/service.py index f016c94e..fccc69b2 100644 --- a/trustgraph-flow/trustgraph/query/objects/cassandra/service.py +++ b/trustgraph-flow/trustgraph/query/objects/cassandra/service.py @@ -284,8 +284,11 @@ class Processor(FlowProcessor): Query = type('Query', (), query_dict) Query = strawberry.type(Query) - # Create the schema - self.graphql_schema = strawberry.Schema(query=Query) + # Create the schema with auto_camel_case disabled to keep snake_case field names + self.graphql_schema = strawberry.Schema( + query=Query, + config=strawberry.schema.config.StrawberryConfig(auto_camel_case=False) + ) logger.info(f"Generated GraphQL schema with {len(self.schemas)} types") async def query_cassandra( @@ -331,10 +334,13 @@ class Processor(FlowProcessor): if where_clauses: query += " WHERE " + " AND ".join(where_clauses) - # Add limit + # Add limit first (must come before ALLOW FILTERING) if limit: query += f" LIMIT {limit}" + # Add ALLOW FILTERING for now (should optimize with proper indexes later) + query += " ALLOW FILTERING" + # Execute query try: result = self.session.execute(query, params)