GraphQL

Supports GraphQL APIs within your application

Technology

The graphql module provides comprehensive GraphQL API support for Project Forge applications. It enables you to build modern, type-safe GraphQL APIs with an intuitive development interface.

Overview

This module provides:

Key Features

GraphQL Service

Development Tools

Performance & Reliability

Package Structure

Core Services

Controllers

Schema Definition

Usage

Basic Setup

The GraphQL service is automatically wired into app.State. Register schemas and execute queries:

1
2
3
4
5
// Register a schema
as.Services.GraphQL.RegisterSchema("my-api", mySchema)

// Execute a query
result := as.Services.GraphQL.Execute(ctx, "my-api", query, variables)

Schema Development

Define your GraphQL schema using the include system in app/gql/schema.graphql:

1
2
3
4
5
6
7
# scalar Time
# scalar UUID
# include "example.graphql"

type Query {
# Your queries here
}

GraphiQL Interface

Access the interactive GraphiQL interface at /admin/graphql to: - Browse schema documentation - Write and test queries - Explore available types and fields - View query execution results

Configuration

The module works out-of-the-box with no additional configuration required. Schemas are registered programmatically through the service.

Source Code

See Also