Load Ariadne GraphQL data to DuckDB
Build a Ariadne GraphQL to DuckDB pipeline with your coding agent. One prompt scaffolds it with the dltHub AI harness, plus the Ariadne GraphQL API base URL, auth, endpoints, and incremental loading.
Ariadne Core is an open source document extraction and retrieval pipeline that exposes a REST API for document lifecycle management and search. Everything needed to build a working Ariadne GraphQL → DuckDB pipeline is on this page: the API's base URL, authentication, endpoints, pagination and incremental field — plus a prompt that hands the whole job to your coding agent.
Build your Ariadne GraphQL to DuckDB pipeline
Paste this prompt into Claude, Codex, or Cursor. The agent does the rest.
PromptRunuvx dlthub-init@latestto build a pipeline from Ariadne GraphQL to DuckDB and run it on dltHub
That scaffolds a dltHub workspace and installs the dltHub AI harness — the project rules, the secrets-management skill, and the dlt MCP server your agent needs to work safely. From there it reads the Ariadne GraphQL API, proposes the endpoints to load, then writes, runs and validates the pipeline while you review rather than type. Credentials are inspected through MCP tools, so your agent never reads secrets.toml itself. How the LLM-native workflow works →
Prefer to write it yourself? Every fact the agent uses is below.
Ariadne GraphQL API at a glance
| Base URL | /api/ |
| Example endpoint | POST /graphql |
| Authentication | All requests require a Bearer token — sent in the Authorization header, prefixed Bearer |
| Pagination | Not paginated |
| API reference | https://ariadnegraphql.org/server/API-reference/api-reference |
These values come from the Ariadne GraphQL API reference — the authoritative source if anything here looks out of date.
How do I authenticate with the Ariadne GraphQL API?
All requests require an 'Authorization' header using the Bearer token scheme.
1. Get your credentials
Ariadne is a Python library for building GraphQL servers, not a SaaS platform with a central dashboard for API key management. To set up authentication for your Ariadne-based API: 1) Implement a login mutation in your GraphQL schema that accepts credentials (e.g., username/password). 2) Inside the resolver for this mutation, verify the credentials against your user database. 3) On successful authentication, generate a token (such as a JWT) and return it to the client. 4) For subsequent requests, the client must include this token in the Authorization header (e.g., Authorization: Bearer ). You may use third-party packages like ariadne-jwt or ariadne-token-auth to handle token issuance and validation logic.
2. Add them to .dlt/secrets.toml
[sources.ariadne_graphql_source] api_key = "your_api_key_here" # If using ariadne-codegen to connect to your API: remote_schema_headers = "{\"Authorization\": \"Bearer $API_KEY\"}"
dlt reads this file automatically at runtime. With the harness, the setup-secrets skill prompts you for the values and never handles the raw credential in chat. For production, see setting up credentials with dlt.
What Ariadne GraphQL data can I load into DuckDB?
These are the Ariadne GraphQL endpoints dlt can load into DuckDB:
| Resource | Endpoint | Method | Data selector | Description |
|---|---|---|---|---|
| graphql | / | POST | Executes GraphQL query operations. | |
| graphql_explorer | / | GET | Returns GraphQL playground/explorer interface. | |
| graphql_options | / | OPTIONS | Returns supported HTTP methods for the endpoint. | |
| health_check | /health | GET | Custom implementation dependent on framework. | |
| introspection | / | POST | Queries the GraphQL schema metadata. |
How do I load only new Ariadne GraphQL records?
The Ariadne GraphQL API reference does not document a timestamp or sequence field for these endpoints, so there is nothing to advertise here as verified. Pick a field from the endpoints table above that increases with every write, then set it as the cursor_path.
{"name": "graphql", "endpoint": { "path": "/graphql", # Replace with a field that increases on every write. "incremental": {"cursor_path": "REPLACE_ME", "initial_value": "2024-01-01T00:00:00Z"}, }}
On the first run dlt loads everything from initial_value; on every run after that it requests only what changed and appends with write_disposition="merge" if you set a primary key. See incremental loading.
What does the generated Ariadne GraphQL pipeline look like?
A standard dlt REST API pipeline — the same code you would write by hand, loading login and getAuthToken from the Ariadne GraphQL API into DuckDB:
import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def ariadne_graphql_source(api_key=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "/api/", "auth": {"type": "bearer", "token": api_key}, }, "resources": [ {"name": "graphql", "endpoint": {"path": "/graphql"}}, {"name": "graphql_explorer", "endpoint": {"path": "/graphql"}} ], } yield from rest_api_resources(config) def load_ariadne_graphql_to_duckdb() -> None: pipeline = dlt.pipeline( pipeline_name="ariadne_graphql_pipeline", destination="duckdb", dataset_name="ariadne_graphql_data", ) load_info = pipeline.run(ariadne_graphql_source()) print(load_info) if __name__ == "__main__": load_ariadne_graphql_to_duckdb()
Run it with python ariadne_graphql_pipeline.py. The agent iterates on this until it loads cleanly — you review and approve, rather than write it from scratch.
How do I query Ariadne GraphQL data in DuckDB?
dlt creates one table per resource. Query the loaded data with Python or SQL — or ask your agent to, through the MCP server's execute_sql_query tool.
Python (pandas DataFrame):
import dlt data = dlt.pipeline("ariadne_graphql_pipeline").dataset() df = data.graphql.df() print(df.head())
SQL:
SELECT * FROM ariadne_graphql_data.graphql LIMIT 10;
See querying your data with dataset and exploring it in marimo notebooks.
How do I deploy the Ariadne GraphQL to DuckDB pipeline in production?
The pipeline runs locally, which is ideal for prototyping and one-off analysis. When you need it on a schedule, monitored on every load, and shared with your team, deploy the same dlt code on the dltHub platform — no infrastructure to maintain. The prompt above already ends with "run it on dltHub", so your agent can take it there directly.
- Deploy & schedule — run the pipeline as a managed job with automatic retries.
- Monitor — observable job queues, alerting, and load metrics for every run.
- Transform — promote raw Ariadne GraphQL loads into governed, documented models.
- Visualize & share — explore data in notebooks and publish live dashboards instead of static screenshots.
What other destinations can I load Ariadne GraphQL data to?
dlt loads into any of these — only the destination argument changes:
| Destination | Example value |
|---|---|
| PostgreSQL | "postgres" |
| BigQuery | "bigquery" |
| Snowflake | "snowflake" |
| Redshift | "redshift" |
| Databricks | "databricks" |
| Filesystem (S3, GCS, Azure) | "filesystem" |
Set dlt.pipeline(destination="snowflake") and add credentials in .dlt/secrets.toml. On the dltHub platform the same pipeline runs against a managed Iceberg lakehouse. See the full destinations list.
Next steps
Was this page helpful?
Community Hub
Need more dlt context for Ariadne GraphQL to DuckDB?
Request dlt skills, commands, AGENT.md files, and AI-native context.