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; }",
":root { raw-sql: disabled; generic-table: disabled; }"
]
},
"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 keymodelUser-context key for tenant ID (default: tenant_id)
auto-filtercolumn:claim[,column:claim]tableInject filters from arbitrary user-context claims
auto-filter-bypass-rolerole namemodelRole that bypasses auto-filter rules
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
joinjoin declarationtable/columnDeclare explicit relationships
many-to-manyTargetTable:JunctionTabletableDeclare a many-to-many relationship
auto-jointrue/falsemodel/tableEnable automatic join inference
foreign-joinstrue/falsemodelEnable FK-based join inference
dynamic-joinstrue/falsemodelEmit _join / _single containers
default-limitnumbermodel/tableDefault page size
de-pluralizetrue/falsemodelDe-pluralize table names in schema
batch-max-sizenumbertableMaximum batch mutation size
PropertyValuesApplies toDescription
raw-sqlenabled/disabledmodelExpose _rawQuery(sql:, params:, timeout:)
raw-sql-rolerole namemodelRole required for _rawQuery (default: bifrost-raw-sql)
raw-sql-timeoutsecondsmodelMax raw SQL timeout
raw-sql-max-rowsnumbermodelMax rows returned by raw SQL
generic-tableenabled/disabledmodelExpose _table(name:, limit:, offset:, filter:)
generic-table-rolerole namemodelRole required for _table (default: bifrost-admin)
generic-table-max-rowsnumbermodelMax rows returned by _table
generic-table-allowedcomma listmodelAllow-list for generic table names
generic-table-deniedcomma listmodelDeny-list for generic table names
schema-prefixenabled/disabledmodelPrefix GraphQL table names with schema names
schema-prefix-defaultschema namemodelSchema left unprefixed when prefixing is enabled
schema-prefix-formatformat stringmodelCustom schema prefix format
schema-displayflat/prefix/fieldmodelMulti-schema presentation mode
schema-defaultschema namemodelDefault schema for field-mode presentation
schema-excludedcomma listmodelSchemas hidden from schema-field presentation
schema-permissionsrulesmodelSchema-field access rules
sp-includeregexmodelInclude matching stored procedures
sp-excluderegexmodelExclude matching stored procedures
auto-detect-appdisabled, wordpress, etc.modelControl app-schema detection
app-schemadetector namemodelForce a specific app-schema detector
detected-appdetector namemodelRead-only detection result metadata
PropertyValuesApplies toDescription
eav-parenttable nametableParent table for an EAV meta table
eav-fkcolumn nametableFK from EAV table to parent
eav-keycolumn nametableEAV attribute-name column
eav-valuecolumn nametableEAV attribute-value column
fileconfig stringcolumnMark column as a file-storage column
file-storageconfig stringcolumnLegacy file-storage marker
storageconfig stringmodel/table/columnStorage bucket configuration
max-sizebytescolumnMax file size
content-type-columncolumn namecolumnColumn storing MIME type
file-name-columncolumn namecolumnColumn storing original filename
acceptMIME patterncolumnAccepted upload MIME types
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