mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-05-18 20:05:13 +02:00
Structured data 2 (#645)
* Structured data refactor - multi-index tables, remove need for manual mods to the Cassandra tables * Tech spec updated to track implementation
This commit is contained in:
parent
5ffad92345
commit
1809c1f56d
87 changed files with 5233 additions and 3235 deletions
32
trustgraph-base/trustgraph/schema/services/rows_query.py
Normal file
32
trustgraph-base/trustgraph/schema/services/rows_query.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
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.)
|
||||
|
||||
############################################################################
|
||||
Loading…
Add table
Add a link
Reference in a new issue