@effect-gql/core 1.0.0 → 1.1.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/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);