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
23 changes: 22 additions & 1 deletion packages/graph-explorer/src/core/ConfigurationProvider/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ import type {
import type { Branded } from "@/utils";
import type { IriNamespace, RdfPrefix } from "@/utils/rdf";

import type { EdgeType, VertexType } from "../entities";
import type { SchemaStorageModel } from "../StateProvider";

import {
createEdgeType,
createVertexType,
type EdgeType,
type VertexType,
} from "../entities";

export type ConfigurationId = Branded<string, "ConfigurationId">;

export function createNewConfigurationId() {
Expand Down Expand Up @@ -134,6 +140,21 @@ export type EdgeConnection = {
count?: number;
};

/** Creates an EdgeConnection with branded types from plain strings. */
export function createEdgeConnection(options: {
source: string;
edge: string;
target: string;
count?: number;
}): EdgeConnection {
return {
sourceVertexType: createVertexType(options.source),
edgeType: createEdgeType(options.edge),
targetVertexType: createVertexType(options.target),
...(options.count != null && { count: options.count }),
};
}

export type RawConfiguration = {
/**
* Unique identifier for this config
Expand Down
Loading
Loading