8000 GitHub - ksckaan1/events-graphql-api
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ksckaan1/events-graphql-api

Repository files navigation

Event Logger API

Tech Stack

  • Go
  • ClickHouse
  • GraphQL
  • gqlgen
  • Docker

Run

docker compose up

Stop

docker compose down

Usage

You can navigate to http://localhost:8080 to access the GraphQL API Playground.

Or you can send requests directly to http://localhost:8080/query

Mutations

  • recordEvent

    mutation RecordEvent {
      recordEvent(input: {
        event_type: "example_type",
        user_id: "f81d4fae-7dec-11d0-a765-00a0c91e6bf6",
        metadata: {
          username: "ksckaan1",
          age: 27
        }
      }) {
        event_id
        user_id
        event_type
        timestamp
        metadata
      }
    }

Queries

  • eventsByUserID

    query ListEventsByUserID {
      eventsByUserID(params: {
        user_id: "f81d4fae-7dec-11d0-a765-00a0c91e6bf6",
        limit: 3,
        offset: 5
      }) {
        event_id
        user_id
        event_type
        timestamp
        metadata
      }
    }
  • countEventsByEventType

    query CountEventTypesBetweenTimeRange {
      countEventsByEventType(params: {
        event_type: "example_type",
        start_time: "2025-04-27T11:30:30.933409435Z",
        end_time: "2025-04-27T11:40:30.933409435Z"
      })
    }

Generating Go codes from graphql schema

go generate ./...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0