Skip to main content

Typegraph

Typegraphs are a the main building blocks when we write an app using Metatype. The unit of development and deployment. Think microservices if you will but they're more than a deployment approach to code. They're composed with sets of types, their relation to each other, their relation to external types/APIs, the functions on these types, the details of how these functions are exposed to the world and more.

SDK

The typegates only know of and accept typegraphs in their serialized format. But for authoring typegraphs, we make use of SDK libraries available in different languages.

Typegraph version

Install the @typegraph/sdk package from npm using your preferred package manager and runtime. The SDK requires Node 16+ with Typescript 4.7+, Deno 1.28+ or Bun 1+.

# using pnpm
pnpm add @typegraph/sdk

# using npm
npm install @typegraph/sdk

# using yarn
yarn add @typegraph/sdk

# using Deno
import { ... } from "npm:@typegraph/sdk/mod.ts";

# using Bun
bun add @typegraph/sdk

When using Node, make sure to add this to your Typescript configuration:

    "moduleResolution": "node16", // Or "nodenext"