Skip to main content

Module graphql

Module graphql 

Source
Expand description

Lightweight GraphQL API for AllSource events and projections

Implements a minimal GraphQL executor (no external dependencies) that supports:

  • Query events(entity_id, event_type, limit) → list of events
  • Query event(id) → single event by ID
  • Query projections → list projection names
  • Query projection(name, entity_id) → projection state
  • Query stats → store statistics

§Example query

{
  events(event_type: "user.created", limit: 10) {
    id
    event_type
    entity_id
    payload
    timestamp
  }
}

§Limitations

  • No mutations (read-only API)
  • No subscriptions (use WebSocket streaming instead)
  • No fragments, variables, or aliases
  • Field selection is advisory (all requested fields returned, unrequested fields omitted)

Structs§

GraphQLError
A GraphQL error
GraphQLRequest
GraphQL request body
GraphQLResponse
GraphQL response body
QueryField
Parsed top-level query field

Functions§

event_to_json
Convert an Event to a filtered JSON object based on requested fields
introspection_schema
Introspection schema response for __schema queries
parse_query
Parse a simple GraphQL query into query fields