@gqloom/core 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,35 +2,38 @@
2
2
 
3
3
  # GQLoom
4
4
 
5
- GQLoom is a GraphQL weaver for TypeScript/JavaScript that weaves GraphQL Schema using Valibot, Zod, or Yup, and supports sophisticated type inference to provide the best development experience.
5
+ GQLoom is a **Code First** GraphQL Schema Loom used to weave **runtime types** in the **TypeScript/JavaScript** ecosystem into a GraphQL Schema.
6
6
 
7
- The design of GQLoom is inspired by [tRPC](https://trpc.io/), [TypeGraphQL](https://typegraphql.com/), [Pothos](https://pothos-graphql.dev/).
7
+ Runtime validation libraries such as [Zod](https://zod.dev/), [Valibot](https://valibot.dev/), and [Yup](https://github.com/jquense/yup) have been widely used in backend application development. Meanwhile, when using ORM libraries like [Prisma](https://www.prisma.io/), [MikroORM](https://mikro-orm.io/), and [Drizzle](https://orm.drizzle.team/), we also pre - define database table structures or entity models that contain runtime types.
8
+ The responsibility of GQLoom is to weave these runtime types into a GraphQL Schema.
8
9
 
9
- ## Features
10
-
11
- - 🚀 GraphQL: flexible and efficient, reducing redundant data transfers;
12
- - 🔒 Robust type safety: enjoy intelligent hints at development time to detect potential problems at compile time;
13
- - 🔋 Ready to go: middleware, contexts, subscriptions, federated graphs are ready to go;
14
- - 🔮 No extra magic: no decorators, no metadata and reflection, no code generation, you just need JavaScript/TypeScript;
15
- - 🧩 Familiar schema libraries: use the schema libraries you already know (Zod, Yup, Valibot) to build GraphQL Schema and validate inputs;
16
- - 🧑‍💻 Develop happily: highly readable and semantic APIs designed to keep your code tidy;
10
+ 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.
11
+ In addition, the **resolver factory** of GQLoom can create CRUD interfaces for `Prisma`, `MikroORM`, and `Drizzle`, and supports custom input and adding middleware.
17
12
 
18
13
  ## Hello World
19
14
 
20
15
  ```ts
21
- import { resolver, query, weave } from "@gqloom/core"
22
- import { ValibotWeaver } from "@gqloom/valibot"
16
+ import { resolver, query, ValibotWeaver } from "@gqloom/valibot"
23
17
  import * as v from "valibot"
24
18
 
25
19
  const helloResolver = resolver({
26
- hello: query(v.string(), () => "world"),
20
+ hello: query(v.string())
21
+ .input({ name: v.nullish(v.string(), "World") })
22
+ .resolve(({ name }) => `Hello, ${name}!`),
27
23
  })
28
24
 
29
- export const schema = weave(ValibotWeaver, helloResolver)
25
+ export const schema = ValibotWeaver.weave(helloResolver)
30
26
  ```
31
27
 
32
- Read [Introduction](https://gqloom.dev/guide/introduction.html) to learn more about GQLoom.
28
+ ## Highlights you should not miss
29
+
30
+ - 🧑‍💻 **Development Experience**: Fewer boilerplate codes, semantic API design, and extensive ecosystem integration make development enjoyable.
31
+ - 🔒 **Type Safety**: Automatically infer types from the Schema, enjoy intelligent code completion during development, and detect potential problems during compilation.
32
+ - 🎯 **Interface Factory**: Ordinary CRUD interfaces are too simple yet too cumbersome. Let the resolver factory create them quickly.
33
+ - 🔋 **Fully Prepared**: Middleware, context, subscriptions, and federated graphs are ready.
34
+ - 🔮 **No Magic**: Without decorators, metadata, reflection, or code generation, it can run anywhere with just JavaScript/TypeScript.
35
+ - 🧩 **Rich Integration**: Use your most familiar validation libraries and ORMs to build your next GraphQL application.
33
36
 
34
37
  ## Getting Started
35
38
 
36
- See [Getting Started](https://gqloom.dev/guide/getting-started.html) to learn how to use GQLoom.
39
+ See [Getting Started](https://gqloom.dev/guide/getting-started.html) to learn how to use GQLoom.