GraphApiConfiguration class

Configuration class for the KISS Graph library.

This class provides a simple way to configure dependency injection for the graph node service, allowing users to inject their own repository implementations while providing sensible defaults.

Example usage:

// With custom repository
final config = GraphApiConfiguration(
  repository: myCustomRepository,
);
final apiService = config.createApiService();

// With default in-memory repository
final config = GraphApiConfiguration.withInMemoryRepository();
final apiService = config.createApiService();

Constructors

GraphApiConfiguration({required Repository<Node> repository})
Create a configuration with a custom repository.
GraphApiConfiguration.withInMemoryRepository({String? path})
Create a configuration with an in-memory repository for testing/demos.
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
nodeApiService → NodeApiService
Get the configured API service instance.
no setter
nodeService → NodeService
Get the configured node service instance.
no setter
repository → Repository<Node>
Get the configured repository instance.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

createApiService() → NodeApiService
Create and return the API service ready for use.
dispose() → void
Dispose of all resources.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setupRoutes(RouterPlus app) → void
Set up routes on a Router instance.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited