LakeQL
Introduction
  • Overview
  • Key Concepts
  • Package Map
Getting Started
  • Prerequisites
  • Quickstart
  • Environment Configuration
  • First Run
Architecture
  • System Overview
  • Data Flow
  • Request Lifecycle
Configuration
  • Environment Variables
  • Authentication
  • Trino Connection
create-app
  • Usage
  • Template Structure
  • Post Creation
Contributing
  • Local Development
  • Contribution Guide
Guides
  • Custom Resolvers
  • Extending Schema
  • Deploying
  • Mutations
  • Load Strategies
GitHub
LakeQL
  1. LakeQL
  2. Getting Started
  3. Quickstart

On this page

  1. Create a new project
  2. Configure environment variables
  3. Pull schemas from Trino
  4. Start the API server
  5. Run your first query
  6. What's next

Quickstart

Scaffold a new LakeQL project and run your first GraphQL query in under 5 minutes.

Create a new project #

Use @lakeql/create-app to bootstrap a project with all dependencies pre-configured:

npm create @lakeql/create-app@latest my-api

Follow the interactive prompts to select your package manager and install dependencies.

Configure environment variables #

Navigate into your project and create a .env file from the template:

1
2
3
cd my-api
cp .env.example .env

Edit .env with your Trino connection details:

1
2
3
4
5
6
7
8
9
10
11
12
HIVE_HOST="http://localhost"
HIVE_PORT=8080
HIVE_CATALOG=hive
HIVE_USERNAME="trino"
HIVE_PASSWORD="your-password"

AUTH_MOCK=true
AUTH_MOCK_TOKEN="1234"

API_PORT=4000
API_LOGGER="info"

Pull schemas from Trino #

Generate TypeScript schemas from your Trino tables using the built-in CLI alias:

npm run cli pull --catalog hive --schema myschema

This introspects the selected tables in hive.myschema and generates typed config, interface, and query-schema files under src/schemas/generated/.

Start the API server #

Launch the GraphQL server:

npm run dev

You should see output like:

1
2
3
* Server URL: http://localhost:4000/
* GraphQL Endpoint: http://localhost:4000/graphql

Run your first query #

Open http://localhost:4000/graphql in your browser to access GraphiQL.

Set the authorization header in the headers panel:

1
2
3
4
{
  "Authorization": "1234"
}

Run a query against one of your generated schemas:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
query {
  users(paging: { page: 1, perPage: 5 }) {
    totalCount
    pageInfo {
      hasNext
      currentPage
      maxPages
    }
    nodes {
      id
      name
      email
    }
  }
}

What's next #

  • Learn about environment configuration for all available options
  • Understand the generated files in detail
  • Explore the architecture to see how the pieces fit together

Previous page

Prerequisites

Next page

Environment Configuration