Releases: eclectic-coding/rails_audit_log-graphql
Releases · eclectic-coding/rails_audit_log-graphql
v1.0.0
RailsAuditLog::Graphql 1.0.0
Added
- RSpec matcher —
have_graphql_audit_entry(:update).touching(:title).for_type("Post")for asserting audit entries inSchema.executeresponses; includeRailsAuditLog::Graphql::Testing::RSpecMatchersin your RSpec config - Minitest assertions —
assert_graphql_audit_entryandrefute_graphql_audit_entrywith the same filter interface; includeRailsAuditLog::Graphql::Testing::MinitestAssertionsin your test class - Full YARD documentation on all public modules, classes, and methods
- RBS type signatures for
Testing::RSpecMatchersandTesting::MinitestAssertions
Changed
- API stability guarantee — no breaking changes to public interfaces without a major version bump
v0.6.1
RailsAuditLog::Graphql 0.6.1
Added
actorType:filter argument onauditLogEntries,auditLogEntriesConnection, andauditLogEntriesCount— filter by actor model class name (e.g."User")forTenant:argument onauditLogReifyandauditLogEntriesCount— consistent tenant scoping across all query fields; both also respectRailsAuditLog.current_tenantauto-tenant
Changed
auditLogReifyreturn type changed from genericJSONtoAuditLogJsonfor consistency with other entry fieldsrails g rails_audit_log:graphql:installnow also injectsSchemaPlugininto the host schema file (detected viaapp/graphql/**/*schema*.rbglob);print_next_stepsupdated to mention all available queries and the complexity config override
v0.6.0
RailsAuditLog::Graphql 0.6.0
Added
AuditLogJsonScalar(AuditLogJson) — custom scalar type forobjectChanges,object, andmetadatafields; replaces the genericJSONscalar with a self-documenting typeRecordByIdSource—GraphQL::Dataloader::Sourcethat batch-loads AR records by class name and ID; eliminates N+1 queries when resolvingactor.recordandauditedResource.recordon list responsesrecordfield onAuditLogActorandAuditedResource— returns the database record as JSON, batch-loaded via dataloaderauditLogReify(itemType:, itemId:, at:)— reconstructs the attribute state of a record at a given point in time; returnsJSONornilwhen the record was destroyed or no entry existsSchemaPlugin— include into host schema to applymax_complexity(200),max_depth(10),default_max_page_size(25), anduse GraphQL::Dataloader; all limits configurable viaRailsAuditLog::Graphql.max_complexity=etc.
v0.5.0
RailsAuditLog::Graphql 0.5.0
Added
forTenant:argument onauditLogEntry,auditLogEntries, andauditLogEntriesConnection— explicitly scope results to a tenant ID; overrides auto-tenant- Auto-tenant scoping — when
RailsAuditLog.current_tenantis 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
RailsAuditLog::Graphql 0.4.0
Added
AuditLogEntryCreatedsubscription —auditLogEntryCreated(itemType:, itemId:)subscribes to new entries for a specific record;auditLogEntryCreated(actorId:)subscribes to all entries by a specific actorAuditLogSubscriptionsMixin— include into host app'sSubscriptionTypeto add theauditLogEntryCreatedsubscription fieldBaseSubscriptionbase class for all gem GraphQL subscription typesBroadcaster— callBroadcaster.new(schema: MySchema).startin an initializer to relayrails_audit_log.entry_createdActiveSupport::Notificationsevents into GraphQL subscription triggers; supportsstopto unsubscribe
v0.3.0
RailsAuditLog::Graphql 0.3.0
Added
ActorType(AuditLogActor) — new object type withidandtypeNamefields exposing the polymorphic actor reference; addsactor: AuditLogActorfield onAuditLogEntryAuditedResourceType(AuditedResource) — new object type withidandtypeNamefields exposing the audited model reference; addsauditedResource: AuditedResource!field onAuditLogEntryDiffType(AuditLogDiff) — new object type withattribute,from, andtofields; addsdiff: [AuditLogDiff!]field onAuditLogEntryparsed fromobjectChanges
v0.2.0
RailsAuditLog::Graphql 0.2.0
Added
auditLogEntriesConnection— new Relay-style cursor-paginated field returningAuditLogEntryConnection!withnodes,edges,pageInfo, andfirst/after/last/beforearguments; accepts the same filters asauditLogEntriessince:anduntil:(ISO8601DateTime) arguments on bothauditLogEntriesandauditLogEntriesConnectionfor filtering by creation time rangetouching:(String) argument on bothauditLogEntriesandauditLogEntriesConnection— filters to entries whoseobject_changesinclude the named attributeorderBy:(AuditLogEntrySortInput) argument on bothauditLogEntriesandauditLogEntriesConnection— accepts{ field: CREATED_AT, direction: ASC | DESC }; defaults toCREATED_AT DESCAuditLogEntrySortInputinput object type,AuditLogEntrySortFieldenum, andSortDirectionenum added to the schema
v0.1.0
RailsAuditLog::Graphql 0.1.0
Added
AuditLogEntryTypeGraphQL object type exposing all 13RailsAuditLog::AuditLogEntryfieldsBaseObjectbase class for all gem GraphQL typesAuditLogEntriesQueryMixin— include into host app'sQueryTypeto addauditLogEntry(id:)andauditLogEntries(event:, itemType:, itemId:, actorId:, page:, perPage:)queries- Authentication support —
RailsAuditLog.authenticateis respected; block receives the GraphQL context and raisesGraphQL::ExecutionErrorwhen it returns falsy rails g rails_audit_log:graphql:installgenerator — injectsAuditLogEntriesQueryMixinintoapp/graphql/types/query_type.rb