@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.cjs
CHANGED
|
@@ -191,10 +191,7 @@ var toGraphQLInputType = (schema) => {
|
|
|
191
191
|
const tupleResult = handleTupleTypeAST(ast, toGraphQLInputType);
|
|
192
192
|
if (tupleResult) return tupleResult;
|
|
193
193
|
if (ast._tag === "TypeLiteral") {
|
|
194
|
-
const fields = buildFieldsFromPropertySignatures(
|
|
195
|
-
ast.propertySignatures,
|
|
196
|
-
toGraphQLInputType
|
|
197
|
-
);
|
|
194
|
+
const fields = buildFieldsFromPropertySignatures(ast.propertySignatures, toGraphQLInputType);
|
|
198
195
|
const typeName = schema.annotations?.identifier || `Input_${Math.random().toString(36).slice(2, 11)}`;
|
|
199
196
|
return new graphql.GraphQLInputObjectType({
|
|
200
197
|
name: typeName,
|
|
@@ -461,9 +458,7 @@ function findRegisteredTypeForTransformation(memberAst, ctx) {
|
|
|
461
458
|
}
|
|
462
459
|
function findRegisteredTypeForOptionSome(memberAst, ctx) {
|
|
463
460
|
if (memberAst._tag !== "TypeLiteral") return void 0;
|
|
464
|
-
const valueField = memberAst.propertySignatures?.find(
|
|
465
|
-
(p) => String(p.name) === "value"
|
|
466
|
-
);
|
|
461
|
+
const valueField = memberAst.propertySignatures?.find((p) => String(p.name) === "value");
|
|
467
462
|
if (!valueField) return void 0;
|
|
468
463
|
const valueType = valueField.type;
|
|
469
464
|
const valueTypeName = ctx.astToTypeName?.get(valueType);
|
|
@@ -839,7 +834,14 @@ function handleOptionTransformationForInput(fromAst, toAst, inputs, inputRegistr
|
|
|
839
834
|
for (const memberAst of fromAst.types) {
|
|
840
835
|
if (memberAst._tag === "Literal") continue;
|
|
841
836
|
if (memberAst._tag === "UndefinedKeyword") continue;
|
|
842
|
-
const registeredInput = findRegisteredInputForAST(memberAst, inputs, inputRegistry, enumRegistry, enums, cache) || findRegisteredInputForTransformation(
|
|
837
|
+
const registeredInput = findRegisteredInputForAST(memberAst, inputs, inputRegistry, enumRegistry, enums, cache) || findRegisteredInputForTransformation(
|
|
838
|
+
memberAst,
|
|
839
|
+
inputs,
|
|
840
|
+
inputRegistry,
|
|
841
|
+
enumRegistry,
|
|
842
|
+
enums,
|
|
843
|
+
cache
|
|
844
|
+
) || findRegisteredInputForOptionSome(memberAst, inputs, inputRegistry, enumRegistry, enums, cache);
|
|
843
845
|
if (registeredInput) return registeredInput;
|
|
844
846
|
}
|
|
845
847
|
return void 0;
|
|
@@ -870,7 +872,14 @@ function handleTransformationForInput(ast, inputs, inputRegistry, enumRegistry,
|
|
|
870
872
|
}
|
|
871
873
|
function findRegisteredInputInUnionMembers(types, inputs, inputRegistry, enumRegistry, enums, cache) {
|
|
872
874
|
for (const memberAst of types) {
|
|
873
|
-
const registeredInput = findRegisteredInputForAST(memberAst, inputs, inputRegistry, enumRegistry, enums, cache) || findRegisteredInputForTransformation(
|
|
875
|
+
const registeredInput = findRegisteredInputForAST(memberAst, inputs, inputRegistry, enumRegistry, enums, cache) || findRegisteredInputForTransformation(
|
|
876
|
+
memberAst,
|
|
877
|
+
inputs,
|
|
878
|
+
inputRegistry,
|
|
879
|
+
enumRegistry,
|
|
880
|
+
enums,
|
|
881
|
+
cache
|
|
882
|
+
) || findRegisteredInputForOptionSome(memberAst, inputs, inputRegistry, enumRegistry, enums, cache);
|
|
874
883
|
if (registeredInput) return registeredInput;
|
|
875
884
|
}
|
|
876
885
|
return void 0;
|
|
@@ -1528,8 +1537,16 @@ var GraphQLSchemaBuilder = class _GraphQLSchemaBuilder {
|
|
|
1528
1537
|
const enumRegistry = this.buildEnumRegistry();
|
|
1529
1538
|
const inputRegistry = this.buildInputRegistry(enumRegistry);
|
|
1530
1539
|
const inputTypeLookupCache = buildInputTypeLookupCache(this.state.inputs, this.state.enums);
|
|
1531
|
-
const directiveRegistry = this.buildDirectiveRegistry(
|
|
1532
|
-
|
|
1540
|
+
const directiveRegistry = this.buildDirectiveRegistry(
|
|
1541
|
+
enumRegistry,
|
|
1542
|
+
inputRegistry,
|
|
1543
|
+
inputTypeLookupCache
|
|
1544
|
+
);
|
|
1545
|
+
const interfaceRegistry = this.buildInterfaceRegistry(
|
|
1546
|
+
enumRegistry,
|
|
1547
|
+
inputRegistry,
|
|
1548
|
+
inputTypeLookupCache
|
|
1549
|
+
);
|
|
1533
1550
|
const { typeRegistry, unionRegistry } = this.buildTypeAndUnionRegistries(
|
|
1534
1551
|
enumRegistry,
|
|
1535
1552
|
interfaceRegistry,
|