Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/server/src/schema/neo4j-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ export const typeDefs = gql`
workItems: [WorkItem!]! @relationship(type: "BELONGS_TO", direction: IN)
subgraphs: [Graph!]! @relationship(type: "PARENT_OF", direction: OUT)
parentGraph: Graph @relationship(type: "PARENT_OF", direction: IN)
# WorkItems (sheet symbols) that drill into this graph
drillSources: [WorkItem!]! @relationship(type: "DRILLS_INTO", direction: IN)
}

# WorkItem entity - represents work items in the graph
Expand All @@ -333,12 +335,17 @@ export const typeDefs = gql`
dueDate: DateTime
tags: [String!]
metadata: String # JSON as string

# If set, this node is a "sheet symbol" that drills into another graph
# (Altium-style hierarchy). Denormalized id for cheap client-side branching.
subgraphId: String

createdAt: DateTime! @timestamp(operations: [CREATE])
updatedAt: DateTime! @timestamp

# Relationships
owner: User @relationship(type: "OWNS", direction: IN)
# The sub-graph this node drills into (sheet symbol -> sub-sheet)
subgraph: Graph @relationship(type: "DRILLS_INTO", direction: OUT)
assignedTo: User @relationship(type: "ASSIGNED_TO", direction: IN)
graph: Graph @relationship(type: "BELONGS_TO", direction: OUT)
dependencies: [WorkItem!]! @relationship(type: "DEPENDS_ON", direction: OUT)
Expand Down
16 changes: 16 additions & 0 deletions packages/web/src/lib/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ export const GET_WORK_ITEMS = gql`
dueDate
tags
metadata
subgraphId
subgraph {
id
name
nodeCount
edgeCount
type
}
owner {
id
name
Expand Down Expand Up @@ -103,6 +111,14 @@ export const GET_WORK_ITEM_BY_ID = gql`
dueDate
tags
metadata
subgraphId
subgraph {
id
name
nodeCount
edgeCount
type
}
owner {
id
name
Expand Down
9 changes: 9 additions & 0 deletions packages/web/src/types/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ export interface WorkItem {
userId?: string;
dependencies?: WorkItem[];
dependents?: WorkItem[];
// Altium-style hierarchy: if set, this node drills into another graph
subgraphId?: string;
subgraph?: {
id: string;
name: string;
nodeCount?: number;
edgeCount?: number;
type?: string;
};
}

// Import and re-export RelationshipType from central constants file
Expand Down
Loading