Skip to content

Releases: eclectic-coding/rails_audit_log-graphql

v1.0.0

04 Jun 15:55
350bcd2

Choose a tag to compare

RailsAuditLog::Graphql 1.0.0

Added

  • RSpec matcherhave_graphql_audit_entry(:update).touching(:title).for_type("Post") for asserting audit entries in Schema.execute responses; include RailsAuditLog::Graphql::Testing::RSpecMatchers in your RSpec config
  • Minitest assertionsassert_graphql_audit_entry and refute_graphql_audit_entry with the same filter interface; include RailsAuditLog::Graphql::Testing::MinitestAssertions in your test class
  • Full YARD documentation on all public modules, classes, and methods
  • RBS type signatures for Testing::RSpecMatchers and Testing::MinitestAssertions

Changed

  • API stability guarantee — no breaking changes to public interfaces without a major version bump

v0.6.1

04 Jun 13:24

Choose a tag to compare

RailsAuditLog::Graphql 0.6.1

Added

  • actorType: filter argument on auditLogEntries, auditLogEntriesConnection, and auditLogEntriesCount — filter by actor model class name (e.g. "User")
  • forTenant: argument on auditLogReify and auditLogEntriesCount — consistent tenant scoping across all query fields; both also respect RailsAuditLog.current_tenant auto-tenant

Changed

  • auditLogReify return type changed from generic JSON to AuditLogJson for consistency with other entry fields
  • rails g rails_audit_log:graphql:install now also injects SchemaPlugin into the host schema file (detected via app/graphql/**/*schema*.rb glob); print_next_steps updated to mention all available queries and the complexity config override

v0.6.0

04 Jun 13:10

Choose a tag to compare

RailsAuditLog::Graphql 0.6.0

Added

  • AuditLogJsonScalar (AuditLogJson) — custom scalar type for objectChanges, object, and metadata fields; replaces the generic JSON scalar with a self-documenting type
  • RecordByIdSourceGraphQL::Dataloader::Source that batch-loads AR records by class name and ID; eliminates N+1 queries when resolving actor.record and auditedResource.record on list responses
  • record field on AuditLogActor and AuditedResource — returns the database record as JSON, batch-loaded via dataloader
  • auditLogReify(itemType:, itemId:, at:) — reconstructs the attribute state of a record at a given point in time; returns JSON or nil when the record was destroyed or no entry exists
  • SchemaPlugin — include into host schema to apply max_complexity (200), max_depth (10), default_max_page_size (25), and use GraphQL::Dataloader; all limits configurable via RailsAuditLog::Graphql.max_complexity= etc.

v0.5.0

04 Jun 11:34

Choose a tag to compare

RailsAuditLog::Graphql 0.5.0

Added

  • forTenant: argument on auditLogEntry, auditLogEntries, and auditLogEntriesConnection — explicitly scope results to a tenant ID; overrides auto-tenant
  • Auto-tenant scoping — when RailsAuditLog.current_tenant is configured, all queries automatically filter to the current tenant without requiring an explicit argument
  • auditLogEntriesCount(event:, itemType:, since:) — new aggregation query returning the count of matching entries; respects auto-tenant

v0.4.0

04 Jun 11:22

Choose a tag to compare

RailsAuditLog::Graphql 0.4.0

Added

  • AuditLogEntryCreated subscription — auditLogEntryCreated(itemType:, itemId:) subscribes to new entries for a specific record; auditLogEntryCreated(actorId:) subscribes to all entries by a specific actor
  • AuditLogSubscriptionsMixin — include into host app's SubscriptionType to add the auditLogEntryCreated subscription field
  • BaseSubscription base class for all gem GraphQL subscription types
  • Broadcaster — call Broadcaster.new(schema: MySchema).start in an initializer to relay rails_audit_log.entry_created ActiveSupport::Notifications events into GraphQL subscription triggers; supports stop to unsubscribe

v0.3.0

03 Jun 19:12

Choose a tag to compare

RailsAuditLog::Graphql 0.3.0

Added

  • ActorType (AuditLogActor) — new object type with id and typeName fields exposing the polymorphic actor reference; adds actor: AuditLogActor field on AuditLogEntry
  • AuditedResourceType (AuditedResource) — new object type with id and typeName fields exposing the audited model reference; adds auditedResource: AuditedResource! field on AuditLogEntry
  • DiffType (AuditLogDiff) — new object type with attribute, from, and to fields; adds diff: [AuditLogDiff!] field on AuditLogEntry parsed from objectChanges

v0.2.0

03 Jun 14:09

Choose a tag to compare

RailsAuditLog::Graphql 0.2.0

Added

  • auditLogEntriesConnection — new Relay-style cursor-paginated field returning AuditLogEntryConnection! with nodes, edges, pageInfo, and first/after/last/before arguments; accepts the same filters as auditLogEntries
  • since: and until: (ISO8601DateTime) arguments on both auditLogEntries and auditLogEntriesConnection for filtering by creation time range
  • touching: (String) argument on both auditLogEntries and auditLogEntriesConnection — filters to entries whose object_changes include the named attribute
  • orderBy: (AuditLogEntrySortInput) argument on both auditLogEntries and auditLogEntriesConnection — accepts { field: CREATED_AT, direction: ASC | DESC }; defaults to CREATED_AT DESC
  • AuditLogEntrySortInput input object type, AuditLogEntrySortField enum, and SortDirection enum added to the schema

v0.1.0

03 Jun 11:46

Choose a tag to compare

RailsAuditLog::Graphql 0.1.0

Added

  • AuditLogEntryType GraphQL object type exposing all 13 RailsAuditLog::AuditLogEntry fields
  • BaseObject base class for all gem GraphQL types
  • AuditLogEntriesQueryMixin — include into host app's QueryType to add auditLogEntry(id:) and auditLogEntries(event:, itemType:, itemId:, actorId:, page:, perPage:) queries
  • Authentication support — RailsAuditLog.authenticate is respected; block receives the GraphQL context and raises GraphQL::ExecutionError when it returns falsy
  • rails g rails_audit_log:graphql:install generator — injects AuditLogEntriesQueryMixin into app/graphql/types/query_type.rb