Skip to content

feat: add lifecycle hooks and GraphQL attributes#14

Merged
Theauxm merged 3 commits intomainfrom
feat/lifecycle-hooks-and-graphql-attributes
Mar 5, 2026
Merged

feat: add lifecycle hooks and GraphQL attributes#14
Theauxm merged 3 commits intomainfrom
feat/lifecycle-hooks-and-graphql-attributes

Conversation

@Theauxm
Copy link
Copy Markdown
Member

@Theauxm Theauxm commented Mar 5, 2026

Summary

  • Add train lifecycle hook system (ITrainLifecycleHook, ILifecycleHookRunner) that fires on train state transitions (started, completed, failed, cancelled), registered via AddLifecycleHook<T>() on the configuration builder
  • Add opt-in GraphQL attributes ([TraxQuery], [TraxMutation], [TraxBroadcast]) as framework primitives so train classes can declare their API surface without depending on the API package
  • ServiceTrain.RunAsync now invokes lifecycle hooks at each state transition, distinguishing cancellation from failure

Test plan

  • AddLifecycleHookTests — verifies hook registration on the DI container
  • LifecycleHookRunnerTests — verifies hooks fire correctly for each state transition

Theauxm added 3 commits March 4, 2026 17:35
Add train lifecycle hook system (ITrainLifecycleHook, LifecycleHookRunner)
that fires on train state transitions (started, completed, failed, cancelled).
Hooks are registered via AddLifecycleHook<T>() on the configuration builder
and automatically invoked by ServiceTrain.

Add opt-in GraphQL attributes ([TraxQuery], [TraxMutation], [TraxBroadcast])
as framework primitives so train classes can declare their API surface without
depending on the API package.
The new LifecycleHookRunner registration adds an additional logger instance,
bumping the expected count from 5 to 6.
@Theauxm Theauxm merged commit ffe908e into main Mar 5, 2026
1 check passed
@traxsharp
Copy link
Copy Markdown

traxsharp Bot commented Mar 5, 2026

This PR is included in version 1.6.0

@Theauxm Theauxm deleted the feat/lifecycle-hooks-and-graphql-attributes branch March 6, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant