mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 00:16:23 +02:00
* Structured data refactor - multi-index tables, remove need for manual mods to the Cassandra tables * Tech spec updated to track implementation
32 lines
1.4 KiB
Python
32 lines
1.4 KiB
Python
from dataclasses import dataclass, field
|
|
from typing import Optional
|
|
|
|
from ..core.primitives import Error
|
|
from ..core.topic import topic
|
|
|
|
############################################################################
|
|
|
|
# Rows Query Service - executes GraphQL queries against structured data
|
|
|
|
@dataclass
|
|
class GraphQLError:
|
|
message: str = ""
|
|
path: list[str] = field(default_factory=list) # Path to the field that caused the error
|
|
extensions: dict[str, str] = field(default_factory=dict) # Additional error metadata
|
|
|
|
@dataclass
|
|
class RowsQueryRequest:
|
|
user: str = "" # Cassandra keyspace (follows pattern from TriplesQueryRequest)
|
|
collection: str = "" # Data collection identifier (required for partition key)
|
|
query: str = "" # GraphQL query string
|
|
variables: dict[str, str] = field(default_factory=dict) # GraphQL variables
|
|
operation_name: Optional[str] = None # Operation to execute for multi-operation documents
|
|
|
|
@dataclass
|
|
class RowsQueryResponse:
|
|
error: Error | None = None # System-level error (connection, timeout, etc.)
|
|
data: str = "" # JSON-encoded GraphQL response data
|
|
errors: list[GraphQLError] = field(default_factory=list) # GraphQL field-level errors
|
|
extensions: dict[str, str] = field(default_factory=dict) # Query metadata (execution time, etc.)
|
|
|
|
############################################################################
|