Events

Events Query

Returns a paginated list of Event objects, with optional filtering and ordering. Events represent system events that can be published to NATS messaging system.

Arguments

Name
Type
Description

after

Cursor

Returns the elements in the list that come after the specified cursor

first

Int

Returns the first n elements from the list

before

Cursor

Returns the elements in the list that come before the specified cursor

last

Int

Returns the last n elements from the list

orderBy

EventOrder

Ordering options for events returned from the connection

where

EventWhereInput

Filtering options for events returned from the connection

Return Type

EventConnection! - A connection to a list of Event objects with pagination information.

Usage Example

query {
  # Search events by topic
  events(
    where: {
      topicContains: "inventory"
    },
    orderBy: { direction: DESC, field: CREATED_AT }
  ) {
    edges {
      node {
        id
        topic
        name
        description
        example
        createdAt
        createdBy
      }
      cursor
    }
    totalCount
  }
}

Common Filters

  • topicContains - Search by NATS topic substring

  • topic - Find by exact topic name

  • nameContains - Search by event name substring

  • name - Find by exact event name

  • descriptionContains - Search by description content

  • createdAtGTE / createdAtLTE - Filter by creation date range

Notes

  • Events define the structure and metadata for system messages

  • Each event has a NATS topic for message routing

  • Example field contains sample payload structure

  • Events are used for inter-service communication and workflow triggers

  • Support audit trail through creation and update timestamps

  • Essential for event-driven architecture and real-time notifications

Last updated

Was this helpful?