Financial, logistics, AI vectors, network, geographicβvalidated at the GraphQL layer.
IBAN β’ VIN β’ Vector β’ ISIN β’ Coordinate β’ LTree β’ UUID β’ PhoneNumber β’ and 43 more...
FraiseQL includes 51 built-in scalar types with validation, PostgreSQL integration, and GraphQL operators. From network addresses to financial identifiers to AI embeddingsβall validated at the GraphQL layer before hitting your database.
IpAddress - IPv4/IPv6 with subnet operatorsCIDR - Network ranges (10.0.0.0/8)MacAddress - Hardware addressesPort - Network ports (1-65535)Hostname - RFC 1123 compliantDomainName - DNS domain namesURL - Valid URLs with protocolMoney - NUMERIC(19,4) precisionCurrencyCode - ISO 4217 (USD, EUR)ExchangeRate - High-precision ratesIBAN - Bank accounts (mod-97 validated)ISIN - Securities identificationCUSIP - US/Canada securitiesSEDOL - UK securitiesLEI - Legal Entity IdentifiersStockSymbol - Ticker symbolsMIC - Market Identifier CodesExchangeCode - Stock exchangesPercentage - 0.00-100.00 valuesCoordinate - Lat/lng with distance queriesLatitude - -90 to +90 degreesLongitude - -180 to +180 degreesLTree - Hierarchical paths (usa.ca.sf)AirportCode - IATA codes (LAX, JFK)PortCode - Seaport codes (UN/LOCODE)PostalCode - Postal/ZIP codesTimezone - IANA timezone IDsDate - ISO 8601 calendar dateDateTime - Timezone-aware timestampsTime - Time of dayDateRange - Date ranges with overlapDuration - Time intervalsTimezone - IANA timezone databaseVIN - Vehicle ID (ISO 3779 check digit)LicensePlate - Vehicle platesTrackingNumber - Shipping trackingContainerNumber - ISO 6346 containersFlightNumber - Airline flightsAirportCode - IATA airport codesPortCode - UN/LOCODE seaportsVector - pgvector embeddingsHalfVector - 16-bit vectors (50% memory)SparseVector - High-dimensional sparseJSON - Arbitrary JSON dataHashSHA256 - Content hashesUUID - RFC 4122 identifiersApiKey - API key format validationHashSHA256 - 64-char hex hashesSlug - URL-safe identifiersEmailAddress - RFC 5322 emailsPhoneNumber - E.164 formatMarkdown - Markdown textHTML - HTML contentURL - Valid URLsMimeType - MIME types (image/png)Image - Image file referencesFile - File referencesColor - Hex color codesLanguageCode - ISO 639-1 (en, fr, de)LocaleCode - BCP 47 (en-US, fr-FR)CurrencyCode - ISO 4217 currenciesTimezone - IANA timezonesPostalCode - Country-aware postalSemanticVersion - SemVer (1.2.3)Every type includes: GraphQL validation β’ PostgreSQL type mapping β’ Filtering operators β’ Error messages
from fraiseql import fraiseql
from fraiseql.types.scalars import IPv4Address, IPv6Address
@fraiseql.type
class Server:
id: int
hostname: str
ipv4: IPv4Address
ipv6: IPv6Address
location: str
# Find all servers in a subnet
{
servers(where: {
ipv4: { inSubnet: "10.0.0.0/8" }
}) {
hostname
ipv4
location
}
}
# Find private IP addresses
{
servers(where: {
ipv4: { isPrivate: true }
}) {
hostname
ipv4
}
}
# Find loopback addresses
{
servers(where: {
ipv4: { isLoopback: true }
}) {
hostname
ipv4
}
}
-- FraiseQL generates type-aware PostgreSQL
SELECT * FROM tb_server
WHERE ipv4::inet << '10.0.0.0/8'::inet;
SELECT * FROM tb_server
WHERE inet_is_private(ipv4::inet);
SELECT * FROM tb_server
WHERE host(ipv4::inet) = '127.0.0.1';
-- Native PostgreSQL type casting and functions β
from fraiseql import fraiseql
from fraiseql.types.scalars import LTree
@fraiseql.type
class Location:
id: int
name: str
path: LTree # e.g., "usa.california.san_francisco"
@fraiseql.type
class Machine:
id: str
name: str
location: Location
# Find all machines in California (any city)
{
machines(where: {
location: {
path: { ancestor_of: "usa.california.*" }
}
}) {
name
location { name path }
}
}
# Find all US locations
{
locations(where: {
path: { descendant_of: "usa" }
}) {
name
path
}
}
# Pattern matching
{
locations(where: {
path: { matches: "usa.*.san_*" }
}) {
name
path
}
}
-- FraiseQL generates ltree-aware queries
SELECT m.* FROM tb_machine m
JOIN tb_location l ON m.fk_location = l.pk_location
WHERE l.path::ltree @> 'usa.california'::ltree;
SELECT * FROM tb_location
WHERE path::ltree <@ 'usa'::ltree;
SELECT * FROM tb_location
WHERE path::ltree ~ 'usa.*.san_*'::lquery;
-- Hierarchical queries with ltree operators β
from fraiseql import fraiseql
from fraiseql.types.scalars import (
Money, CurrencyCode, IBAN, Percentage
)
@fraiseql.type
class BankAccount:
id: UUID
iban: IBAN # Mod-97 validated
balance: Money # NUMERIC(19,4)
currency: CurrencyCode # ISO 4217
interest_rate: Percentage
from fraiseql.types.scalars import (
ISIN, CUSIP, StockSymbol, MIC, LEI
)
@fraiseql.type
class Security:
id: UUID
isin: ISIN # International ID
cusip: CUSIP # US/Canada ID
symbol: StockSymbol # Ticker (AAPL)
exchange: MIC # Market ID (XNAS)
issuer_lei: LEI # Legal Entity ID
# Invalid IBAN rejected at GraphQL layer
mutation {
createAccount(input: {
iban: "GB82WEST12345698765432"
balance: "10000.00"
currency: "USD"
interestRate: "2.5"
}) {
id
iban
}
}
# Check digit validation prevents typos
# "GB99INVALID" β Error before DB hit
from fraiseql import fraiseql
from fraiseql.types.scalars import Vector, HalfVector
@fraiseql.type
class Document:
id: UUID
title: str
content: str
# 1536-dim OpenAI embeddings
embedding: Vector
# 50% memory with HalfVector
embedding_lite: HalfVector
# Find similar documents
{
documents(
orderBy: {
embedding: {
cosine_distance: $queryVector
}
}
limit: 10
) {
id
title
_distance # Similarity score
}
}
-- pgvector cosine distance
SELECT id, title,
embedding <=> $1 AS _distance
FROM tb_document
ORDER BY embedding <=> $1
LIMIT 10;
-- Uses HNSW or IVFFlat indexes
-- Sub-10ms even with millions of vectors
Vector types: Vector (float32) β’ HalfVector (float16, 50% memory) β’ SparseVector (high-dimensional)
IBAN mod-97, VIN check digits, UUID format. Invalid data rejected before hitting PostgreSQL.
ISO 4217 currencies, ISIN/CUSIP/SEDOL securities, LEI entity identifiers. Built for fintech.
Native pgvector support. Vector, HalfVector, SparseVector for RAG and semantic search.
VIN, container numbers, tracking IDs, airport/port codes. Supply chain ready.
PostgreSQL GiST, GIN, HNSW indexes. Type-aware query optimization.
"Invalid IBAN: check digit mismatch" not "constraint violation". Debugging made simple.
# Network operators
ipv4: {
inSubnet: "10.0.0.0/8" # IP in subnet
isPrivate: true # RFC 1918 private
isLoopback: true # 127.0.0.1
eq: "192.168.1.1" # Exact match
}
# Hierarchical operators
path: {
ancestor_of: "usa.california"
descendant_of: "usa"
matches: "usa.*.san_*"
eq: "usa.california.sf"
}
# Range operators
availability: {
overlaps: ["2024-01-01", "2024-12-31"]
contains: "2024-06-15"
adjacent: ["2024-12-31", "2025-01-01"]
}
# Spatial operators
coordinates: {
eq: "37.7749,-122.4194"
distance_within: {
center: [37.7749, -122.4194]
radius: 5000 # meters
}
}
# Vector distance operators
embedding: {
cosine_distance: $queryVector
l2_distance: $queryVector
inner_product: $queryVector
}
# Common to all scalar types
field: {
eq: "value" # Exact match
ne: "value" # Not equal
in: ["a", "b"] # In list
notin: ["c"] # Not in list
}
| Category | Hasura | PostGraphile | Strawberry | FraiseQL |
|---|---|---|---|---|
| Network (IP/CIDR) | β Strings | β οΈ Limited | β Manual | β 7 types + operators |
| Financial (IBAN/ISIN) | β None | β None | β None | β 12 types validated |
| Vector (pgvector) | β None | β οΈ Plugin | β Manual | β 4 types + distance ops |
| Hierarchical (ltree) | β JSON | β οΈ Plugin | β Manual | β Native + 4 operators |
| Logistics (VIN/Container) | β None | β None | β None | β 7 types check-digit |
| Geographic (Coords) | β οΈ PostGIS | β οΈ PostGIS | β Manual | β 8 types + distance |
| Total Built-in Types | ~10 | ~15 | ~5 | 51+ types |
FraiseQL ships with 51+ validated scalar types. No plugins, no custom code, no manual validation. Domain types like IBAN, VIN, and ISIN include check-digit validation at the GraphQL layer.
Specialized types are a core feature of FraiseQL+