Skip to content

Repository files navigation

GraphDL - Graph Definition Language

GraphDL is a graph-based data language for describing data models and data relationships. It was designed as a full-stack declarative language for a post-ChatGPT world.

erDiagram
Graph ||--o{ Noun : has
Graph ||--o{ Verb : has
Noun ||--o{ Resource : has
Verb }o--|| Action : does
Verb ||--|| Noun : subject
Verb ||--|| Noun : object
Action ||--|| Resource : subject
Action ||--|| Resource : object
Verb ||--|| Trigger : triggers
Trigger ||--o{ Event : has
Loading
Graph:
nouns: [Noun.graph]verbs: [Verb.graph]triggers: [Trigger.graph]roles: [Role.graph]tenant: Tenant.graphsNoun:
graph: Graph.nounssubjectOf: [Verb->subject]objectOf: [Verb->object]instances: [Resource->type]Resource:
type: Noun.instancessubjectOf: [Action->subject]objectOf: [Action->object]data: DataVerb:
graph: Graph.verbsactions: [Action->verb]triggers: [Trigger->verb]function: FunctionAction:
subject: Resource.subjectOfverb: Verb.actionsobject: Resource.objectOfevents: [Event->action]Trigger:
graph: Graph.triggersverb: Verb.triggerevents: [Event->trigger]Event:
trigger: Trigger.eventsaction: Action.eventsRole:
graph: Graph.rolesusers: [User->role]Tenant: graphs: [Graph->tenant]users: [User->tenants]admins: [User->adminOf]owners: [User->ownerOf]User:
roles: [Role.users]tenants: [Tenant.users]adminOf: [Tenant.admins]ownerOf: [Tenant.owners]
User:
_id: email_name: ${name} <${email}>_icon: 🧑_sameAs: https://schema.org/Personname: nameemail: emailimage: urlposts: [Post.author]Post:
_id: slugify(Title)_name: title_icon: 📋_sameAs: https://schema.org/BlogPostingtitle: namedescription: descriptiontags: [string]content: articleBodycreatedAt: dateCreatedcreatedBy: creatorauthor: User.Email

GraphDL

_visibility: publicCountry:
_plural: Countries_source: https://json.fyi/countries.json_id: cca2_name: name.common_icon: 🌎borders: [Country.cca3]Colo:
_id: iata_source: https://speed.cloudflare.com/locations_name: ${iata} - ${city}, ${cca2->name.common}, ${region}_icon: ☁️cca2: Country.cca2region: Continent._idiata: Airport.iataAirport:
_source: https://json.fyi/airports.json_id: icao_icon: ✈️tz: TimeZone._idcountry: Country.cca2Request:
_id: ${headers.cf-ray}-${headers.cf-ray}_name: ${method} ${url} ${ip} ${cf.city} ${cf.region} ${cf.country->name.common} ${cf.asOrganization}_icon: 🧑‍💻_visibility: admincf.colo: Colo.iatacf.country: Country.cca2coordinates: GeoPoint(cf.latitude,cf.longitude)cf.timezone: TimeZone._id
_name: Northwind_seed: https://json.fyi/northwind.json_defaultId: entityId_constraints: trueCategory:
_name: ${categoryName} - ${description}Customer:
_name: companyName_icon: Employee:
_name: ${firstname} ${lastname}, ${title}EmployeeTerritory:
_name: territoryCodeemployeeId: EmployeeterritoryCode: Territory.territoryCodeOrderDetail:
_name: ${quantity} ${productId->name}orderId: OrderproductId: ProductProduct:
_name: productNamecategoryId: CategorysupplierId: SupplierSalesOrder:
_name: ${date(orderDate)} - ${count(<-OrderDetail)} ItemscustomerId: CustomeremployeeId: EmployeeshipperId: ShipperShipper:
_name: companyNameSupplier:
_name: companyNameRegion:
_name: regiondescriptionTerritory:
regionId: Region
_id: data.vin_name: 📖 Vehicle DataVehicle:
_id: vin_icon: 🚘vin: vinyear: ModelYear.yearmake: Make.makemodel: Model.modeltrim: Trim.trimstyle: Style.styleMake:
_id: slugify(make)_name: makemake: stringlogo: https://cdn.driv.ly/logos/${slugify(make)}.pngblurb: markdownyears: [ModelYear.year]models: [Model.name]Model:
_id: slugify(${make}-${model})_name: ${make} ${model}make: stringmodel: stringModelYear:
_id: slugify(${year}-${make}-${model})_name: ${year} ${make} ${model}year: integermake: stringmodel: stringTrim:
_id: slugify(${year}-${make}-${model}-${trim})_name: ${year} ${make} ${model} ${trim}year: integermake: stringmodel: stringtrim: stringStyle:
_id: slugify(${year}-${make}-${model}-${trim}-${style})_name: ${year} ${make} ${model} ${trim} ${style}year: integermake: stringmodel: stringtrim: stringstyle: string

_items are parsed as - ${_name}{[${_icon} ${_name}]: ${_description} (${_domain})} and _id is slugify(_name)

_id: apis.vin_graph: Affiliate.monetizes: TransactionDeveloper.facilitates: TransactionPartner.createsVirtual: DealerDealer.sells: VehicleConsumer.buys: VehicleConsumer.trades: VehicleConsumer.finances: VehicleLender.liens: VehicleData:
_items:
🚘 Vehicle🏭 Manufacturer🏬 Dealer🚙 Listing💰 Auction🏛️ Tax🧾 Transaction📈 MarketServices:
_items:
🧑‍💼 Concierge:
✅ Inspection:
✨ Reconditioning⚙️ Mechanical💸 Financing☂️ Insurance💰 Auction🏦 Lending☑️ Lien⚖️ Arbitration🗄️ Backoffice📑 Contracting✍️ eSign🙋 Notary🧾 Title🏛️ Registration🔨 Body💧 Paint🧼 Wash🧽 Detail🚛 Transport🎉 Delivery🚙 Valet🛠️ MaintenanceCommerce:
_items:
✍️ Buy💰 Sell🚙 Trade🏢 Broker🚚 DropshipRole:
_items:
💸 Affiliate🏢 Partner🧑‍💻 Developer🧑 Consumer🏬 Dealer🏦 Lender☂️ Insurer💰 Auction🏭 Manufacturer🚀 StartupNoun:
_items:
VehicleTransactionBuyerSellerDealerAuctionManufacturer
erDiagram
CUSTOMER }|..|{ DELIVERY-ADDRESS : has
CUSTOMER ||--o{ ORDER : places
CUSTOMER ||--o{ INVOICE : "liable for"
DELIVERY-ADDRESS ||--o{ ORDER : receives
INVOICE ||--|{ ORDER : covers
ORDER ||--|{ ORDER-ITEM : includes
PRODUCT-CATEGORY ||--|{ PRODUCT : contains
PRODUCT ||--o{ ORDER-ITEM : "ordered in"
Loading
🧑 Customer:
has: [DeliveryAddress]places: [Order]liableFor: [Invoice]🏘️ DeliveryAddress:
receives: [Order]🧾 Invoice:
covers: [Order]💸 Order:
includes: [OrderItem]🚥 ProductCategory:
contains: [Product]📦 Product:
orderedIn: [OrderItem]
erDiagram
CAR ||--o{ NAMED-DRIVER : allows
CAR {
string registrationNumber
string make
string model
}
PERSON ||--o{ NAMED-DRIVER : is
PERSON {
string firstName
string lastName
int age
}
Loading
🚘 Car:
allows: [NamedDriver]registrationNumber: stringmake: stringmodel: string🧑 Person:
is: [NamedDriver]firstName: stringlastName: stringage: integer

About

■●■ GraphDL - The Graph Definition Language

Resources

Stars

4 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages