This repository compares type-safe API technologies running on Azure Functions, evaluating their developer experience, type safety mechanisms, and configuration complexity.
.graphql schema files with @graphql-codegen for type generation. Traditional GraphQL approach with SDL as source of truth.
TypeScript-first GraphQL schema builder. Type-safe schema construction using Pothos builders.
GraphQL schema generated from Zod validators. Validation library as source of truth.
End-to-end type-safe RPC. Maximum coupling between frontend and backend via TypeScript inference.
Type-safe REST with explicit contract definitions. Shared TypeScript contract between client and server.
Traditional REST with runtime validation. Zod schemas generate OpenAPI spec and TypeScript types.
See Setup Guide for complete project initialization steps.
Location: apps/apollo-graphql
Implementation in progress
api-playground/
├── .vscode/
│ ├── extensions.json
│ └── settings.json
├── apps/
│ ├── apollo-graphql/ # Apollo Server (schema-first)
│ ├── pothos-graphql/ # Pothos (code-first)
│ ├── gqloom-graphql/ # gqloom (Zod-first)
│ ├── trpc/ # tRPC
│ ├── ts-rest/ # ts-rest
│ └── rest-openapi/ # Zod + OpenAPI
├── packages/
│ └── typescript-config/ # Shared TypeScript configs
├── .nvmrc
├── biome.json
├── GitVersion.yml
├── lefthook.yml
├── package.json
├── pnpm-workspace.yaml
└── turbo.json
Packages use JIT (Just-In-Time) types with compiled JavaScript, following Turborepo's TypeScript best practices:
Single entry point:
{
"type": "module",
"exports": {
".": {
"types": "./src/index.ts",
"default": "./dist/index.js"
}
}
}Multiple entry points (wildcard):
{
"type": "module",
"exports": {
"./*": {
"types": "./src/*.ts",
"default": "./dist/*.js"
}
}
}TypeScript consumers get direct .ts source for instant type updates, runtime gets compiled .js. Avoid barrel files.
The type-check task uses a transit node pattern (topo) for fast parallel type checking without waiting for builds to complete, while still respecting topological ordering of dependencies.
@azure/functions- Azure Functions runtimeesbuild- Buildingtsx- TypeScript executionnpm-run-all2- Parallel scripts@dotenvx/dotenvx- Environment management@shellicar/build-version- Version injection
- GraphQL (Apollo):
@apollo/server,@as-integrations/azure-functions,@graphql-codegen/cli - GraphQL (Pothos):
@pothos/core,@pothos/plugin-* - GraphQL (gqloom):
@gqloom/core,@gqloom/zod,zod - tRPC:
@trpc/server,@trpc/client - ts-rest:
@ts-rest/core,@ts-rest/azure-functions - REST:
zod,@asteasolutions/zod-to-openapi