Dartvel, home
Docs
Features
Studio
Cloud
Compared

Search the site

GitHub
pub.dev

GETTING STARTED

Getting started
Existing Flutter apps
Existing Native apps
Run on your phone

APP

UI and styling
Routing
State
Accessibility
Keyboard shortcuts
Localization
Devices and desktop
Native device access
Media, 3D and XR

DATA

Data models
Forms
Search
Sync and offline
Import and export
Change capture
Database
Cache
File storage
Images
Privacy and erasure

BACKEND

Backend functions
Auth and sessions
Authorization
Queues and jobs
Workers and memory
Notifications and mail
Outbound HTTP
AI
Webhooks
GraphQL and OpenAPI
API keys and OAuth
Multi-tenancy
Billing and commerce
Modules

OPERATIONS

Edge security
Secrets and environments
Monitoring
Releases

SHIPPING

Build targets
Telegram Mini Apps
Static web hosting
Servers and deploying

REFERENCE

Testing
CLI reference
Coding agents

BACKEND

GraphQL and OpenAPI

Your models already have a GraphQL API, and your backend functions already have an OpenAPI document.

Both are served by the generated backend with no setup.

The webhook events you send get an AsyncAPI document the same way.

ON THIS PAGE

The endpoints

Query your models

Add your own fields

Set limits

Go the other way: generate a client from a spec

Status

The endpoints

POST /api/graphql

Serves: Queries and mutations

GET /api/graphql/schema

Serves: The schema as SDL

POST /api/graphql/stream

Serves: Subscriptions as server-sent events

GET /api/openapi.json

Serves: OpenAPI 3.1 for your backend functions

GET /api/asyncapi.json

Serves: AsyncAPI 3.0 for the webhook events you send

Query your models

Each model with a key gets a type, list and single queries, and save and delete mutations.

Sensitive fields are left out of the schema.

Every resolver checks the model's policy.

Add your own fields

void registerGraphQL() {
  DVGraphQL.registerQuery(DVGraphQLField(
    'serverTime',
    'String!',
    resolve: (Map<String, Object?> args, Object? parent) =>
        DateTime.now().toIso8601String(),
  ));
}

Copy code to clipboard

DVGraphQLField also takes args, cost, pageSize and policy.

Set limits

# pubspec.yaml
dartvel:
  api:
    graphql:
      maxDepth: 8
      introspection: authenticated
      persistedQueries: prefer

Copy code to clipboard

maxDepth and maxCost take a number or auto.

introspection is development, never or authenticated.

persistedQueries is off, prefer or require.

Go the other way: generate a client from a spec

dartvel import openapi openapi.yaml --dry-run
dartvel import postman collection.json

Copy code to clipboard

Status

Built

Spec section: APIs

PREVIOUS Webhooks Signed events your customers subscribe to
NEXT API keys and OAuth Let other systems call your app's API with scoped keys or OAuth
GitHub
pub.dev
npm
Acknowledgements
Privacy
Terms

FSL-1.1-MIT licensed. Built with Dartvel.

Dartvel is made by

SigmaDev Digital

To the bottom