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

Function createTestGraph

packages/graph/src/test/keywordAsIdentifier.test.ts:23–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21}
22
23function createTestGraph(): Graph<GraphSchema> {
24 const schema = {
25 vertices: {
26 Person: {
27 properties: {
28 name: { type: makeType<string>("") },
29 age: { type: makeType<number>(0) },
30 temp: { type: makeType<string | undefined>(undefined) },
31 },
32 },
33 Item: {
34 properties: {
35 value: { type: makeType<number>(0) },
36 },
37 },
38 },
39 edges: {
40 KNOWS: {
41 properties: {},
42 },
43 },
44 } as const satisfies GraphSchema;
45
46 return new Graph({ schema, storage: new InMemoryGraphStorage() });
47}
48
49function executeQuery(graph: Graph<GraphSchema>, queryString: string): unknown[] {
50 const ast = parse(queryString) as Query;

Callers 1

Calls 1

makeTypeFunction · 0.70

Tested by

no test coverage detected