Overview
Create a high-level GraphClient abstraction that allows users to work with POCOs while automatically translating them to graph entities (NodeTypes, Nodes, Edges, Properties).
User Experience
// 1. Define models with attributes
[GraphNode("app.task", Name = "Task", Icon = "task")]
public class TaskModel
{
public Guid Id { get; set; }
[GraphProperty(Required = true)]
public string Title { get; set; }
[GraphProperty(PropertyTypes.DateTime)]
public DateTime DueDate { get; set; }
[GraphEdge("assigned.to")]
public UserModel? AssignedTo { get; set; }
}
// 2. Use GraphClient for CRUD
var client = new GraphClient("https://api.example.com");
var task = await client.CreateAsync(new TaskModel { Title = "My Task" });
var loaded = await client.GetAsync<TaskModel>(task.Id);
Implementation Tasks
Phase 1: Test Specifications (SPEC0230)
Phase 2: Attributes (src/abstractions/Attributes/)
Phase 3: Client Implementation (src/abstractions/Client/)
Phase 4: Documentation
Key Features
- Auto-registration: NodeTypes registered automatically on first use
- Version tracking: SHA256 hash detects model changes, updates NodeType
- Type inference: C# types mapped to PropertyTypes automatically
- Edge navigation: Navigation properties translated to graph edges
- Soft deletes: Default behavior matches existing patterns
User Stories
| ID |
Story |
Description |
| US01 |
Model Attributes |
Attribute decoration for graph metadata |
| US02 |
Type Registration |
Auto-register NodeTypes on first use |
| US03 |
Node CRUD |
Create, Read, Update, Delete operations |
| US04 |
Edge Navigation |
Edge creation and traversal |
| US05 |
Property Mapping |
Type conversion (C# ↔ PropertyTypes) |
References
- Extends pattern from
NodeTypeAttribute.cs
- Reuses hash logic from
ModelShapeService.cs
- Follows test structure from
SPEC0209.GraphSession
Overview
Create a high-level GraphClient abstraction that allows users to work with POCOs while automatically translating them to graph entities (NodeTypes, Nodes, Edges, Properties).
User Experience
Implementation Tasks
Phase 1: Test Specifications (SPEC0230)
src/test/SPEC0230.GraphClient/directory structureGraphClientScenario.csbase classTestModels.cswith sample POCOsPhase 2: Attributes (
src/abstractions/Attributes/)GraphNodeAttribute.cs- marks class as graph nodeGraphPropertyAttribute.cs- property metadataGraphEdgeAttribute.cs- navigation property as edgeGraphIdAttribute.cs- marks ID propertyGraphIgnoreAttribute.cs- excludes from serializationPhase 3: Client Implementation (
src/abstractions/Client/)IGraphClient.cs- public interfaceGraphClient.cs- main implementationGraphClientOptions.cs- configurationInternal/ModelReflector.cs- reflection + cachingInternal/ModelMetadata.cs- extracted type infoInternal/TypeRegistry.cs- NodeType registrationInternal/ModelMapper.cs- POCO ↔ Node conversionPhase 4: Documentation
src/abstractions/README.md- usage guideKey Features
User Stories
References
NodeTypeAttribute.csModelShapeService.csSPEC0209.GraphSession