Introduction

■●■ GraphDL - Graph Definition Language

GraphDL is a language for describing data models and relationships and full-stack functionality.

JavaScript code is a native part of GraphDL, and GraphDL Schema is transpiled into a JavaScript Module with full TypeScript support.

Additionally, JSON Schema, OpenAPI, GraphQL, a Website, a React Admin App, and Documentation can also be optionally generated.

graphdl.yaml
✅ ToDo:
    title:       string!
    description: string
    status:      To Do | In Progress | Blocked | Done = To Do
    subtasks:    [ToDo->partOf]
    partOf:      ToDo.subtasks
    assignedTo:  User.assigned = createdBy()
    createdBy:   User.created = createdBy()
 
🧑‍💻 User:
    _sameAs:     https://schema.org/Person
    name:        string
    email:       email!
    toDos:       [ToDo->assignedTo]
    created:     [ToDo->createdBy]

The generated Javascript and Typescript code includes the base data models, as well as Validation logic, List, Search, Create, Update, & Delete logic for client and/or server side use, including APIs,

That can be deployed anywhere including Cloudflare Workers, Deno Deploy, Fly.io, AWS, Azure, GCP or with self-hosted containers

■● Graph

A Graph is a collection of Nouns and Verbs that describe the relationships between Nouns.

■ Noun

A Noun is a person, place, thing, or idea.

● Verb

A Verb connects a Noun to a different Noun, and is expressed as [Subject].[Verb]: [Object].

For example, in User.subscribes: App the verb subscribes connects the Subject User to the Object App.

□ Resource

A Resource is a specific instance of a Noun

○ Action

An [Action] happens when an instance of a [Noun] (i.e. [Resource]) does a [Verb] to a different [Resource].

For example, in User/john.subscribes: App/ToDos the verb subscribes connects the [Subject Resource] User/john to the [Object Resource] App/ToDos.

◆ Trigger

A [Trigger] invokes an [Action] on a [Schedule], when a [Resource] is created, modified, or deleted, or when an [Action] happens.

◇ Event

An [Event] happens whenever a [Trigger] happening at a specific point in time, and can occur at scheduled times, whenever a [Resource] is created, updated, or deleted, or whenever an [Action] happens.

⧆ Query

A [Query] is the input criteria for a [Search] in a [Graph] that may or may not be constrained to a specific [Noun] or [Verb]

⊛ Search

A [Search] is as [Action] that returns a list of [Resources] that match a specific [Query].

入 API

An [API] is a [Function] that can be passed [Data] via a [Request] and returns [Data] in a [Response].

❴❵ Data

[Data] is the information that is stored in a [Resource] in a JSON format.

❪❫ Function

A [Function] is Javascript code that can be placed on a [Verb] is executed when an [Action] happens.

❮❯ UI

A [UI] is JSX code that can be placed on a [Noun] and is executed when a [Resource] is rendered.

☶ Site

A [Site] is a publicly-accesible [UI] and can be deployed to the cloud, and run in the cloud, at the edge, or in a browser

⧉ App

An [App] is an composition of [UI] powered by [APIs] with [Users] and [Tenants], and that can be deployed to the cloud, and run in the cloud, at the edge, in a browser, or on a device.