@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 CHANGED
@@ -722,26 +722,56 @@ function toGraphQLInputTypeWithRegistry(schema, enumRegistry, inputRegistry, inp
722
722
  if (memberAst._tag === "UndefinedKeyword") continue;
723
723
  const inputName = cache?.astToInputName?.get(memberAst);
724
724
  if (inputName) {
725
- const result = inputRegistry.get(inputName);
726
- if (result) return result;
725
+ const inputReg = inputs.get(inputName);
726
+ if (inputReg) {
727
+ return toGraphQLInputTypeWithRegistry(
728
+ inputReg.schema,
729
+ enumRegistry,
730
+ inputRegistry,
731
+ inputs,
732
+ enums,
733
+ cache
734
+ );
735
+ }
727
736
  }
728
- for (const [regInputName, inputReg] of inputs) {
737
+ for (const [, inputReg] of inputs) {
729
738
  if (inputReg.schema.ast === memberAst) {
730
- const result = inputRegistry.get(regInputName);
731
- if (result) return result;
739
+ return toGraphQLInputTypeWithRegistry(
740
+ inputReg.schema,
741
+ enumRegistry,
742
+ inputRegistry,
743
+ inputs,
744
+ enums,
745
+ cache
746
+ );
732
747
  }
733
748
  }
734
749
  if (memberAst._tag === "Transformation") {
735
750
  const innerToAst = memberAst.to;
736
751
  const transformedInputName = cache?.astToInputName?.get(innerToAst);
737
752
  if (transformedInputName) {
738
- const result = inputRegistry.get(transformedInputName);
739
- if (result) return result;
753
+ const inputReg = inputs.get(transformedInputName);
754
+ if (inputReg) {
755
+ return toGraphQLInputTypeWithRegistry(
756
+ inputReg.schema,
757
+ enumRegistry,
758
+ inputRegistry,
759
+ inputs,
760
+ enums,
761
+ cache
762
+ );
763
+ }
740
764
  }
741
- for (const [regInputName, inputReg] of inputs) {
765
+ for (const [, inputReg] of inputs) {
742
766
  if (inputReg.schema.ast === innerToAst) {
743
- const result = inputRegistry.get(regInputName);
744
- if (result) return result;
767
+ return toGraphQLInputTypeWithRegistry(
768
+ inputReg.schema,
769
+ enumRegistry,
770
+ inputRegistry,
771
+ inputs,
772
+ enums,
773
+ cache
774
+ );
745
775
  }
746
776
  }
747
777
  }
@@ -753,25 +783,52 @@ function toGraphQLInputTypeWithRegistry(schema, enumRegistry, inputRegistry, inp
753
783
  const valueType = valueField.type;
754
784
  const valueInputName = cache?.astToInputName?.get(valueType);
755
785
  if (valueInputName) {
756
- const result = inputRegistry.get(valueInputName);
757
- if (result) return result;
786
+ const inputReg = inputs.get(valueInputName);
787
+ if (inputReg) {
788
+ return toGraphQLInputTypeWithRegistry(
789
+ inputReg.schema,
790
+ enumRegistry,
791
+ inputRegistry,
792
+ inputs,
793
+ enums,
794
+ cache
795
+ );
796
+ }
758
797
  }
759
- for (const [regInputName, inputReg] of inputs) {
798
+ for (const [, inputReg] of inputs) {
760
799
  if (inputReg.schema.ast === valueType) {
761
- const result = inputRegistry.get(regInputName);
762
- if (result) return result;
800
+ return toGraphQLInputTypeWithRegistry(
801
+ inputReg.schema,
802
+ enumRegistry,
803
+ inputRegistry,
804
+ inputs,
805
+ enums,
806
+ cache
807
+ );
763
808
  }
764
809
  let regAst = inputReg.schema.ast;
765
810
  while (regAst._tag === "Transformation") {
766
811
  regAst = regAst.to;
767
812
  if (regAst === valueType) {
768
- const result = inputRegistry.get(regInputName);
769
- if (result) return result;
813
+ return toGraphQLInputTypeWithRegistry(
814
+ inputReg.schema,
815
+ enumRegistry,
816
+ inputRegistry,
817
+ inputs,
818
+ enums,
819
+ cache
820
+ );
770
821
  }
771
822
  }
772
823
  if (regAst._tag === "Declaration" && regAst.typeParameters?.[0] === valueType) {
773
- const result = inputRegistry.get(regInputName);
774
- if (result) return result;
824
+ return toGraphQLInputTypeWithRegistry(
825
+ inputReg.schema,
826
+ enumRegistry,
827
+ inputRegistry,
828
+ inputs,
829
+ enums,
830
+ cache
831
+ );
775
832
  }
776
833
  }
777
834
  const innerResult = toGraphQLInputTypeWithRegistry(
@@ -824,26 +881,56 @@ function toGraphQLInputTypeWithRegistry(schema, enumRegistry, inputRegistry, inp
824
881
  for (const memberAst of unionAst.types) {
825
882
  const inputName = cache?.astToInputName?.get(memberAst);
826
883
  if (inputName) {
827
- const result = inputRegistry.get(inputName);
828
- if (result) return result;
884
+ const inputReg = inputs.get(inputName);
885
+ if (inputReg) {
886
+ return toGraphQLInputTypeWithRegistry(
887
+ inputReg.schema,
888
+ enumRegistry,
889
+ inputRegistry,
890
+ inputs,
891
+ enums,
892
+ cache
893
+ );
894
+ }
829
895
  }
830
- for (const [regInputName, inputReg] of inputs) {
896
+ for (const [, inputReg] of inputs) {
831
897
  if (inputReg.schema.ast === memberAst) {
832
- const result = inputRegistry.get(regInputName);
833
- if (result) return result;
898
+ return toGraphQLInputTypeWithRegistry(
899
+ inputReg.schema,
900
+ enumRegistry,
901
+ inputRegistry,
902
+ inputs,
903
+ enums,
904
+ cache
905
+ );
834
906
  }
835
907
  }
836
908
  if (memberAst._tag === "Transformation") {
837
909
  const toAst = memberAst.to;
838
910
  const transformedInputName = cache?.astToInputName?.get(toAst);
839
911
  if (transformedInputName) {
840
- const result = inputRegistry.get(transformedInputName);
841
- if (result) return result;
912
+ const inputReg = inputs.get(transformedInputName);
913
+ if (inputReg) {
914
+ return toGraphQLInputTypeWithRegistry(
915
+ inputReg.schema,
916
+ enumRegistry,
917
+ inputRegistry,
918
+ inputs,
919
+ enums,
920
+ cache
921
+ );
922
+ }
842
923
  }
843
- for (const [regInputName, inputReg] of inputs) {
924
+ for (const [, inputReg] of inputs) {
844
925
  if (inputReg.schema.ast === toAst) {
845
- const result = inputRegistry.get(regInputName);
846
- if (result) return result;
926
+ return toGraphQLInputTypeWithRegistry(
927
+ inputReg.schema,
928
+ enumRegistry,
929
+ inputRegistry,
930
+ inputs,
931
+ enums,
932
+ cache
933
+ );
847
934
  }
848
935
  }
849
936
  }
@@ -855,25 +942,52 @@ function toGraphQLInputTypeWithRegistry(schema, enumRegistry, inputRegistry, inp
855
942
  const valueType = valueField.type;
856
943
  const valueInputName = cache?.astToInputName?.get(valueType);
857
944
  if (valueInputName) {
858
- const result = inputRegistry.get(valueInputName);
859
- if (result) return result;
945
+ const inputReg = inputs.get(valueInputName);
946
+ if (inputReg) {
947
+ return toGraphQLInputTypeWithRegistry(
948
+ inputReg.schema,
949
+ enumRegistry,
950
+ inputRegistry,
951
+ inputs,
952
+ enums,
953
+ cache
954
+ );
955
+ }
860
956
  }
861
- for (const [regInputName, inputReg] of inputs) {
957
+ for (const [, inputReg] of inputs) {
862
958
  if (inputReg.schema.ast === valueType) {
863
- const result = inputRegistry.get(regInputName);
864
- if (result) return result;
959
+ return toGraphQLInputTypeWithRegistry(
960
+ inputReg.schema,
961
+ enumRegistry,
962
+ inputRegistry,
963
+ inputs,
964
+ enums,
965
+ cache
966
+ );
865
967
  }
866
968
  let regAst = inputReg.schema.ast;
867
969
  while (regAst._tag === "Transformation") {
868
970
  regAst = regAst.to;
869
971
  if (regAst === valueType) {
870
- const result = inputRegistry.get(regInputName);
871
- if (result) return result;
972
+ return toGraphQLInputTypeWithRegistry(
973
+ inputReg.schema,
974
+ enumRegistry,
975
+ inputRegistry,
976
+ inputs,
977
+ enums,
978
+ cache
979
+ );
872
980
  }
873
981
  }
874
982
  if (regAst._tag === "Declaration" && regAst.typeParameters?.[0] === valueType) {
875
- const result = inputRegistry.get(regInputName);
876
- if (result) return result;
983
+ return toGraphQLInputTypeWithRegistry(
984
+ inputReg.schema,
985
+ enumRegistry,
986
+ inputRegistry,
987
+ inputs,
988
+ enums,
989
+ cache
990
+ );
877
991
  }
878
992
  }
879
993
  const innerResult = toGraphQLInputTypeWithRegistry(