@effect-gql/core 1.4.5 → 1.4.6
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 +152 -38
- package/builder/index.cjs.map +1 -1
- package/builder/index.js +152 -38
- package/builder/index.js.map +1 -1
- package/index.cjs +152 -38
- package/index.cjs.map +1 -1
- package/index.js +152 -38
- package/index.js.map +1 -1
- package/package.json +1 -1
package/builder/index.js
CHANGED
|
@@ -700,26 +700,56 @@ function toGraphQLInputTypeWithRegistry(schema, enumRegistry, inputRegistry, inp
|
|
|
700
700
|
if (memberAst._tag === "UndefinedKeyword") continue;
|
|
701
701
|
const inputName = cache?.astToInputName?.get(memberAst);
|
|
702
702
|
if (inputName) {
|
|
703
|
-
const
|
|
704
|
-
if (
|
|
703
|
+
const inputReg = inputs.get(inputName);
|
|
704
|
+
if (inputReg) {
|
|
705
|
+
return toGraphQLInputTypeWithRegistry(
|
|
706
|
+
inputReg.schema,
|
|
707
|
+
enumRegistry,
|
|
708
|
+
inputRegistry,
|
|
709
|
+
inputs,
|
|
710
|
+
enums,
|
|
711
|
+
cache
|
|
712
|
+
);
|
|
713
|
+
}
|
|
705
714
|
}
|
|
706
|
-
for (const [
|
|
715
|
+
for (const [, inputReg] of inputs) {
|
|
707
716
|
if (inputReg.schema.ast === memberAst) {
|
|
708
|
-
|
|
709
|
-
|
|
717
|
+
return toGraphQLInputTypeWithRegistry(
|
|
718
|
+
inputReg.schema,
|
|
719
|
+
enumRegistry,
|
|
720
|
+
inputRegistry,
|
|
721
|
+
inputs,
|
|
722
|
+
enums,
|
|
723
|
+
cache
|
|
724
|
+
);
|
|
710
725
|
}
|
|
711
726
|
}
|
|
712
727
|
if (memberAst._tag === "Transformation") {
|
|
713
728
|
const innerToAst = memberAst.to;
|
|
714
729
|
const transformedInputName = cache?.astToInputName?.get(innerToAst);
|
|
715
730
|
if (transformedInputName) {
|
|
716
|
-
const
|
|
717
|
-
if (
|
|
731
|
+
const inputReg = inputs.get(transformedInputName);
|
|
732
|
+
if (inputReg) {
|
|
733
|
+
return toGraphQLInputTypeWithRegistry(
|
|
734
|
+
inputReg.schema,
|
|
735
|
+
enumRegistry,
|
|
736
|
+
inputRegistry,
|
|
737
|
+
inputs,
|
|
738
|
+
enums,
|
|
739
|
+
cache
|
|
740
|
+
);
|
|
741
|
+
}
|
|
718
742
|
}
|
|
719
|
-
for (const [
|
|
743
|
+
for (const [, inputReg] of inputs) {
|
|
720
744
|
if (inputReg.schema.ast === innerToAst) {
|
|
721
|
-
|
|
722
|
-
|
|
745
|
+
return toGraphQLInputTypeWithRegistry(
|
|
746
|
+
inputReg.schema,
|
|
747
|
+
enumRegistry,
|
|
748
|
+
inputRegistry,
|
|
749
|
+
inputs,
|
|
750
|
+
enums,
|
|
751
|
+
cache
|
|
752
|
+
);
|
|
723
753
|
}
|
|
724
754
|
}
|
|
725
755
|
}
|
|
@@ -731,25 +761,52 @@ function toGraphQLInputTypeWithRegistry(schema, enumRegistry, inputRegistry, inp
|
|
|
731
761
|
const valueType = valueField.type;
|
|
732
762
|
const valueInputName = cache?.astToInputName?.get(valueType);
|
|
733
763
|
if (valueInputName) {
|
|
734
|
-
const
|
|
735
|
-
if (
|
|
764
|
+
const inputReg = inputs.get(valueInputName);
|
|
765
|
+
if (inputReg) {
|
|
766
|
+
return toGraphQLInputTypeWithRegistry(
|
|
767
|
+
inputReg.schema,
|
|
768
|
+
enumRegistry,
|
|
769
|
+
inputRegistry,
|
|
770
|
+
inputs,
|
|
771
|
+
enums,
|
|
772
|
+
cache
|
|
773
|
+
);
|
|
774
|
+
}
|
|
736
775
|
}
|
|
737
|
-
for (const [
|
|
776
|
+
for (const [, inputReg] of inputs) {
|
|
738
777
|
if (inputReg.schema.ast === valueType) {
|
|
739
|
-
|
|
740
|
-
|
|
778
|
+
return toGraphQLInputTypeWithRegistry(
|
|
779
|
+
inputReg.schema,
|
|
780
|
+
enumRegistry,
|
|
781
|
+
inputRegistry,
|
|
782
|
+
inputs,
|
|
783
|
+
enums,
|
|
784
|
+
cache
|
|
785
|
+
);
|
|
741
786
|
}
|
|
742
787
|
let regAst = inputReg.schema.ast;
|
|
743
788
|
while (regAst._tag === "Transformation") {
|
|
744
789
|
regAst = regAst.to;
|
|
745
790
|
if (regAst === valueType) {
|
|
746
|
-
|
|
747
|
-
|
|
791
|
+
return toGraphQLInputTypeWithRegistry(
|
|
792
|
+
inputReg.schema,
|
|
793
|
+
enumRegistry,
|
|
794
|
+
inputRegistry,
|
|
795
|
+
inputs,
|
|
796
|
+
enums,
|
|
797
|
+
cache
|
|
798
|
+
);
|
|
748
799
|
}
|
|
749
800
|
}
|
|
750
801
|
if (regAst._tag === "Declaration" && regAst.typeParameters?.[0] === valueType) {
|
|
751
|
-
|
|
752
|
-
|
|
802
|
+
return toGraphQLInputTypeWithRegistry(
|
|
803
|
+
inputReg.schema,
|
|
804
|
+
enumRegistry,
|
|
805
|
+
inputRegistry,
|
|
806
|
+
inputs,
|
|
807
|
+
enums,
|
|
808
|
+
cache
|
|
809
|
+
);
|
|
753
810
|
}
|
|
754
811
|
}
|
|
755
812
|
const innerResult = toGraphQLInputTypeWithRegistry(
|
|
@@ -802,26 +859,56 @@ function toGraphQLInputTypeWithRegistry(schema, enumRegistry, inputRegistry, inp
|
|
|
802
859
|
for (const memberAst of unionAst.types) {
|
|
803
860
|
const inputName = cache?.astToInputName?.get(memberAst);
|
|
804
861
|
if (inputName) {
|
|
805
|
-
const
|
|
806
|
-
if (
|
|
862
|
+
const inputReg = inputs.get(inputName);
|
|
863
|
+
if (inputReg) {
|
|
864
|
+
return toGraphQLInputTypeWithRegistry(
|
|
865
|
+
inputReg.schema,
|
|
866
|
+
enumRegistry,
|
|
867
|
+
inputRegistry,
|
|
868
|
+
inputs,
|
|
869
|
+
enums,
|
|
870
|
+
cache
|
|
871
|
+
);
|
|
872
|
+
}
|
|
807
873
|
}
|
|
808
|
-
for (const [
|
|
874
|
+
for (const [, inputReg] of inputs) {
|
|
809
875
|
if (inputReg.schema.ast === memberAst) {
|
|
810
|
-
|
|
811
|
-
|
|
876
|
+
return toGraphQLInputTypeWithRegistry(
|
|
877
|
+
inputReg.schema,
|
|
878
|
+
enumRegistry,
|
|
879
|
+
inputRegistry,
|
|
880
|
+
inputs,
|
|
881
|
+
enums,
|
|
882
|
+
cache
|
|
883
|
+
);
|
|
812
884
|
}
|
|
813
885
|
}
|
|
814
886
|
if (memberAst._tag === "Transformation") {
|
|
815
887
|
const toAst = memberAst.to;
|
|
816
888
|
const transformedInputName = cache?.astToInputName?.get(toAst);
|
|
817
889
|
if (transformedInputName) {
|
|
818
|
-
const
|
|
819
|
-
if (
|
|
890
|
+
const inputReg = inputs.get(transformedInputName);
|
|
891
|
+
if (inputReg) {
|
|
892
|
+
return toGraphQLInputTypeWithRegistry(
|
|
893
|
+
inputReg.schema,
|
|
894
|
+
enumRegistry,
|
|
895
|
+
inputRegistry,
|
|
896
|
+
inputs,
|
|
897
|
+
enums,
|
|
898
|
+
cache
|
|
899
|
+
);
|
|
900
|
+
}
|
|
820
901
|
}
|
|
821
|
-
for (const [
|
|
902
|
+
for (const [, inputReg] of inputs) {
|
|
822
903
|
if (inputReg.schema.ast === toAst) {
|
|
823
|
-
|
|
824
|
-
|
|
904
|
+
return toGraphQLInputTypeWithRegistry(
|
|
905
|
+
inputReg.schema,
|
|
906
|
+
enumRegistry,
|
|
907
|
+
inputRegistry,
|
|
908
|
+
inputs,
|
|
909
|
+
enums,
|
|
910
|
+
cache
|
|
911
|
+
);
|
|
825
912
|
}
|
|
826
913
|
}
|
|
827
914
|
}
|
|
@@ -833,25 +920,52 @@ function toGraphQLInputTypeWithRegistry(schema, enumRegistry, inputRegistry, inp
|
|
|
833
920
|
const valueType = valueField.type;
|
|
834
921
|
const valueInputName = cache?.astToInputName?.get(valueType);
|
|
835
922
|
if (valueInputName) {
|
|
836
|
-
const
|
|
837
|
-
if (
|
|
923
|
+
const inputReg = inputs.get(valueInputName);
|
|
924
|
+
if (inputReg) {
|
|
925
|
+
return toGraphQLInputTypeWithRegistry(
|
|
926
|
+
inputReg.schema,
|
|
927
|
+
enumRegistry,
|
|
928
|
+
inputRegistry,
|
|
929
|
+
inputs,
|
|
930
|
+
enums,
|
|
931
|
+
cache
|
|
932
|
+
);
|
|
933
|
+
}
|
|
838
934
|
}
|
|
839
|
-
for (const [
|
|
935
|
+
for (const [, inputReg] of inputs) {
|
|
840
936
|
if (inputReg.schema.ast === valueType) {
|
|
841
|
-
|
|
842
|
-
|
|
937
|
+
return toGraphQLInputTypeWithRegistry(
|
|
938
|
+
inputReg.schema,
|
|
939
|
+
enumRegistry,
|
|
940
|
+
inputRegistry,
|
|
941
|
+
inputs,
|
|
942
|
+
enums,
|
|
943
|
+
cache
|
|
944
|
+
);
|
|
843
945
|
}
|
|
844
946
|
let regAst = inputReg.schema.ast;
|
|
845
947
|
while (regAst._tag === "Transformation") {
|
|
846
948
|
regAst = regAst.to;
|
|
847
949
|
if (regAst === valueType) {
|
|
848
|
-
|
|
849
|
-
|
|
950
|
+
return toGraphQLInputTypeWithRegistry(
|
|
951
|
+
inputReg.schema,
|
|
952
|
+
enumRegistry,
|
|
953
|
+
inputRegistry,
|
|
954
|
+
inputs,
|
|
955
|
+
enums,
|
|
956
|
+
cache
|
|
957
|
+
);
|
|
850
958
|
}
|
|
851
959
|
}
|
|
852
960
|
if (regAst._tag === "Declaration" && regAst.typeParameters?.[0] === valueType) {
|
|
853
|
-
|
|
854
|
-
|
|
961
|
+
return toGraphQLInputTypeWithRegistry(
|
|
962
|
+
inputReg.schema,
|
|
963
|
+
enumRegistry,
|
|
964
|
+
inputRegistry,
|
|
965
|
+
inputs,
|
|
966
|
+
enums,
|
|
967
|
+
cache
|
|
968
|
+
);
|
|
855
969
|
}
|
|
856
970
|
}
|
|
857
971
|
const innerResult = toGraphQLInputTypeWithRegistry(
|