@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/index.js
CHANGED
|
@@ -746,26 +746,56 @@ function toGraphQLInputTypeWithRegistry(schema, enumRegistry, inputRegistry, inp
|
|
|
746
746
|
if (memberAst._tag === "UndefinedKeyword") continue;
|
|
747
747
|
const inputName = cache?.astToInputName?.get(memberAst);
|
|
748
748
|
if (inputName) {
|
|
749
|
-
const
|
|
750
|
-
if (
|
|
749
|
+
const inputReg = inputs.get(inputName);
|
|
750
|
+
if (inputReg) {
|
|
751
|
+
return toGraphQLInputTypeWithRegistry(
|
|
752
|
+
inputReg.schema,
|
|
753
|
+
enumRegistry,
|
|
754
|
+
inputRegistry,
|
|
755
|
+
inputs,
|
|
756
|
+
enums,
|
|
757
|
+
cache
|
|
758
|
+
);
|
|
759
|
+
}
|
|
751
760
|
}
|
|
752
|
-
for (const [
|
|
761
|
+
for (const [, inputReg] of inputs) {
|
|
753
762
|
if (inputReg.schema.ast === memberAst) {
|
|
754
|
-
|
|
755
|
-
|
|
763
|
+
return toGraphQLInputTypeWithRegistry(
|
|
764
|
+
inputReg.schema,
|
|
765
|
+
enumRegistry,
|
|
766
|
+
inputRegistry,
|
|
767
|
+
inputs,
|
|
768
|
+
enums,
|
|
769
|
+
cache
|
|
770
|
+
);
|
|
756
771
|
}
|
|
757
772
|
}
|
|
758
773
|
if (memberAst._tag === "Transformation") {
|
|
759
774
|
const innerToAst = memberAst.to;
|
|
760
775
|
const transformedInputName = cache?.astToInputName?.get(innerToAst);
|
|
761
776
|
if (transformedInputName) {
|
|
762
|
-
const
|
|
763
|
-
if (
|
|
777
|
+
const inputReg = inputs.get(transformedInputName);
|
|
778
|
+
if (inputReg) {
|
|
779
|
+
return toGraphQLInputTypeWithRegistry(
|
|
780
|
+
inputReg.schema,
|
|
781
|
+
enumRegistry,
|
|
782
|
+
inputRegistry,
|
|
783
|
+
inputs,
|
|
784
|
+
enums,
|
|
785
|
+
cache
|
|
786
|
+
);
|
|
787
|
+
}
|
|
764
788
|
}
|
|
765
|
-
for (const [
|
|
789
|
+
for (const [, inputReg] of inputs) {
|
|
766
790
|
if (inputReg.schema.ast === innerToAst) {
|
|
767
|
-
|
|
768
|
-
|
|
791
|
+
return toGraphQLInputTypeWithRegistry(
|
|
792
|
+
inputReg.schema,
|
|
793
|
+
enumRegistry,
|
|
794
|
+
inputRegistry,
|
|
795
|
+
inputs,
|
|
796
|
+
enums,
|
|
797
|
+
cache
|
|
798
|
+
);
|
|
769
799
|
}
|
|
770
800
|
}
|
|
771
801
|
}
|
|
@@ -777,25 +807,52 @@ function toGraphQLInputTypeWithRegistry(schema, enumRegistry, inputRegistry, inp
|
|
|
777
807
|
const valueType = valueField.type;
|
|
778
808
|
const valueInputName = cache?.astToInputName?.get(valueType);
|
|
779
809
|
if (valueInputName) {
|
|
780
|
-
const
|
|
781
|
-
if (
|
|
810
|
+
const inputReg = inputs.get(valueInputName);
|
|
811
|
+
if (inputReg) {
|
|
812
|
+
return toGraphQLInputTypeWithRegistry(
|
|
813
|
+
inputReg.schema,
|
|
814
|
+
enumRegistry,
|
|
815
|
+
inputRegistry,
|
|
816
|
+
inputs,
|
|
817
|
+
enums,
|
|
818
|
+
cache
|
|
819
|
+
);
|
|
820
|
+
}
|
|
782
821
|
}
|
|
783
|
-
for (const [
|
|
822
|
+
for (const [, inputReg] of inputs) {
|
|
784
823
|
if (inputReg.schema.ast === valueType) {
|
|
785
|
-
|
|
786
|
-
|
|
824
|
+
return toGraphQLInputTypeWithRegistry(
|
|
825
|
+
inputReg.schema,
|
|
826
|
+
enumRegistry,
|
|
827
|
+
inputRegistry,
|
|
828
|
+
inputs,
|
|
829
|
+
enums,
|
|
830
|
+
cache
|
|
831
|
+
);
|
|
787
832
|
}
|
|
788
833
|
let regAst = inputReg.schema.ast;
|
|
789
834
|
while (regAst._tag === "Transformation") {
|
|
790
835
|
regAst = regAst.to;
|
|
791
836
|
if (regAst === valueType) {
|
|
792
|
-
|
|
793
|
-
|
|
837
|
+
return toGraphQLInputTypeWithRegistry(
|
|
838
|
+
inputReg.schema,
|
|
839
|
+
enumRegistry,
|
|
840
|
+
inputRegistry,
|
|
841
|
+
inputs,
|
|
842
|
+
enums,
|
|
843
|
+
cache
|
|
844
|
+
);
|
|
794
845
|
}
|
|
795
846
|
}
|
|
796
847
|
if (regAst._tag === "Declaration" && regAst.typeParameters?.[0] === valueType) {
|
|
797
|
-
|
|
798
|
-
|
|
848
|
+
return toGraphQLInputTypeWithRegistry(
|
|
849
|
+
inputReg.schema,
|
|
850
|
+
enumRegistry,
|
|
851
|
+
inputRegistry,
|
|
852
|
+
inputs,
|
|
853
|
+
enums,
|
|
854
|
+
cache
|
|
855
|
+
);
|
|
799
856
|
}
|
|
800
857
|
}
|
|
801
858
|
const innerResult = toGraphQLInputTypeWithRegistry(
|
|
@@ -848,26 +905,56 @@ function toGraphQLInputTypeWithRegistry(schema, enumRegistry, inputRegistry, inp
|
|
|
848
905
|
for (const memberAst of unionAst.types) {
|
|
849
906
|
const inputName = cache?.astToInputName?.get(memberAst);
|
|
850
907
|
if (inputName) {
|
|
851
|
-
const
|
|
852
|
-
if (
|
|
908
|
+
const inputReg = inputs.get(inputName);
|
|
909
|
+
if (inputReg) {
|
|
910
|
+
return toGraphQLInputTypeWithRegistry(
|
|
911
|
+
inputReg.schema,
|
|
912
|
+
enumRegistry,
|
|
913
|
+
inputRegistry,
|
|
914
|
+
inputs,
|
|
915
|
+
enums,
|
|
916
|
+
cache
|
|
917
|
+
);
|
|
918
|
+
}
|
|
853
919
|
}
|
|
854
|
-
for (const [
|
|
920
|
+
for (const [, inputReg] of inputs) {
|
|
855
921
|
if (inputReg.schema.ast === memberAst) {
|
|
856
|
-
|
|
857
|
-
|
|
922
|
+
return toGraphQLInputTypeWithRegistry(
|
|
923
|
+
inputReg.schema,
|
|
924
|
+
enumRegistry,
|
|
925
|
+
inputRegistry,
|
|
926
|
+
inputs,
|
|
927
|
+
enums,
|
|
928
|
+
cache
|
|
929
|
+
);
|
|
858
930
|
}
|
|
859
931
|
}
|
|
860
932
|
if (memberAst._tag === "Transformation") {
|
|
861
933
|
const toAst = memberAst.to;
|
|
862
934
|
const transformedInputName = cache?.astToInputName?.get(toAst);
|
|
863
935
|
if (transformedInputName) {
|
|
864
|
-
const
|
|
865
|
-
if (
|
|
936
|
+
const inputReg = inputs.get(transformedInputName);
|
|
937
|
+
if (inputReg) {
|
|
938
|
+
return toGraphQLInputTypeWithRegistry(
|
|
939
|
+
inputReg.schema,
|
|
940
|
+
enumRegistry,
|
|
941
|
+
inputRegistry,
|
|
942
|
+
inputs,
|
|
943
|
+
enums,
|
|
944
|
+
cache
|
|
945
|
+
);
|
|
946
|
+
}
|
|
866
947
|
}
|
|
867
|
-
for (const [
|
|
948
|
+
for (const [, inputReg] of inputs) {
|
|
868
949
|
if (inputReg.schema.ast === toAst) {
|
|
869
|
-
|
|
870
|
-
|
|
950
|
+
return toGraphQLInputTypeWithRegistry(
|
|
951
|
+
inputReg.schema,
|
|
952
|
+
enumRegistry,
|
|
953
|
+
inputRegistry,
|
|
954
|
+
inputs,
|
|
955
|
+
enums,
|
|
956
|
+
cache
|
|
957
|
+
);
|
|
871
958
|
}
|
|
872
959
|
}
|
|
873
960
|
}
|
|
@@ -879,25 +966,52 @@ function toGraphQLInputTypeWithRegistry(schema, enumRegistry, inputRegistry, inp
|
|
|
879
966
|
const valueType = valueField.type;
|
|
880
967
|
const valueInputName = cache?.astToInputName?.get(valueType);
|
|
881
968
|
if (valueInputName) {
|
|
882
|
-
const
|
|
883
|
-
if (
|
|
969
|
+
const inputReg = inputs.get(valueInputName);
|
|
970
|
+
if (inputReg) {
|
|
971
|
+
return toGraphQLInputTypeWithRegistry(
|
|
972
|
+
inputReg.schema,
|
|
973
|
+
enumRegistry,
|
|
974
|
+
inputRegistry,
|
|
975
|
+
inputs,
|
|
976
|
+
enums,
|
|
977
|
+
cache
|
|
978
|
+
);
|
|
979
|
+
}
|
|
884
980
|
}
|
|
885
|
-
for (const [
|
|
981
|
+
for (const [, inputReg] of inputs) {
|
|
886
982
|
if (inputReg.schema.ast === valueType) {
|
|
887
|
-
|
|
888
|
-
|
|
983
|
+
return toGraphQLInputTypeWithRegistry(
|
|
984
|
+
inputReg.schema,
|
|
985
|
+
enumRegistry,
|
|
986
|
+
inputRegistry,
|
|
987
|
+
inputs,
|
|
988
|
+
enums,
|
|
989
|
+
cache
|
|
990
|
+
);
|
|
889
991
|
}
|
|
890
992
|
let regAst = inputReg.schema.ast;
|
|
891
993
|
while (regAst._tag === "Transformation") {
|
|
892
994
|
regAst = regAst.to;
|
|
893
995
|
if (regAst === valueType) {
|
|
894
|
-
|
|
895
|
-
|
|
996
|
+
return toGraphQLInputTypeWithRegistry(
|
|
997
|
+
inputReg.schema,
|
|
998
|
+
enumRegistry,
|
|
999
|
+
inputRegistry,
|
|
1000
|
+
inputs,
|
|
1001
|
+
enums,
|
|
1002
|
+
cache
|
|
1003
|
+
);
|
|
896
1004
|
}
|
|
897
1005
|
}
|
|
898
1006
|
if (regAst._tag === "Declaration" && regAst.typeParameters?.[0] === valueType) {
|
|
899
|
-
|
|
900
|
-
|
|
1007
|
+
return toGraphQLInputTypeWithRegistry(
|
|
1008
|
+
inputReg.schema,
|
|
1009
|
+
enumRegistry,
|
|
1010
|
+
inputRegistry,
|
|
1011
|
+
inputs,
|
|
1012
|
+
enums,
|
|
1013
|
+
cache
|
|
1014
|
+
);
|
|
901
1015
|
}
|
|
902
1016
|
}
|
|
903
1017
|
const innerResult = toGraphQLInputTypeWithRegistry(
|