Create a new project #
Use @lakeql/create-app to bootstrap a project with all dependencies pre-configured:
npm create @lakeql/create-app@latest my-apiFollow 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 myschemaThis 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 devYou 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