# singhdhairya17/querysmith architecture

> Architecture diagram of the GitHub repository singhdhairya17/querysmith, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/singhdhairya17/querysmith
- Repository: https://github.com/singhdhairya17/querysmith

## Overview

querysmith is an Angular GraphQL query-building app. The main workflow is endpoint and header entry, schema introspection, field and argument selection, query/variable generation, then testing or executing the request and displaying its response. The graph includes the documented mutation, custom-header, nested-field, and editable-query capabilities. Source excerpts show the key calls; peripheral implementation details and the local proxy server’s runtime wiring are not expanded.

Main entry points: [`src/app/graphql-query-builder/components/graphql-query-builder.component.ts`](https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/components/graphql-query-builder.component.ts) (Builder UI), [`src/app/graphql-query-builder/services/graphql-metadata.service.ts`](https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/services/graphql-metadata.service.ts) (Schema metadata), [`src/app/graphql-query-builder/services/graphql-query-validator.service.ts`](https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/services/graphql-query-validator.service.ts) (Test and execute), [`src/app/graphql-query-builder/components/graphql-field-tree.component.ts`](https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/components/graphql-field-tree.component.ts) (Field tree)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_demo["Demo shell"]
  node_demo["Demo page<br/>[app.component.ts]"]
end

subgraph group_builder["Query builder"]
  node_builder["Builder UI"]
  node_fieldtree["Field tree"]
  node_arguments["Argument editor"]
  node_querygen["Query generation"]
end

subgraph group_schema["Schema discovery"]
  node_metadata["Schema metadata"]
  node_metamodel["Schema model"]
end

subgraph group_requests["Request handling"]
  node_querymodel["Query payload model"]
  node_validator["Test and execute"]
  node_headers["HTTP headers"]
  node_gatewayutil["Gateway request mapping"]
  node_gatewayconfig["Gateway token"]
  node_result["Response and errors"]
end

node_user(("Builder user"))
node_endpoint(("GraphQL endpoint"))

node_user -->|"opens"| node_demo
node_demo -->|"renders"| node_builder
node_user -.->|"configures"| node_builder
node_builder -->|"loads schema"| node_metadata
node_metadata -->|"introspects"| node_endpoint
node_metadata -->|"resolves POST"| node_gatewayutil
node_metadata -->|"builds headers"| node_headers
node_metadata -->|"reads gateway"| node_gatewayconfig
node_metadata -->|"normalizes into"| node_metamodel
node_builder -->|"renders"| node_fieldtree
node_fieldtree -->|"loads children"| node_metadata
node_fieldtree -->|"uses field nodes"| node_metamodel
node_builder -->|"renders"| node_arguments
node_builder -->|"generates document"| node_querygen
node_querygen -->|"reads fields"| node_metamodel
node_querygen -->|"builds payload"| node_querymodel
node_builder -->|"tests query"| node_validator
node_builder -->|"submits payload"| node_querymodel
node_validator -->|"resolves POST"| node_gatewayutil
node_validator -->|"builds headers"| node_headers
node_validator -->|"reads gateway"| node_gatewayconfig
node_validator -->|"posts query"| node_endpoint
node_validator -->|"maps response"| node_result
node_user -->|"edits document"| node_builder
node_builder -->|"executes query"| node_validator

click node_demo "https://github.com/singhdhairya17/querysmith/blob/main/src/app/app.component.ts"
click node_builder "https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/components/graphql-query-builder.component.ts"
click node_fieldtree "https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/components/graphql-field-tree.component.ts"
click node_arguments "https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/components/graphql-argument-editor.component.ts"
click node_metadata "https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/services/graphql-metadata.service.ts"
click node_metamodel "https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/models/graphql-metadata.model.ts"
click node_querygen "https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/services/graphql-query-builder.service.ts"
click node_querymodel "https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/models/graphql-query.model.ts"
click node_validator "https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/services/graphql-query-validator.service.ts"
click node_headers "https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/graphql-http-headers.util.ts"
click node_gatewayutil "https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/graphql-gateway-request.util.ts"
click node_gatewayconfig "https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/graphql-http-gateway.token.ts"
click node_result "https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/models/graphql-query.model.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_demo,node_user toneBlue
class node_builder,node_fieldtree,node_arguments,node_querygen toneAmber
class node_metadata,node_metamodel toneMint
class node_querymodel,node_validator,node_headers,node_gatewayutil,node_gatewayconfig,node_result toneRose
class node_endpoint toneIndigo
```

## Components

### Demo shell

- [Demo page](https://github.com/singhdhairya17/querysmith/blob/main/src/app/app.component.ts): `src/app/app.component.ts`

### Query builder

- [Builder UI](https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/components/graphql-query-builder.component.ts): `src/app/graphql-query-builder/components/graphql-query-builder.component.ts`
- [Field tree](https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/components/graphql-field-tree.component.ts): `src/app/graphql-query-builder/components/graphql-field-tree.component.ts`
- [Argument editor](https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/components/graphql-argument-editor.component.ts): `src/app/graphql-query-builder/components/graphql-argument-editor.component.ts`
- [Query generation](https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/services/graphql-query-builder.service.ts): `src/app/graphql-query-builder/services/graphql-query-builder.service.ts`

### Schema discovery

- [Schema metadata](https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/services/graphql-metadata.service.ts): `src/app/graphql-query-builder/services/graphql-metadata.service.ts`
- [Schema model](https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/models/graphql-metadata.model.ts): `src/app/graphql-query-builder/models/graphql-metadata.model.ts`

### Request handling

- [Query payload model](https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/models/graphql-query.model.ts): `src/app/graphql-query-builder/models/graphql-query.model.ts`
- [Test and execute](https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/services/graphql-query-validator.service.ts): `src/app/graphql-query-builder/services/graphql-query-validator.service.ts`
- [HTTP headers](https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/graphql-http-headers.util.ts): `src/app/graphql-query-builder/graphql-http-headers.util.ts`
- [Gateway request mapping](https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/graphql-gateway-request.util.ts): `src/app/graphql-query-builder/graphql-gateway-request.util.ts`
- [Gateway token](https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/graphql-http-gateway.token.ts): `src/app/graphql-query-builder/graphql-http-gateway.token.ts`
- [Response and errors](https://github.com/singhdhairya17/querysmith/blob/main/src/app/graphql-query-builder/models/graphql-query.model.ts): `src/app/graphql-query-builder/models/graphql-query.model.ts`

### Other components

- **Builder user**
- **GraphQL endpoint**

## Connections

- Builder user → Demo page: opens (evidence: `src/app/app.component.ts`)
- Demo page → Builder UI: renders (evidence: `src/app/app.component.ts`)
- Builder user → Builder UI: configures (evidence: `README.md`)
- Builder UI → Schema metadata: loads schema (evidence: `src/app/graphql-query-builder/components/graphql-query-builder.component.ts`)
- Schema metadata → GraphQL endpoint: introspects (evidence: `src/app/graphql-query-builder/services/graphql-metadata.service.ts`)
- Schema metadata → Gateway request mapping: resolves POST (evidence: `src/app/graphql-query-builder/services/graphql-metadata.service.ts`)
- Schema metadata → HTTP headers: builds headers (evidence: `src/app/graphql-query-builder/services/graphql-metadata.service.ts`)
- Schema metadata → Gateway token: reads gateway (evidence: `src/app/graphql-query-builder/services/graphql-metadata.service.ts`)
- Schema metadata → Schema model: normalizes into (evidence: `src/app/graphql-query-builder/services/graphql-metadata.service.ts`)
- Builder UI → Field tree: renders (evidence: `src/app/graphql-query-builder/components/graphql-query-builder.component.ts`)
- Field tree → Schema metadata: loads children (evidence: `src/app/graphql-query-builder/components/graphql-field-tree.component.ts`)
- Field tree → Schema model: uses field nodes (evidence: `src/app/graphql-query-builder/components/graphql-field-tree.component.ts`)
- Builder UI → Argument editor: renders (evidence: `src/app/graphql-query-builder/components/graphql-query-builder.component.ts`)
- Builder UI → Query generation: generates document (evidence: `src/app/graphql-query-builder/components/graphql-query-builder.component.ts`)
- Query generation → Schema model: reads fields (evidence: `src/app/graphql-query-builder/services/graphql-query-builder.service.ts`)
- Query generation → Query payload model: builds payload (evidence: `src/app/graphql-query-builder/services/graphql-query-builder.service.ts`)
- Builder UI → Test and execute: tests query (evidence: `src/app/graphql-query-builder/components/graphql-query-builder.component.ts`)
- Builder UI → Query payload model: submits payload (evidence: `src/app/graphql-query-builder/components/graphql-query-builder.component.ts`)
- Test and execute → Gateway request mapping: resolves POST (evidence: `src/app/graphql-query-builder/services/graphql-query-validator.service.ts`)
- Test and execute → HTTP headers: builds headers (evidence: `src/app/graphql-query-builder/services/graphql-query-validator.service.ts`)
- Test and execute → Gateway token: reads gateway (evidence: `src/app/graphql-query-builder/services/graphql-query-validator.service.ts`)
- Test and execute → GraphQL endpoint: posts query (evidence: `src/app/graphql-query-builder/services/graphql-query-validator.service.ts`)
- Test and execute → Response and errors: maps response (evidence: `src/app/graphql-query-builder/services/graphql-query-validator.service.ts`)
- Builder user → Builder UI: edits document (evidence: `README.md`)
- Builder UI → Test and execute: executes query (evidence: `README.md`)
