import Morphik from 'morphik';
const client = new Morphik({
apiKey: 'My API Key',
});
const graph = await client.graph.retrieve('name');
console.log(graph.id);
{
"id": "<string>",
"name": "<string>",
"entities": [
{
"id": "<string>",
"label": "<string>",
"type": "<string>",
"properties": {},
"document_ids": [
"<string>"
],
"chunk_sources": {}
}
],
"relationships": [
{
"id": "<string>",
"source_id": "<string>",
"target_id": "<string>",
"type": "<string>",
"document_ids": [
"<string>"
],
"chunk_sources": {}
}
],
"metadata": {},
"system_metadata": {},
"document_ids": [
"<string>"
],
"filters": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"folder_name": "<string>",
"end_user_id": "<string>",
"app_id": "<string>"
}
Get a graph by name.
This endpoint retrieves a graph by its name if the user has access to it.
Args: name: Name of the graph to retrieve auth: Authentication context folder_name: Optional folder to scope the operation to end_user_id: Optional end-user ID to scope the operation to
Returns: Graph: The requested graph object
import Morphik from 'morphik';
const client = new Morphik({
apiKey: 'My API Key',
});
const graph = await client.graph.retrieve('name');
console.log(graph.id);
{
"id": "<string>",
"name": "<string>",
"entities": [
{
"id": "<string>",
"label": "<string>",
"type": "<string>",
"properties": {},
"document_ids": [
"<string>"
],
"chunk_sources": {}
}
],
"relationships": [
{
"id": "<string>",
"source_id": "<string>",
"target_id": "<string>",
"type": "<string>",
"document_ids": [
"<string>"
],
"chunk_sources": {}
}
],
"metadata": {},
"system_metadata": {},
"document_ids": [
"<string>"
],
"filters": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"folder_name": "<string>",
"end_user_id": "<string>",
"app_id": "<string>"
}
Successful Response
Represents a knowledge graph
Was this page helpful?