@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/index.js
CHANGED
|
@@ -166,10 +166,7 @@ var toGraphQLInputType = (schema) => {
|
|
|
166
166
|
const tupleResult = handleTupleTypeAST(ast, toGraphQLInputType);
|
|
167
167
|
if (tupleResult) return tupleResult;
|
|
168
168
|
if (ast._tag === "TypeLiteral") {
|
|
169
|
-
const fields = buildFieldsFromPropertySignatures(
|
|
170
|
-
ast.propertySignatures,
|
|
171
|
-
toGraphQLInputType
|
|
172
|
-
);
|
|
169
|
+
const fields = buildFieldsFromPropertySignatures(ast.propertySignatures, toGraphQLInputType);
|
|
173
170
|
const typeName = schema.annotations?.identifier || `Input_${Math.random().toString(36).slice(2, 11)}`;
|
|
174
171
|
return new GraphQLInputObjectType({
|
|
175
172
|
name: typeName,
|
|
@@ -436,9 +433,7 @@ function findRegisteredTypeForTransformation(memberAst, ctx) {
|
|
|
436
433
|
}
|
|
437
434
|
function findRegisteredTypeForOptionSome(memberAst, ctx) {
|
|
438
435
|
if (memberAst._tag !== "TypeLiteral") return void 0;
|
|
439
|
-
const valueField = memberAst.propertySignatures?.find(
|
|
440
|
-
(p) => String(p.name) === "value"
|
|
441
|
-
);
|
|
436
|
+
const valueField = memberAst.propertySignatures?.find((p) => String(p.name) === "value");
|
|
442
437
|
if (!valueField) return void 0;
|
|
443
438
|
const valueType = valueField.type;
|
|
444
439
|
const valueTypeName = ctx.astToTypeName?.get(valueType);
|
|
@@ -814,7 +809,14 @@ function handleOptionTransformationForInput(fromAst, toAst, inputs, inputRegistr
|
|
|
814
809
|
for (const memberAst of fromAst.types) {
|
|
815
810
|
if (memberAst._tag === "Literal") continue;
|
|
816
811
|
if (memberAst._tag === "UndefinedKeyword") continue;
|
|
817
|
-
const registeredInput = findRegisteredInputForAST(memberAst, inputs, inputRegistry, enumRegistry, enums, cache) || findRegisteredInputForTransformation(
|
|
812
|
+
const registeredInput = findRegisteredInputForAST(memberAst, inputs, inputRegistry, enumRegistry, enums, cache) || findRegisteredInputForTransformation(
|
|
813
|
+
memberAst,
|
|
814
|
+
inputs,
|
|
815
|
+
inputRegistry,
|
|
816
|
+
enumRegistry,
|
|
817
|
+
enums,
|
|
818
|
+
cache
|
|
819
|
+
) || findRegisteredInputForOptionSome(memberAst, inputs, inputRegistry, enumRegistry, enums, cache);
|
|
818
820
|
if (registeredInput) return registeredInput;
|
|
819
821
|
}
|
|
820
822
|
return void 0;
|
|
@@ -845,7 +847,14 @@ function handleTransformationForInput(ast, inputs, inputRegistry, enumRegistry,
|
|
|
845
847
|
}
|
|
846
848
|
function findRegisteredInputInUnionMembers(types, inputs, inputRegistry, enumRegistry, enums, cache) {
|
|
847
849
|
for (const memberAst of types) {
|
|
848
|
-
const registeredInput = findRegisteredInputForAST(memberAst, inputs, inputRegistry, enumRegistry, enums, cache) || findRegisteredInputForTransformation(
|
|
850
|
+
const registeredInput = findRegisteredInputForAST(memberAst, inputs, inputRegistry, enumRegistry, enums, cache) || findRegisteredInputForTransformation(
|
|
851
|
+
memberAst,
|
|
852
|
+
inputs,
|
|
853
|
+
inputRegistry,
|
|
854
|
+
enumRegistry,
|
|
855
|
+
enums,
|
|
856
|
+
cache
|
|
857
|
+
) || findRegisteredInputForOptionSome(memberAst, inputs, inputRegistry, enumRegistry, enums, cache);
|
|
849
858
|
if (registeredInput) return registeredInput;
|
|
850
859
|
}
|
|
851
860
|
return void 0;
|
|
@@ -1503,8 +1512,16 @@ var GraphQLSchemaBuilder = class _GraphQLSchemaBuilder {
|
|
|
1503
1512
|
const enumRegistry = this.buildEnumRegistry();
|
|
1504
1513
|
const inputRegistry = this.buildInputRegistry(enumRegistry);
|
|
1505
1514
|
const inputTypeLookupCache = buildInputTypeLookupCache(this.state.inputs, this.state.enums);
|
|
1506
|
-
const directiveRegistry = this.buildDirectiveRegistry(
|
|
1507
|
-
|
|
1515
|
+
const directiveRegistry = this.buildDirectiveRegistry(
|
|
1516
|
+
enumRegistry,
|
|
1517
|
+
inputRegistry,
|
|
1518
|
+
inputTypeLookupCache
|
|
1519
|
+
);
|
|
1520
|
+
const interfaceRegistry = this.buildInterfaceRegistry(
|
|
1521
|
+
enumRegistry,
|
|
1522
|
+
inputRegistry,
|
|
1523
|
+
inputTypeLookupCache
|
|
1524
|
+
);
|
|
1508
1525
|
const { typeRegistry, unionRegistry } = this.buildTypeAndUnionRegistries(
|
|
1509
1526
|
enumRegistry,
|
|
1510
1527
|
interfaceRegistry,
|