@gqloom/zod v0.10.0
GQLoom
GQLoom is a Code-First GraphQL Schema Loom used to weave runtime types in the TypeScript/JavaScript ecosystem into GraphQL Schema, helping you build GraphQL server enjoyably and efficiently.
Runtime validation libraries such as Zod, Valibot, and Yup have been widely used in backend application development. Meanwhile, when using ORM libraries like Prisma, MikroORM, and Drizzle, we also pre-define database table structures or entity models that contain runtime types. The responsibility of GQLoom is to weave these runtime types into a GraphQL Schema.
When developing backend applications with GQLoom, you only need to write types using the Schema libraries you're familiar with. Modern Schema libraries will infer TypeScript types for you, and GQLoom will weave GraphQL types for you.
In addition, the resolver factory of GQLoom can create CRUD interfaces for Prisma, MikroORM, and Drizzle, and supports custom input and adding middleware.
@gqloom/zod
This package provides GQLoom integration with Zod to weave Zod Schema to GraphQL Schema.
Hello World
import { resolver, query, weave } from "@gqloom/core"
import { ZodWeaver } from "@gqloom/zod"
import { zod } from "zod"
const helloResolver = resolver({
hello: query(z.string())
.input({ name: z.string().nullish() })
.resolve(({ name }) => `Hello, ${name ?? "World"}!`),
})
export const schema = weave(ZodWeaver, helloResolver)Read more at GQLoom Document.
10 months ago
8 months ago
9 months ago
10 months ago
12 months ago
11 months ago
12 months ago
8 months ago
8 months ago
11 months ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago