@effect-gql/core 1.0.0 → 1.1.1

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
@@ -11,7 +11,33 @@ A GraphQL framework for Effect-TS that brings full type safety, composability, a
11
11
  - **Immutable Builder** - Fluent, pipe-able API for composing schemas from reusable parts
12
12
  - **Service Integration** - Use Effect's Layer system for dependency injection
13
13
 
14
- ## Installation
14
+ ## Getting Started
15
+
16
+ The easiest way to get started is with the CLI:
17
+
18
+ ```bash
19
+ # Create a new project
20
+ npx @effect-gql/cli create my-api --server-type node
21
+
22
+ # Start the dev server
23
+ cd my-api
24
+ npm run dev
25
+ ```
26
+
27
+ Your GraphQL server will be running at http://localhost:4000/graphql with a GraphiQL playground at http://localhost:4000/graphiql.
28
+
29
+ ### Server Types
30
+
31
+ The CLI supports multiple server runtimes:
32
+
33
+ | Type | Command | Best For |
34
+ |------|---------|----------|
35
+ | Node.js | `--server-type node` | General Node.js deployments |
36
+ | Bun | `--server-type bun` | Bun runtime with native WebSocket support |
37
+ | Express | `--server-type express` | Integrating into existing Express apps |
38
+ | Web | `--server-type web` | Cloudflare Workers, Deno, edge runtimes |
39
+
40
+ ## Manual Installation
15
41
 
16
42
  ```bash
17
43
  npm install @effect-gql/core effect graphql
package/builder/index.cjs CHANGED
@@ -800,7 +800,14 @@ var GraphQLSchemaBuilder = class _GraphQLSchemaBuilder {
800
800
  * Register an object type from a schema
801
801
  */
802
802
  objectType(config) {
803
- const { schema, implements: implementsInterfaces, directives, cacheControl, fields } = config;
803
+ const {
804
+ schema,
805
+ description,
806
+ implements: implementsInterfaces,
807
+ directives,
808
+ cacheControl,
809
+ fields
810
+ } = config;
804
811
  const name = config.name ?? getSchemaName(schema);
805
812
  if (!name) {
806
813
  throw new Error(
@@ -808,7 +815,14 @@ var GraphQLSchemaBuilder = class _GraphQLSchemaBuilder {
808
815
  );
809
816
  }
810
817
  const newTypes = new Map(this.state.types);
811
- newTypes.set(name, { name, schema, implements: implementsInterfaces, directives, cacheControl });
818
+ newTypes.set(name, {
819
+ name,
820
+ schema,
821
+ description,
822
+ implements: implementsInterfaces,
823
+ directives,
824
+ cacheControl
825
+ });
812
826
  let newObjectFields = this.state.objectFields;
813
827
  if (fields) {
814
828
  newObjectFields = new Map(this.state.objectFields);
@@ -1177,6 +1191,7 @@ var GraphQLSchemaBuilder = class _GraphQLSchemaBuilder {
1177
1191
  const implementedInterfaces = typeReg.implements?.map((name) => interfaceRegistry.get(name)).filter(Boolean) ?? [];
1178
1192
  const graphqlType = new graphql.GraphQLObjectType({
1179
1193
  name: typeName,
1194
+ description: typeReg.description,
1180
1195
  fields: () => {
1181
1196
  const baseFields = schemaToFields(typeReg.schema, sharedCtx);
1182
1197
  const additionalFields = this.state.objectFields.get(typeName);