graphql-hive icon indicating copy to clipboard operation
graphql-hive copied to clipboard

Audit log GraphQL API

Open TuvalSimha opened this issue 5 months ago • 4 comments

Background

This pull request introduces new modules titled Audit Log. The audit logs comprehensively document all user activities and system events, organized by each organization.

Description

  • A new GraphQL schema has been established, along with the creation of an interface named AuditLog.
  • Audit log cases have been implemented by developing a new type that adheres to the AuditLog interface.
  • A new provider, named AuditLogManager, has been created with Clickhouse to facilitate database updates. This provider offers three primary functions:
  1. createLogAuditEvent: Utilized for inserting new log/event data.
  2. getPaginatedAuditLogs: Employed for retrieving all data from the database.
  3. getAuditLogsCount: Used to count the total number of records in the database.
  • The provider oversees the event/record type through a new type called AuditLogEvent, with each case accompanied by a zod schema to enhance type safety.
  • Currently, I have included a single example of a case that records user activity - you can see it here, and I welcome feedback on the next steps.

@kamilkisiela @dotansimha @n1ru4l I would appreciate your thoughts on this and any suggestions for modifications

TuvalSimha avatar Aug 26 '24 14:08 TuvalSimha