# dolifer/ngql architecture

> Architecture diagram of the GitHub repository dolifer/ngql, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dolifer/ngql
- Repository: https://github.com/dolifer/ngql

## Overview

##### Main Components Identification

The system should be represented with these key components:

a) Core Library Layer:
- Query Builder Components
- Mutation Builder Components
- Text Generation System
- Variable Management

b) Server Implementation Layer:
- GraphQL Schema Definition
- Command Handlers
- Data Access Layer

##### Component Relationships

a) Data Flow:
- Query/Mutation Builder → QueryTextBuilder → Generated GraphQL String
- Server Schema → Core Query Builder
- Command Handlers → Core Mutation Builder

##### Technical Details

Annotations showing:
- .NET Core compatibility
- GraphQL query/mutation support
- String building optimization (noted from benchmark tests)

**┌─────────────────────────────────────────┐**
- Client Usage               │
- ┘
- ↓
**┌─────────────────────────────────────────┐**
- Server Implementation        │
- ┌─────────┐  ┌─────────┐  ┌────────┐  │
- Schema  │  │Commands │  │  Data  │  │
- ┘  └─────────┘  └────────┘  │
- ┘
- ↓
**┌─────────────────────────────────────────┐**
- Core Library               │
- ┌─────────┐  ┌─────────┐  ┌────────┐  │
- Query   │  │Mutation │  │Variable │  │
- ┘  └─────────┘  └────────┘  │
- ┘

##### Additional Elements

Include:
- Version/compatibility information
- Integration points with GraphQL servers
- Test coverage indicators

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        CL[Client Application]
    end

    subgraph "Server Implementation Layer"
        Schema["GraphQL Schema Definition"]
        CommandH["Command Handlers"]
        DataAccess["Data Access Layer"]
        Models["Entity Models"]
        SchemaTypes["Schema Types"]
    end

    subgraph "Core Library Layer"
        QB["Query Builder"]:::core
        MB["Mutation Builder"]:::core
        TG["Query Text Builder"]:::core
        VM["Variable Management"]:::core
        VF["Value Formatter"]:::core
        CA["Core Abstractions"]:::core
    end

    %% Relationships
    CL --> Schema
    Schema --> QB
    Schema --> MB
    CommandH --> QB
    CommandH --> MB
    DataAccess --> Models
    Schema --> SchemaTypes
    
    QB --> TG
    MB --> TG
    TG --> VM
    TG --> VF
    QB --> CA
    MB --> CA

    %% Click Events
    click QB "https://github.com/dolifer/NGql/blob/main/src/Core/Query.cs"
    click MB "https://github.com/dolifer/NGql/blob/main/src/Core/Mutation.cs"
    click TG "https://github.com/dolifer/NGql/blob/main/src/Core/QueryTextBuilder.cs"
    click VM "https://github.com/dolifer/NGql/blob/main/src/Core/Variable.cs"
    click VF "https://github.com/dolifer/NGql/blob/main/src/Core/ValueFormatter.cs"
    click Schema "https://github.com/dolifer/NGql/blob/main/src/Server/Schema/DemoSchema.cs"
    click CommandH "https://github.com/dolifer/NGql/tree/main/src/Server/Commands"
    click DataAccess "https://github.com/dolifer/NGql/tree/main/src/Server/Data"
    click Models "https://github.com/dolifer/NGql/blob/main/src/Server/Data/Entities/User.cs"
    click SchemaTypes "https://github.com/dolifer/NGql/tree/main/src/Server/Schema"
    click CA "https://github.com/dolifer/NGql/blob/main/src/Core/Abstractions/QueryBlock.cs"

    %% Styling
    classDef core fill:#2374ab,stroke:#2374ab,color:#fff
    classDef server fill:#57a773,stroke:#57a773,color:#fff
    classDef external fill:#808080,stroke:#808080,color:#fff

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[Server Components]:::server
        L3[External Interface]:::external
    end
```
