API Documentation

Complete reference for NormaTrack GraphQL API

API Endpoints

GraphQL Endpoint

POST
POST /api/graphql

Content-Type: application/json

Example Request:

curl -X POST http://localhost:3000/api/graphql \
  -H "Content-Type: application/json" \
  -d '{
    "query": "{ getStatistics { totalProducts totalVariants } }"
  }'

Health Check

GET
GET /api/graphql

Returns API status and endpoint information

Available Queries

products(skip, take, category, search)

Get paginated list of products with optional filters

materials(skip, take, supplier)

Get paginated list of materials with optional supplier filter

variants(skip, take)

Get paginated list of product variants

getStatistics()

Get overall statistics and metrics

companies()

Get list of all companies

certifications(productId?)

Get certifications, optionally filtered by product

Available Mutations

Products

  • createProduct(name, sku, category, brand, ...)
  • updateProduct(id, ...)
  • deleteProduct(id)

Materials

  • createMaterial(name, carbonFootprint, ...)
  • updateMaterial(id, ...)
  • deleteMaterial(id)

Variants

  • createVariant(name, productId, ...)
  • updateVariant(id, ...)
  • deleteVariant(id)

Other Mutations

  • createCompany(...),updateCompany(...),deleteCompany(id)
  • createCertification(...),updateCertification(...),deleteCertification(id)

Getting Started

  1. 1Open the GraphQL Explorer to test queries
  2. 2Use quick query templates to quickly explore data
  3. 3Visit the Dashboard to view data in a user-friendly interface
  4. 4Integrate API endpoints into your applications