Ingest URI (Basic)
Content: Ingest URI (Basic)
User Intent
Operation
TypeScript (Canonical)
import { Graphlit } from 'graphlit-client';
import { ContentState, ContentTypes, FileTypes } from 'graphlit-client/dist/generated/graphql-types';
const graphlit = new Graphlit();
// Basic ingestion (asynchronous - returns immediately)
const response = await graphlit.ingestUri(
'https://example.com/document.pdf'
);
const contentId = response.ingestUri.id;
console.log(`Content ingestion started: ${contentId}`);
// Synchronous ingestion (waits for completion)
const syncResponse = await graphlit.ingestUri(
'https://example.com/document.pdf',
undefined, // workflow (optional)
undefined, // collections (optional)
true // isSynchronous
);
const completedContentId = syncResponse.ingestUri.id;
console.log(`Content ingested and processed: ${completedContentId}`);
// Retrieve the ingested content
const content = await graphlit.getContent(completedContentId);
console.log(`Content name: ${content.content.name}`);
console.log(`Content type: ${content.content.type}`);Synchronous ingestion (snake_case method names)
Parameters
Required
Optional
Response
Variations
1. Asynchronous Ingestion with Polling (Production Pattern)
2. Ingestion with Collections
3. Ingestion with Custom Workflow
Common Issues
Production Example
Last updated