Skip to content
Docs

Configuration

BifrostQL is configured through appsettings.json (or any ASP.NET Core configuration source). All settings live under the BifrostQL key.

{
"ConnectionStrings": {
"bifrost": "Server=localhost;Database=mydb;User Id=sa;Password=xxx;TrustServerCertificate=True"
},
"BifrostQL": {
"Path": "/graphql",
"Playground": "/graphiql",
"DisableAuth": false,
"Provider": "sqlserver",
"Metadata": [
"dbo.sys* { visibility: hidden; }",
"dbo.*|has(tenant_id) { tenant-filter: tenant_id; }",
"dbo.orders { soft-delete: deleted_at; soft-delete-by: deleted_by_user_id; delete-type: soft; }",
"dbo.*.createdOn { populate: created-on; update: none; }",
"dbo.*.updatedOn { populate: updated-on; update: none; }"
]
},
"JwtSettings": {
"Authority": "https://your-idp.com",
"Audience": "your-api"
}
}
SettingTypeDefaultDescription
ConnectionStrings:bifroststringrequiredDatabase connection string
BifrostQL:Pathstring/graphqlGraphQL endpoint path
BifrostQL:Playgroundstring/graphiqlGraphiQL playground path
BifrostQL:DisableAuthboolfalseDisable authentication checks
BifrostQL:ProviderstringsqlserverDatabase provider: sqlserver, postgres, mysql, sqlite
BifrostQL:Metadatastring[][]Array of metadata configuration rules
BifrostQL:Http3:EnabledboolfalseEnable HTTP/3 (QUIC) support
BifrostQL:Http3:HttpsPortint5001HTTPS port for HTTP/3

Metadata rules use a CSS-like selector syntax to target tables and columns. Each rule has a selector and a block of properties:

"selector { property: value; property: value; }"
PatternMatches
dbo.ordersThe orders table in the dbo schema
dbo.orders.totalThe total column on dbo.orders
dbo.*All tables in the dbo schema
dbo.*.createdOnThe createdOn column on every table in dbo
*.*All tables in all schemas
dbo.sys*Tables starting with sys in dbo
dbo.*.__*Columns starting with __ on all dbo tables
dbo.*|has(tenant_id)Tables in dbo that have a tenant_id column
PropertyValuesApplies toDescription
tenant-filtercolumn nametableEnable tenant isolation on this column
tenant-context-keyclaim keytableJWT claim key for tenant ID (default: tenant_id)
soft-deletecolumn nametableSoft-delete timestamp column
soft-delete-bycolumn nametableColumn recording who deleted
delete-typesofttableMark table for soft-delete behavior
populatesee belowcolumnAuto-populate from user context
updatenonecolumnMake column read-only for updates
visibilityhiddentable/columnHide from GraphQL schema
labelcolumn nametableDisplay label column
auto-jointrue/falsetableEnable automatic join inference
dynamic-joinstrue/falsetableEnable __join fields
default-limitnumbertableDefault page size
de-pluralizetrue/falsetableDe-pluralize table name in schema
ValueDescription
created-byUser audit key (on insert only)
updated-byUser audit key (on insert and update)
created-onCurrent timestamp (on insert only)
updated-onCurrent timestamp (on insert and update)
deleted-onCurrent timestamp (on soft-delete)
deleted-byUser audit key (on soft-delete)

Rules are applied in order. Later rules override earlier ones for the same target. Use broad rules first, then specific overrides:

{
"Metadata": [
"dbo.* { de-pluralize: true; default-limit: 50; }",
"dbo.audit_log { de-pluralize: false; default-limit: 100; }"
]
}
Server=localhost;Database=mydb;User Id=sa;Password=xxx;TrustServerCertificate=True
Host=localhost;Port=5432;Database=mydb;Username=postgres;Password=xxx
Server=localhost;Port=3306;Database=mydb;User=root;Password=xxx
Data Source=path/to/database.db