Search the site
BACKEND
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
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
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.
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.
# pubspec.yaml
dartvel:
api:
graphql:
maxDepth: 8
introspection: authenticated
persistedQueries: preferCopy code to clipboard
maxDepth and maxCost take a number or auto.
introspection is development, never or authenticated.
persistedQueries is off, prefer or require.
dartvel import openapi openapi.yaml --dry-run
dartvel import postman collection.jsonCopy code to clipboard
Built
Spec section: APIs
FSL-1.1-MIT licensed. Built with Dartvel.
Dartvel is made by
To the bottom