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

Method getIndexConfig

packages/graph/src/indexes/IndexManager.ts:44–63  ·  view source on GitHub ↗

* Check if a property has an index defined in the schema. * @param label The element label. * @param property The property name. * @returns The index configuration, or undefined if not indexed.

(label: string, property: string)

Source from the content-addressed store, hash-verified

42 * @returns The index configuration, or undefined if not indexed.
43 */
44 public getIndexConfig(label: string, property: string): IndexConfig | undefined {
45 // Defensive check for incomplete schemas
46 const vertices = this.#schema.vertices;
47 if (vertices) {
48 const vertexSchema = vertices[label];
49 if (vertexSchema?.properties[property]?.index) {
50 return vertexSchema.properties[property]!.index;
51 }
52 }
53
54 const edges = this.#schema.edges;
55 if (edges) {
56 const edgeSchema = edges[label];
57 if (edgeSchema?.properties[property]?.index) {
58 return edgeSchema.properties[property]!.index;
59 }
60 }
61
62 return undefined;
63 }
64
65 /**
66 * Check if a property has an index of a specific type.

Callers 4

hasIndexOfTypeMethod · 0.95
isUniqueMethod · 0.95
getIndexMethod · 0.95
indexes.test.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected