@effect-gql/core 1.4.6 → 1.4.7
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 +27 -17
- package/builder/index.cjs.map +1 -1
- package/builder/index.d.cts +2 -2
- package/builder/index.d.ts +2 -2
- package/builder/index.js +27 -17
- package/builder/index.js.map +1 -1
- package/index.cjs +27 -17
- package/index.cjs.map +1 -1
- package/index.d.cts +2 -2
- package/index.d.ts +2 -2
- package/index.js +27 -17
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/{schema-builder-DKvkzU_M.d.cts → schema-builder-CAij36fD.d.cts} +7 -0
- package/{schema-builder-DKvkzU_M.d.ts → schema-builder-CAij36fD.d.ts} +7 -0
- package/server/index.d.cts +2 -2
- package/server/index.d.ts +2 -2
package/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FieldComplexityMap, G as GraphQLExtension, E as ExtensionsService } from './schema-builder-
|
|
2
|
-
export { y as CacheControlConfig, J as CacheControlConfigFromEnv, h as CacheControlScope, C as CacheHint, w as CacheHintMap, x as CachePolicy, z as CachePolicyAnalysisInfo, q as ComplexityAnalysisError, l as ComplexityAnalysisInfo, n as ComplexityCalculator, j as ComplexityConfig, u as ComplexityConfigFromEnv, m as ComplexityExceededInfo, p as ComplexityLimitExceededError, k as ComplexityResult, D as DirectiveApplication, d as DirectiveRegistration, b as EnumRegistration, K as ExecutionArgs, o as FieldComplexity, a as FieldRegistration, f as GraphQLEffectContext, i as GraphQLSchemaBuilder, c as InputTypeRegistration, I as InterfaceRegistration, M as MiddlewareContext, e as MiddlewareRegistration, O as ObjectFieldRegistration, S as SubscriptionFieldRegistration, T as TypeRegistration, g as TypeRegistries, U as UnionRegistration, t as combineCalculators, A as computeCachePolicy, B as computeCachePolicyFromQuery, r as defaultComplexityCalculator, s as depthOnlyCalculator, L as makeExtensionsService, R as runExecuteEndHooks, Q as runExecuteStartHooks, N as runParseHooks, P as runValidateHooks, H as toCacheControlHeader, v as validateComplexity } from './schema-builder-
|
|
1
|
+
import { F as FieldComplexityMap, G as GraphQLExtension, E as ExtensionsService } from './schema-builder-CAij36fD.cjs';
|
|
2
|
+
export { y as CacheControlConfig, J as CacheControlConfigFromEnv, h as CacheControlScope, C as CacheHint, w as CacheHintMap, x as CachePolicy, z as CachePolicyAnalysisInfo, q as ComplexityAnalysisError, l as ComplexityAnalysisInfo, n as ComplexityCalculator, j as ComplexityConfig, u as ComplexityConfigFromEnv, m as ComplexityExceededInfo, p as ComplexityLimitExceededError, k as ComplexityResult, D as DirectiveApplication, d as DirectiveRegistration, b as EnumRegistration, K as ExecutionArgs, o as FieldComplexity, a as FieldRegistration, f as GraphQLEffectContext, i as GraphQLSchemaBuilder, c as InputTypeRegistration, I as InterfaceRegistration, M as MiddlewareContext, e as MiddlewareRegistration, O as ObjectFieldRegistration, S as SubscriptionFieldRegistration, T as TypeRegistration, g as TypeRegistries, U as UnionRegistration, t as combineCalculators, A as computeCachePolicy, B as computeCachePolicyFromQuery, r as defaultComplexityCalculator, s as depthOnlyCalculator, L as makeExtensionsService, R as runExecuteEndHooks, Q as runExecuteStartHooks, N as runParseHooks, P as runValidateHooks, H as toCacheControlHeader, v as validateComplexity } from './schema-builder-CAij36fD.cjs';
|
|
3
3
|
import { GraphQLOutputType, GraphQLInputType, GraphQLFieldConfigArgumentMap, GraphQLObjectType } from 'graphql';
|
|
4
4
|
export { DirectiveLocation, GraphQLBoolean, GraphQLEnumType, GraphQLFieldConfigMap, GraphQLFloat, GraphQLID, GraphQLInputObjectType, GraphQLInt, GraphQLInterfaceType, GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLScalarType, GraphQLSchema, GraphQLString, GraphQLUnionType, Kind, ValueNode, graphql, lexicographicSortSchema, printSchema } from 'graphql';
|
|
5
5
|
export { compose, directive, enumType, execute, extension, field, getSchemaName, inputType, interfaceType, middleware, mutation, objectType, query, subscription, unionType } from './builder/index.cjs';
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FieldComplexityMap, G as GraphQLExtension, E as ExtensionsService } from './schema-builder-
|
|
2
|
-
export { y as CacheControlConfig, J as CacheControlConfigFromEnv, h as CacheControlScope, C as CacheHint, w as CacheHintMap, x as CachePolicy, z as CachePolicyAnalysisInfo, q as ComplexityAnalysisError, l as ComplexityAnalysisInfo, n as ComplexityCalculator, j as ComplexityConfig, u as ComplexityConfigFromEnv, m as ComplexityExceededInfo, p as ComplexityLimitExceededError, k as ComplexityResult, D as DirectiveApplication, d as DirectiveRegistration, b as EnumRegistration, K as ExecutionArgs, o as FieldComplexity, a as FieldRegistration, f as GraphQLEffectContext, i as GraphQLSchemaBuilder, c as InputTypeRegistration, I as InterfaceRegistration, M as MiddlewareContext, e as MiddlewareRegistration, O as ObjectFieldRegistration, S as SubscriptionFieldRegistration, T as TypeRegistration, g as TypeRegistries, U as UnionRegistration, t as combineCalculators, A as computeCachePolicy, B as computeCachePolicyFromQuery, r as defaultComplexityCalculator, s as depthOnlyCalculator, L as makeExtensionsService, R as runExecuteEndHooks, Q as runExecuteStartHooks, N as runParseHooks, P as runValidateHooks, H as toCacheControlHeader, v as validateComplexity } from './schema-builder-
|
|
1
|
+
import { F as FieldComplexityMap, G as GraphQLExtension, E as ExtensionsService } from './schema-builder-CAij36fD.js';
|
|
2
|
+
export { y as CacheControlConfig, J as CacheControlConfigFromEnv, h as CacheControlScope, C as CacheHint, w as CacheHintMap, x as CachePolicy, z as CachePolicyAnalysisInfo, q as ComplexityAnalysisError, l as ComplexityAnalysisInfo, n as ComplexityCalculator, j as ComplexityConfig, u as ComplexityConfigFromEnv, m as ComplexityExceededInfo, p as ComplexityLimitExceededError, k as ComplexityResult, D as DirectiveApplication, d as DirectiveRegistration, b as EnumRegistration, K as ExecutionArgs, o as FieldComplexity, a as FieldRegistration, f as GraphQLEffectContext, i as GraphQLSchemaBuilder, c as InputTypeRegistration, I as InterfaceRegistration, M as MiddlewareContext, e as MiddlewareRegistration, O as ObjectFieldRegistration, S as SubscriptionFieldRegistration, T as TypeRegistration, g as TypeRegistries, U as UnionRegistration, t as combineCalculators, A as computeCachePolicy, B as computeCachePolicyFromQuery, r as defaultComplexityCalculator, s as depthOnlyCalculator, L as makeExtensionsService, R as runExecuteEndHooks, Q as runExecuteStartHooks, N as runParseHooks, P as runValidateHooks, H as toCacheControlHeader, v as validateComplexity } from './schema-builder-CAij36fD.js';
|
|
3
3
|
import { GraphQLOutputType, GraphQLInputType, GraphQLFieldConfigArgumentMap, GraphQLObjectType } from 'graphql';
|
|
4
4
|
export { DirectiveLocation, GraphQLBoolean, GraphQLEnumType, GraphQLFieldConfigMap, GraphQLFloat, GraphQLID, GraphQLInputObjectType, GraphQLInt, GraphQLInterfaceType, GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLScalarType, GraphQLSchema, GraphQLString, GraphQLUnionType, Kind, ValueNode, graphql, lexicographicSortSchema, printSchema } from 'graphql';
|
|
5
5
|
export { compose, directive, enumType, execute, extension, field, getSchemaName, inputType, interfaceType, middleware, mutation, objectType, query, subscription, unionType } from './builder/index.js';
|
package/index.js
CHANGED
|
@@ -1626,15 +1626,25 @@ var GraphQLSchemaBuilder = class _GraphQLSchemaBuilder {
|
|
|
1626
1626
|
}
|
|
1627
1627
|
/**
|
|
1628
1628
|
* Build the GraphQL schema (no services required)
|
|
1629
|
+
*
|
|
1630
|
+
* Uses a two-phase approach:
|
|
1631
|
+
* 1. Phase 1: Build enum and input registries first (these may be referenced by other types)
|
|
1632
|
+
* 2. Phase 2: Build interface, object, and union types (which may reference inputs in args)
|
|
1633
|
+
*
|
|
1634
|
+
* This ensures that when object type fields with args are processed,
|
|
1635
|
+
* all registered input types are already available in the inputRegistry.
|
|
1629
1636
|
*/
|
|
1630
1637
|
buildSchema() {
|
|
1631
|
-
const directiveRegistry = this.buildDirectiveRegistry();
|
|
1632
1638
|
const enumRegistry = this.buildEnumRegistry();
|
|
1633
1639
|
const inputRegistry = this.buildInputRegistry(enumRegistry);
|
|
1634
|
-
const
|
|
1640
|
+
const inputTypeLookupCache = buildInputTypeLookupCache(this.state.inputs, this.state.enums);
|
|
1641
|
+
const directiveRegistry = this.buildDirectiveRegistry(enumRegistry, inputRegistry, inputTypeLookupCache);
|
|
1642
|
+
const interfaceRegistry = this.buildInterfaceRegistry(enumRegistry, inputRegistry, inputTypeLookupCache);
|
|
1635
1643
|
const { typeRegistry, unionRegistry } = this.buildTypeAndUnionRegistries(
|
|
1636
1644
|
enumRegistry,
|
|
1637
|
-
interfaceRegistry
|
|
1645
|
+
interfaceRegistry,
|
|
1646
|
+
inputRegistry,
|
|
1647
|
+
inputTypeLookupCache
|
|
1638
1648
|
);
|
|
1639
1649
|
const fieldCtx = this.createFieldBuilderContext(
|
|
1640
1650
|
typeRegistry,
|
|
@@ -1658,9 +1668,8 @@ var GraphQLSchemaBuilder = class _GraphQLSchemaBuilder {
|
|
|
1658
1668
|
subscriptionFields
|
|
1659
1669
|
});
|
|
1660
1670
|
}
|
|
1661
|
-
buildDirectiveRegistry() {
|
|
1671
|
+
buildDirectiveRegistry(enumRegistry, inputRegistry, cache) {
|
|
1662
1672
|
const registry = /* @__PURE__ */ new Map();
|
|
1663
|
-
const cache = buildInputTypeLookupCache(this.state.inputs, this.state.enums);
|
|
1664
1673
|
for (const [name, reg] of this.state.directives) {
|
|
1665
1674
|
const graphqlDirective = new GraphQLDirective({
|
|
1666
1675
|
name,
|
|
@@ -1668,8 +1677,8 @@ var GraphQLSchemaBuilder = class _GraphQLSchemaBuilder {
|
|
|
1668
1677
|
locations: [...reg.locations],
|
|
1669
1678
|
args: reg.args ? toGraphQLArgsWithRegistry(
|
|
1670
1679
|
reg.args,
|
|
1671
|
-
|
|
1672
|
-
|
|
1680
|
+
enumRegistry,
|
|
1681
|
+
inputRegistry,
|
|
1673
1682
|
this.state.inputs,
|
|
1674
1683
|
this.state.enums,
|
|
1675
1684
|
cache
|
|
@@ -1719,7 +1728,7 @@ var GraphQLSchemaBuilder = class _GraphQLSchemaBuilder {
|
|
|
1719
1728
|
}
|
|
1720
1729
|
return registry;
|
|
1721
1730
|
}
|
|
1722
|
-
buildInterfaceRegistry(enumRegistry) {
|
|
1731
|
+
buildInterfaceRegistry(enumRegistry, inputRegistry, _cache) {
|
|
1723
1732
|
const registry = /* @__PURE__ */ new Map();
|
|
1724
1733
|
const typeRegistry = /* @__PURE__ */ new Map();
|
|
1725
1734
|
const unionRegistry = /* @__PURE__ */ new Map();
|
|
@@ -1745,7 +1754,7 @@ var GraphQLSchemaBuilder = class _GraphQLSchemaBuilder {
|
|
|
1745
1754
|
}
|
|
1746
1755
|
return registry;
|
|
1747
1756
|
}
|
|
1748
|
-
buildTypeAndUnionRegistries(enumRegistry, interfaceRegistry) {
|
|
1757
|
+
buildTypeAndUnionRegistries(enumRegistry, interfaceRegistry, inputRegistry, inputTypeLookupCache) {
|
|
1749
1758
|
const typeRegistry = /* @__PURE__ */ new Map();
|
|
1750
1759
|
const unionRegistry = /* @__PURE__ */ new Map();
|
|
1751
1760
|
const sharedCtx = {
|
|
@@ -1754,18 +1763,19 @@ var GraphQLSchemaBuilder = class _GraphQLSchemaBuilder {
|
|
|
1754
1763
|
enums: this.state.enums,
|
|
1755
1764
|
unions: this.state.unions,
|
|
1756
1765
|
inputs: this.state.inputs,
|
|
1757
|
-
typeRegistry,
|
|
1758
|
-
interfaceRegistry,
|
|
1759
|
-
enumRegistry,
|
|
1760
|
-
unionRegistry};
|
|
1761
|
-
buildReverseLookups(sharedCtx);
|
|
1762
|
-
const sharedFieldCtx = this.createFieldBuilderContext(
|
|
1763
1766
|
typeRegistry,
|
|
1764
1767
|
interfaceRegistry,
|
|
1765
1768
|
enumRegistry,
|
|
1766
1769
|
unionRegistry,
|
|
1767
|
-
|
|
1768
|
-
|
|
1770
|
+
inputRegistry
|
|
1771
|
+
};
|
|
1772
|
+
buildReverseLookups(sharedCtx);
|
|
1773
|
+
const sharedFieldCtx = {
|
|
1774
|
+
...sharedCtx,
|
|
1775
|
+
directiveRegistrations: this.state.directives,
|
|
1776
|
+
middlewares: this.state.middlewares,
|
|
1777
|
+
inputTypeLookupCache
|
|
1778
|
+
};
|
|
1769
1779
|
for (const [typeName, typeReg] of this.state.types) {
|
|
1770
1780
|
const implementedInterfaces = typeReg.implements?.map((name) => interfaceRegistry.get(name)).filter(Boolean) ?? [];
|
|
1771
1781
|
const graphqlType = new GraphQLObjectType({
|