@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 +27 -1
- package/builder/index.cjs +17 -2
- package/builder/index.cjs.map +1 -1
- package/builder/index.d.cts +3 -2
- package/builder/index.d.ts +3 -2
- package/builder/index.js +17 -2
- package/builder/index.js.map +1 -1
- package/index.cjs +141 -74
- package/index.cjs.map +1 -1
- package/index.d.cts +9 -3
- package/index.d.ts +9 -3
- package/index.js +143 -76
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/{schema-builder-Cvdq7Kz_.d.cts → schema-builder-DKvkzU_M.d.cts} +2 -0
- package/{schema-builder-Cvdq7Kz_.d.ts → schema-builder-DKvkzU_M.d.ts} +2 -0
- package/server/index.cjs +88 -47
- package/server/index.cjs.map +1 -1
- package/server/index.d.cts +5 -3
- package/server/index.d.ts +5 -3
- package/server/index.js +91 -50
- package/server/index.js.map +1 -1
package/builder/index.d.cts
CHANGED
|
@@ -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-
|
|
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-
|
|
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
|
/**
|
package/builder/index.d.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
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 {
|
|
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, {
|
|
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);
|