@effect-gql/core 1.4.12 → 1.4.13
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 +28 -11
- package/builder/index.cjs.map +1 -1
- package/builder/index.js +28 -11
- package/builder/index.js.map +1 -1
- package/index.cjs +28 -11
- package/index.cjs.map +1 -1
- package/index.js +28 -11
- package/index.js.map +1 -1
- package/package.json +1 -1
package/builder/index.js
CHANGED
|
@@ -164,10 +164,7 @@ var toGraphQLInputType = (schema) => {
|
|
|
164
164
|
const tupleResult = handleTupleTypeAST(ast, toGraphQLInputType);
|
|
165
165
|
if (tupleResult) return tupleResult;
|
|
166
166
|
if (ast._tag === "TypeLiteral") {
|
|
167
|
-
const fields = buildFieldsFromPropertySignatures(
|
|
168
|
-
ast.propertySignatures,
|
|
169
|
-
toGraphQLInputType
|
|
170
|
-
);
|
|
167
|
+
const fields = buildFieldsFromPropertySignatures(ast.propertySignatures, toGraphQLInputType);
|
|
171
168
|
const typeName = schema.annotations?.identifier || `Input_${Math.random().toString(36).slice(2, 11)}`;
|
|
172
169
|
return new GraphQLInputObjectType({
|
|
173
170
|
name: typeName,
|
|
@@ -399,9 +396,7 @@ function findRegisteredTypeForTransformation(memberAst, ctx) {
|
|
|
399
396
|
}
|
|
400
397
|
function findRegisteredTypeForOptionSome(memberAst, ctx) {
|
|
401
398
|
if (memberAst._tag !== "TypeLiteral") return void 0;
|
|
402
|
-
const valueField = memberAst.propertySignatures?.find(
|
|
403
|
-
(p) => String(p.name) === "value"
|
|
404
|
-
);
|
|
399
|
+
const valueField = memberAst.propertySignatures?.find((p) => String(p.name) === "value");
|
|
405
400
|
if (!valueField) return void 0;
|
|
406
401
|
const valueType = valueField.type;
|
|
407
402
|
const valueTypeName = ctx.astToTypeName?.get(valueType);
|
|
@@ -777,7 +772,14 @@ function handleOptionTransformationForInput(fromAst, toAst, inputs, inputRegistr
|
|
|
777
772
|
for (const memberAst of fromAst.types) {
|
|
778
773
|
if (memberAst._tag === "Literal") continue;
|
|
779
774
|
if (memberAst._tag === "UndefinedKeyword") continue;
|
|
780
|
-
const registeredInput = findRegisteredInputForAST(memberAst, inputs, inputRegistry, enumRegistry, enums, cache) || findRegisteredInputForTransformation(
|
|
775
|
+
const registeredInput = findRegisteredInputForAST(memberAst, inputs, inputRegistry, enumRegistry, enums, cache) || findRegisteredInputForTransformation(
|
|
776
|
+
memberAst,
|
|
777
|
+
inputs,
|
|
778
|
+
inputRegistry,
|
|
779
|
+
enumRegistry,
|
|
780
|
+
enums,
|
|
781
|
+
cache
|
|
782
|
+
) || findRegisteredInputForOptionSome(memberAst, inputs, inputRegistry, enumRegistry, enums, cache);
|
|
781
783
|
if (registeredInput) return registeredInput;
|
|
782
784
|
}
|
|
783
785
|
return void 0;
|
|
@@ -808,7 +810,14 @@ function handleTransformationForInput(ast, inputs, inputRegistry, enumRegistry,
|
|
|
808
810
|
}
|
|
809
811
|
function findRegisteredInputInUnionMembers(types, inputs, inputRegistry, enumRegistry, enums, cache) {
|
|
810
812
|
for (const memberAst of types) {
|
|
811
|
-
const registeredInput = findRegisteredInputForAST(memberAst, inputs, inputRegistry, enumRegistry, enums, cache) || findRegisteredInputForTransformation(
|
|
813
|
+
const registeredInput = findRegisteredInputForAST(memberAst, inputs, inputRegistry, enumRegistry, enums, cache) || findRegisteredInputForTransformation(
|
|
814
|
+
memberAst,
|
|
815
|
+
inputs,
|
|
816
|
+
inputRegistry,
|
|
817
|
+
enumRegistry,
|
|
818
|
+
enums,
|
|
819
|
+
cache
|
|
820
|
+
) || findRegisteredInputForOptionSome(memberAst, inputs, inputRegistry, enumRegistry, enums, cache);
|
|
812
821
|
if (registeredInput) return registeredInput;
|
|
813
822
|
}
|
|
814
823
|
return void 0;
|
|
@@ -1466,8 +1475,16 @@ var GraphQLSchemaBuilder = class _GraphQLSchemaBuilder {
|
|
|
1466
1475
|
const enumRegistry = this.buildEnumRegistry();
|
|
1467
1476
|
const inputRegistry = this.buildInputRegistry(enumRegistry);
|
|
1468
1477
|
const inputTypeLookupCache = buildInputTypeLookupCache(this.state.inputs, this.state.enums);
|
|
1469
|
-
const directiveRegistry = this.buildDirectiveRegistry(
|
|
1470
|
-
|
|
1478
|
+
const directiveRegistry = this.buildDirectiveRegistry(
|
|
1479
|
+
enumRegistry,
|
|
1480
|
+
inputRegistry,
|
|
1481
|
+
inputTypeLookupCache
|
|
1482
|
+
);
|
|
1483
|
+
const interfaceRegistry = this.buildInterfaceRegistry(
|
|
1484
|
+
enumRegistry,
|
|
1485
|
+
inputRegistry,
|
|
1486
|
+
inputTypeLookupCache
|
|
1487
|
+
);
|
|
1471
1488
|
const { typeRegistry, unionRegistry } = this.buildTypeAndUnionRegistries(
|
|
1472
1489
|
enumRegistry,
|
|
1473
1490
|
interfaceRegistry,
|