MCPcopy Create free account
hub / github.com/codemix/graph / createGraph

Function createGraph

packages/graph/src/test/stringPredicatesAndReturnAll.test.ts:63–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61} as const satisfies GraphSchema;
62
63function createGraph(): Graph<GraphSchema> {
64 const graph = new Graph({ schema, storage: new InMemoryGraphStorage() });
65
66 // Add users
67 graph.addVertex("User", {
68 name: "Alice Smith",
69 email: "alice@example.com",
70 role: "admin",
71 age: 30,
72 });
73 graph.addVertex("User", {
74 name: "Bob Johnson",
75 email: "bob@company.org",
76 role: "user",
77 age: 25,
78 });
79 graph.addVertex("User", {
80 name: "Charlie Brown",
81 email: "charlie@example.com",
82 role: "admin",
83 age: 35,
84 });
85 graph.addVertex("User", {
86 name: "Diana Prince",
87 email: "diana@company.org",
88 role: "user",
89 age: 28,
90 });
91 graph.addVertex("User", {
92 name: "Eve Adams",
93 email: "eve@test.net",
94 role: "moderator",
95 age: 32,
96 });
97
98 // Add products
99 graph.addVertex("Product", {
100 name: "Laptop Pro",
101 sku: "ELEC-001",
102 category: "electronics",
103 price: 999,
104 });
105 graph.addVertex("Product", {
106 name: "Wireless Mouse",
107 sku: "ELEC-002",
108 category: "electronics",
109 price: 29,
110 });
111 graph.addVertex("Product", {
112 name: "Office Chair",
113 sku: "FURN-001",
114 category: "furniture",
115 price: 299,
116 });
117 graph.addVertex("Product", {
118 name: "Standing Desk",
119 sku: "FURN-002",
120 category: "furniture",

Calls 1

addVertexMethod · 0.95

Tested by

no test coverage detected