LakeQL
  • Overview
Server Setup
  • Create Server
  • Define Config
  • Yoga Configuration
  • createLakeQLApp
Authentication
  • Authorization Model
  • JWT Authentication
  • Permissions
  • Scope Authorization
  • Trino User Impersonation
  • Debugging Identity
Schema Builder
  • Builder Configuration
  • Scalar Types
  • Comparison Types
  • Pagination
  • Input Validation
Customization
  • Custom Queries & Mutations
  • Extending Core
  • CORS Configuration
  • Error Handling
  • API Reference
GitHub
LakeQL
  1. API
  2. Server Setup
  3. Define Config

On this page

  1. Common Options
  2. Paths and Server
  3. Limits and Hooks

Define Config

The options accepted by defineApiConfig.

defineApiConfig accepts an ApiRuntimeConfig. Every field is optional, but the generated resolvers need a runtime. Without it, context.getReadStrategy throws on each request.

Common Options #

  • runtime — the LakeQLRuntime resolvers execute against. Required in practice.
  • tokenResolver — validates the request token into a current user. See JWT authentication . Defaults to a development mock that accepts any request when AUTH_MOCK=true and the authorization header equals AUTH_MOCK_TOKEN , taking the username from the x-username header. Provide a real resolver for anything beyond local development.
  • identityResolver — maps the JWT payload to a resolved identity. Defaults to the Entra ID resolver.
  • permissions — technical-user permission rules .
  • hasReadPermission / hasWritePermission — custom permission resolvers.

Paths and Server #

  • baseDir — base directory for resolving relative paths. Defaults to the current working directory.
  • schemaPath — where the generated query schema files live, relative to baseDir .
  • graphqlPath — the path the server mounts the GraphQL handler at. Defaults to /graphql .
  • healthCheckEndpoint — the health check path. Defaults to /live .
  • port — the server port. Defaults to 4000 .

Limits and Hooks #

  • maxRecordsPerPage — caps rows per paginated response. Defaults to 2000 .
  • yogaConfig — override GraphQL Yoga options and plugins. See Yoga configuration .
  • cors — CORS options for the GraphQL route, applied by the Hono layer. Off by default. See CORS configuration .
  • onError — a hook invoked for every execution error after logging. See error handling .

Previous page

Create Server

Next page

Yoga Configuration