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. Customization
  3. Extending Core

Extending Core

Augment the generated types with additional fields.

Generated object types are defined on the shared builder, so you can extend them rather than only add standalone fields. Use the builder's object-field extension to add computed or related fields to a generated type.

1
2
3
4
5
6
7
8
9
import { builder } from "@lakeql/api/builder"

// Add a computed field to a generated `Order` type
builder.objectField(OrderRef, "displayName", (t) =>
  t.string({
    resolve: (order) => `#${order.id} — ${order.status}`,
  })
)

Extended fields participate in the same schema as the generated ones. They share the scope-auth scopes, the scalars, and the validation plugin. Keep extensions additive. The generated types are regenerated when a table changes, so put your additions in your own modules rather than editing generated files.

For entirely new root fields rather than extensions of existing types, see custom queries and mutations.

Previous page

Custom Queries & Mutations

Next page

CORS Configuration