@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.
@@ -1,5 +1,5 @@
1
- import { D as DirectiveApplication, C as CacheHint, o as FieldComplexity, i as GraphQLSchemaBuilder, M as MiddlewareContext, K as ExecutionArgs, G as GraphQLExtension, F as FieldComplexityMap } from '../schema-builder-Cvdq7Kz_.cjs';
2
- export { h as CacheControlScope, d as DirectiveRegistration, b as EnumRegistration, a as FieldRegistration, f as GraphQLEffectContext, c as InputTypeRegistration, I as InterfaceRegistration, e as MiddlewareRegistration, O as ObjectFieldRegistration, S as SubscriptionFieldRegistration, T as TypeRegistration, g as TypeRegistries, U as UnionRegistration } from '../schema-builder-Cvdq7Kz_.cjs';
1
+ import { D as DirectiveApplication, C as CacheHint, o as FieldComplexity, i as GraphQLSchemaBuilder, M as MiddlewareContext, K as ExecutionArgs, G as GraphQLExtension, F as FieldComplexityMap } from '../schema-builder-DKvkzU_M.cjs';
2
+ export { h as CacheControlScope, d as DirectiveRegistration, b as EnumRegistration, a as FieldRegistration, f as GraphQLEffectContext, c as InputTypeRegistration, I as InterfaceRegistration, e as MiddlewareRegistration, O as ObjectFieldRegistration, S as SubscriptionFieldRegistration, T as TypeRegistration, g as TypeRegistries, U as UnionRegistration } from '../schema-builder-DKvkzU_M.cjs';
3
3
  import { DirectiveLocation, GraphQLResolveInfo, DocumentNode, GraphQLError, ExecutionResult, GraphQLSchema } from 'graphql';
4
4
  export { DirectiveLocation } from 'graphql';
5
5
  import { Effect, Stream, Layer } from 'effect';
@@ -14,6 +14,7 @@ import 'effect/Types';
14
14
  declare const objectType: <A, R2 = never>(config: {
15
15
  name?: string;
16
16
  schema: S.Schema<A, any, any>;
17
+ description?: string;
17
18
  implements?: readonly string[];
18
19
  directives?: readonly DirectiveApplication[];
19
20
  /**
@@ -1,5 +1,5 @@
1
- import { D as DirectiveApplication, C as CacheHint, o as FieldComplexity, i as GraphQLSchemaBuilder, M as MiddlewareContext, K as ExecutionArgs, G as GraphQLExtension, F as FieldComplexityMap } from '../schema-builder-Cvdq7Kz_.js';
2
- export { h as CacheControlScope, d as DirectiveRegistration, b as EnumRegistration, a as FieldRegistration, f as GraphQLEffectContext, c as InputTypeRegistration, I as InterfaceRegistration, e as MiddlewareRegistration, O as ObjectFieldRegistration, S as SubscriptionFieldRegistration, T as TypeRegistration, g as TypeRegistries, U as UnionRegistration } from '../schema-builder-Cvdq7Kz_.js';
1
+ import { D as DirectiveApplication, C as CacheHint, o as FieldComplexity, i as GraphQLSchemaBuilder, M as MiddlewareContext, K as ExecutionArgs, G as GraphQLExtension, F as FieldComplexityMap } from '../schema-builder-DKvkzU_M.js';
2
+ export { h as CacheControlScope, d as DirectiveRegistration, b as EnumRegistration, a as FieldRegistration, f as GraphQLEffectContext, c as InputTypeRegistration, I as InterfaceRegistration, e as MiddlewareRegistration, O as ObjectFieldRegistration, S as SubscriptionFieldRegistration, T as TypeRegistration, g as TypeRegistries, U as UnionRegistration } from '../schema-builder-DKvkzU_M.js';
3
3
  import { DirectiveLocation, GraphQLResolveInfo, DocumentNode, GraphQLError, ExecutionResult, GraphQLSchema } from 'graphql';
4
4
  export { DirectiveLocation } from 'graphql';
5
5
  import { Effect, Stream, Layer } from 'effect';
@@ -14,6 +14,7 @@ import 'effect/Types';
14
14
  declare const objectType: <A, R2 = never>(config: {
15
15
  name?: string;
16
16
  schema: S.Schema<A, any, any>;
17
+ description?: string;
17
18
  implements?: readonly string[];
18
19
  directives?: readonly DirectiveApplication[];
19
20
  /**
package/builder/index.js CHANGED
@@ -778,7 +778,14 @@ var GraphQLSchemaBuilder = class _GraphQLSchemaBuilder {
778
778
  * Register an object type from a schema
779
779
  */
780
780
  objectType(config) {
781
- const { schema, implements: implementsInterfaces, directives, cacheControl, fields } = config;
781
+ const {
782
+ schema,
783
+ description,
784
+ implements: implementsInterfaces,
785
+ directives,
786
+ cacheControl,
787
+ fields
788
+ } = config;
782
789
  const name = config.name ?? getSchemaName(schema);
783
790
  if (!name) {
784
791
  throw new Error(
@@ -786,7 +793,14 @@ var GraphQLSchemaBuilder = class _GraphQLSchemaBuilder {
786
793
  );
787
794
  }
788
795
  const newTypes = new Map(this.state.types);
789
- newTypes.set(name, { name, schema, implements: implementsInterfaces, directives, cacheControl });
796
+ newTypes.set(name, {
797
+ name,
798
+ schema,
799
+ description,
800
+ implements: implementsInterfaces,
801
+ directives,
802
+ cacheControl
803
+ });
790
804
  let newObjectFields = this.state.objectFields;
791
805
  if (fields) {
792
806
  newObjectFields = new Map(this.state.objectFields);
@@ -1155,6 +1169,7 @@ var GraphQLSchemaBuilder = class _GraphQLSchemaBuilder {
1155
1169
  const implementedInterfaces = typeReg.implements?.map((name) => interfaceRegistry.get(name)).filter(Boolean) ?? [];
1156
1170
  const graphqlType = new GraphQLObjectType({
1157
1171
  name: typeName,
1172
+ description: typeReg.description,
1158
1173
  fields: () => {
1159
1174
  const baseFields = schemaToFields(typeReg.schema, sharedCtx);
1160
1175
  const additionalFields = this.state.objectFields.get(typeName);