@contember/engine-content-api 2.2.0-alpha.2 → 2.2.0-alpha.20

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.
Files changed (1205) hide show
  1. package/CLAUDE.md +25 -7
  2. package/dist/development/index.cjs +36 -0
  3. package/dist/development/index.cjs.map +1 -1
  4. package/dist/development/index.js +40 -4
  5. package/dist/development/index.js.map +1 -1
  6. package/dist/development/src/ExecutionContainer.cjs +18 -10
  7. package/dist/development/src/ExecutionContainer.cjs.map +1 -1
  8. package/dist/development/src/ExecutionContainer.js +18 -10
  9. package/dist/development/src/ExecutionContainer.js.map +1 -1
  10. package/dist/development/src/acl/AclScope.cjs +7 -0
  11. package/dist/development/src/acl/AclScope.cjs.map +1 -0
  12. package/dist/development/src/acl/AclScope.js +7 -0
  13. package/dist/development/src/acl/AclScope.js.map +1 -0
  14. package/dist/development/src/acl/Authorizator.cjs +6 -4
  15. package/dist/development/src/acl/Authorizator.cjs.map +1 -1
  16. package/dist/development/src/acl/Authorizator.js +6 -4
  17. package/dist/development/src/acl/Authorizator.js.map +1 -1
  18. package/dist/development/src/acl/EvaluatedPredicateReplacer.cjs +4 -1
  19. package/dist/development/src/acl/EvaluatedPredicateReplacer.cjs.map +1 -1
  20. package/dist/development/src/acl/EvaluatedPredicateReplacer.js +4 -1
  21. package/dist/development/src/acl/EvaluatedPredicateReplacer.js.map +1 -1
  22. package/dist/development/src/acl/PermissionFactory.cjs +57 -68
  23. package/dist/development/src/acl/PermissionFactory.cjs.map +1 -1
  24. package/dist/development/src/acl/PermissionFactory.js +58 -69
  25. package/dist/development/src/acl/PermissionFactory.js.map +1 -1
  26. package/dist/development/src/acl/PredicateFactory.cjs +95 -26
  27. package/dist/development/src/acl/PredicateFactory.cjs.map +1 -1
  28. package/dist/development/src/acl/PredicateFactory.js +95 -26
  29. package/dist/development/src/acl/PredicateFactory.js.map +1 -1
  30. package/dist/development/src/acl/PredicatesInjector.cjs +97 -99
  31. package/dist/development/src/acl/PredicatesInjector.cjs.map +1 -1
  32. package/dist/development/src/acl/PredicatesInjector.js +99 -101
  33. package/dist/development/src/acl/PredicatesInjector.js.map +1 -1
  34. package/dist/development/src/acl/VariableInjector.cjs +7 -2
  35. package/dist/development/src/acl/VariableInjector.cjs.map +1 -1
  36. package/dist/development/src/acl/VariableInjector.js +7 -2
  37. package/dist/development/src/acl/VariableInjector.js.map +1 -1
  38. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.cjs +28 -2
  39. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.cjs.map +1 -1
  40. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.js +29 -3
  41. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.js.map +1 -1
  42. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.cjs +16 -1
  43. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.cjs.map +1 -1
  44. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.js +16 -1
  45. package/dist/development/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.js.map +1 -1
  46. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.cjs +29 -3
  47. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.cjs.map +1 -1
  48. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.js +29 -3
  49. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.js.map +1 -1
  50. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.cjs +14 -0
  51. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.cjs.map +1 -1
  52. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.js +14 -0
  53. package/dist/development/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.js.map +1 -1
  54. package/dist/development/src/input-validation/ValidationDataSelector.cjs +2 -2
  55. package/dist/development/src/input-validation/ValidationDataSelector.cjs.map +1 -1
  56. package/dist/development/src/input-validation/ValidationDataSelector.js +2 -2
  57. package/dist/development/src/input-validation/ValidationDataSelector.js.map +1 -1
  58. package/dist/development/src/input-validation/preValidation/UpdateInputPreValidationProcessor.cjs +24 -3
  59. package/dist/development/src/input-validation/preValidation/UpdateInputPreValidationProcessor.cjs.map +1 -1
  60. package/dist/development/src/input-validation/preValidation/UpdateInputPreValidationProcessor.js +24 -3
  61. package/dist/development/src/input-validation/preValidation/UpdateInputPreValidationProcessor.js.map +1 -1
  62. package/dist/development/src/inputProcessing/UpdateInputVisitor.cjs +52 -2
  63. package/dist/development/src/inputProcessing/UpdateInputVisitor.cjs.map +1 -1
  64. package/dist/development/src/inputProcessing/UpdateInputVisitor.js +52 -2
  65. package/dist/development/src/inputProcessing/UpdateInputVisitor.js.map +1 -1
  66. package/dist/development/src/introspection/IntrospectionSchemaFactory.cjs +11 -6
  67. package/dist/development/src/introspection/IntrospectionSchemaFactory.cjs.map +1 -1
  68. package/dist/development/src/introspection/IntrospectionSchemaFactory.js +11 -6
  69. package/dist/development/src/introspection/IntrospectionSchemaFactory.js.map +1 -1
  70. package/dist/development/src/introspection/introspection.schema.cjs +2 -2
  71. package/dist/development/src/introspection/introspection.schema.cjs.map +1 -1
  72. package/dist/development/src/introspection/introspection.schema.js +2 -2
  73. package/dist/development/src/introspection/introspection.schema.js.map +1 -1
  74. package/dist/development/src/mapper/ErrorUtils.cjs +17 -1
  75. package/dist/development/src/mapper/ErrorUtils.cjs.map +1 -1
  76. package/dist/development/src/mapper/ErrorUtils.js +17 -1
  77. package/dist/development/src/mapper/ErrorUtils.js.map +1 -1
  78. package/dist/development/src/mapper/JunctionTableManager.cjs +18 -12
  79. package/dist/development/src/mapper/JunctionTableManager.cjs.map +1 -1
  80. package/dist/development/src/mapper/JunctionTableManager.js +19 -13
  81. package/dist/development/src/mapper/JunctionTableManager.js.map +1 -1
  82. package/dist/development/src/mapper/Mapper.cjs +111 -37
  83. package/dist/development/src/mapper/Mapper.cjs.map +1 -1
  84. package/dist/development/src/mapper/Mapper.js +112 -38
  85. package/dist/development/src/mapper/Mapper.js.map +1 -1
  86. package/dist/development/src/mapper/MapperFactory.cjs +7 -4
  87. package/dist/development/src/mapper/MapperFactory.cjs.map +1 -1
  88. package/dist/development/src/mapper/MapperFactory.js +7 -4
  89. package/dist/development/src/mapper/MapperFactory.js.map +1 -1
  90. package/dist/development/src/mapper/MutationProcessorHelper.cjs +12 -0
  91. package/dist/development/src/mapper/MutationProcessorHelper.cjs.map +1 -1
  92. package/dist/development/src/mapper/MutationProcessorHelper.js +13 -1
  93. package/dist/development/src/mapper/MutationProcessorHelper.js.map +1 -1
  94. package/dist/development/src/mapper/Result.cjs +1 -0
  95. package/dist/development/src/mapper/Result.cjs.map +1 -1
  96. package/dist/development/src/mapper/Result.js +1 -0
  97. package/dist/development/src/mapper/Result.js.map +1 -1
  98. package/dist/development/src/mapper/delete/DeleteExecutor.cjs +15 -8
  99. package/dist/development/src/mapper/delete/DeleteExecutor.cjs.map +1 -1
  100. package/dist/development/src/mapper/delete/DeleteExecutor.js +15 -8
  101. package/dist/development/src/mapper/delete/DeleteExecutor.js.map +1 -1
  102. package/dist/development/src/mapper/insert/InsertBuilder.cjs +3 -2
  103. package/dist/development/src/mapper/insert/InsertBuilder.cjs.map +1 -1
  104. package/dist/development/src/mapper/insert/InsertBuilder.js +3 -2
  105. package/dist/development/src/mapper/insert/InsertBuilder.js.map +1 -1
  106. package/dist/development/src/mapper/insert/InsertBuilderFactory.cjs +2 -2
  107. package/dist/development/src/mapper/insert/InsertBuilderFactory.cjs.map +1 -1
  108. package/dist/development/src/mapper/insert/InsertBuilderFactory.js +2 -2
  109. package/dist/development/src/mapper/insert/InsertBuilderFactory.js.map +1 -1
  110. package/dist/development/src/mapper/insert/Inserter.cjs +3 -3
  111. package/dist/development/src/mapper/insert/Inserter.cjs.map +1 -1
  112. package/dist/development/src/mapper/insert/Inserter.js +3 -3
  113. package/dist/development/src/mapper/insert/Inserter.js.map +1 -1
  114. package/dist/development/src/mapper/insert/SqlCreateInputProcessor.cjs +3 -2
  115. package/dist/development/src/mapper/insert/SqlCreateInputProcessor.cjs.map +1 -1
  116. package/dist/development/src/mapper/insert/SqlCreateInputProcessor.js +3 -2
  117. package/dist/development/src/mapper/insert/SqlCreateInputProcessor.js.map +1 -1
  118. package/dist/development/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.cjs +9 -8
  119. package/dist/development/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.cjs.map +1 -1
  120. package/dist/development/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.js +9 -8
  121. package/dist/development/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.js.map +1 -1
  122. package/dist/development/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.cjs +4 -4
  123. package/dist/development/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.cjs.map +1 -1
  124. package/dist/development/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.js +4 -4
  125. package/dist/development/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.js.map +1 -1
  126. package/dist/development/src/mapper/insert/relations/OneHasManyCreateInputProcessor.cjs +3 -3
  127. package/dist/development/src/mapper/insert/relations/OneHasManyCreateInputProcessor.cjs.map +1 -1
  128. package/dist/development/src/mapper/insert/relations/OneHasManyCreateInputProcessor.js +3 -3
  129. package/dist/development/src/mapper/insert/relations/OneHasManyCreateInputProcessor.js.map +1 -1
  130. package/dist/development/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.cjs +7 -7
  131. package/dist/development/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.cjs.map +1 -1
  132. package/dist/development/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.js +7 -7
  133. package/dist/development/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.js.map +1 -1
  134. package/dist/development/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.cjs +6 -6
  135. package/dist/development/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.cjs.map +1 -1
  136. package/dist/development/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.js +6 -6
  137. package/dist/development/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.js.map +1 -1
  138. package/dist/development/src/mapper/select/ConditionBuilder.cjs +8 -1
  139. package/dist/development/src/mapper/select/ConditionBuilder.cjs.map +1 -1
  140. package/dist/development/src/mapper/select/ConditionBuilder.js +8 -1
  141. package/dist/development/src/mapper/select/ConditionBuilder.js.map +1 -1
  142. package/dist/development/src/mapper/select/JoinBuilder.cjs +26 -4
  143. package/dist/development/src/mapper/select/JoinBuilder.cjs.map +1 -1
  144. package/dist/development/src/mapper/select/JoinBuilder.js +27 -5
  145. package/dist/development/src/mapper/select/JoinBuilder.js.map +1 -1
  146. package/dist/development/src/mapper/select/OrderByBuilder.cjs +84 -15
  147. package/dist/development/src/mapper/select/OrderByBuilder.cjs.map +1 -1
  148. package/dist/development/src/mapper/select/OrderByBuilder.js +86 -17
  149. package/dist/development/src/mapper/select/OrderByBuilder.js.map +1 -1
  150. package/dist/development/src/mapper/select/OrderByHelper.cjs +17 -7
  151. package/dist/development/src/mapper/select/OrderByHelper.cjs.map +1 -1
  152. package/dist/development/src/mapper/select/OrderByHelper.js +17 -7
  153. package/dist/development/src/mapper/select/OrderByHelper.js.map +1 -1
  154. package/dist/development/src/mapper/select/Path.cjs +25 -3
  155. package/dist/development/src/mapper/select/Path.cjs.map +1 -1
  156. package/dist/development/src/mapper/select/Path.js +26 -4
  157. package/dist/development/src/mapper/select/Path.js.map +1 -1
  158. package/dist/development/src/mapper/select/RelationFetcher.cjs +6 -5
  159. package/dist/development/src/mapper/select/RelationFetcher.cjs.map +1 -1
  160. package/dist/development/src/mapper/select/RelationFetcher.js +6 -5
  161. package/dist/development/src/mapper/select/RelationFetcher.js.map +1 -1
  162. package/dist/development/src/mapper/select/SelectBuilder.cjs +15 -21
  163. package/dist/development/src/mapper/select/SelectBuilder.cjs.map +1 -1
  164. package/dist/development/src/mapper/select/SelectBuilder.js +13 -19
  165. package/dist/development/src/mapper/select/SelectBuilder.js.map +1 -1
  166. package/dist/development/src/mapper/select/SelectHydrator.cjs +92 -31
  167. package/dist/development/src/mapper/select/SelectHydrator.cjs.map +1 -1
  168. package/dist/development/src/mapper/select/SelectHydrator.js +92 -31
  169. package/dist/development/src/mapper/select/SelectHydrator.js.map +1 -1
  170. package/dist/development/src/mapper/select/WhereBuilder.cjs +261 -47
  171. package/dist/development/src/mapper/select/WhereBuilder.cjs.map +1 -1
  172. package/dist/development/src/mapper/select/WhereBuilder.js +262 -48
  173. package/dist/development/src/mapper/select/WhereBuilder.js.map +1 -1
  174. package/dist/development/src/mapper/select/getFieldReadPredicate.cjs +8 -0
  175. package/dist/development/src/mapper/select/getFieldReadPredicate.cjs.map +1 -0
  176. package/dist/development/src/mapper/select/getFieldReadPredicate.js +8 -0
  177. package/dist/development/src/mapper/select/getFieldReadPredicate.js.map +1 -0
  178. package/dist/development/src/mapper/select/handlers/FieldsVisitor.cjs +9 -13
  179. package/dist/development/src/mapper/select/handlers/FieldsVisitor.cjs.map +1 -1
  180. package/dist/development/src/mapper/select/handlers/FieldsVisitor.js +10 -14
  181. package/dist/development/src/mapper/select/handlers/FieldsVisitor.js.map +1 -1
  182. package/dist/development/src/mapper/select/handlers/MetaHandler.cjs +6 -2
  183. package/dist/development/src/mapper/select/handlers/MetaHandler.cjs.map +1 -1
  184. package/dist/development/src/mapper/select/handlers/MetaHandler.js +6 -2
  185. package/dist/development/src/mapper/select/handlers/MetaHandler.js.map +1 -1
  186. package/dist/development/src/mapper/select/optimizer/WhereOptimizer.cjs +229 -3
  187. package/dist/development/src/mapper/select/optimizer/WhereOptimizer.cjs.map +1 -1
  188. package/dist/development/src/mapper/select/optimizer/WhereOptimizer.js +230 -4
  189. package/dist/development/src/mapper/select/optimizer/WhereOptimizer.js.map +1 -1
  190. package/dist/development/src/mapper/select/optimizer/WhereReplacer.cjs +3 -3
  191. package/dist/development/src/mapper/select/optimizer/WhereReplacer.cjs.map +1 -1
  192. package/dist/development/src/mapper/select/optimizer/WhereReplacer.js +1 -1
  193. package/dist/development/src/mapper/select/optimizer/WhereReplacer.js.map +1 -1
  194. package/dist/development/src/mapper/update/SqlUpdateInputProcessor.cjs +9 -5
  195. package/dist/development/src/mapper/update/SqlUpdateInputProcessor.cjs.map +1 -1
  196. package/dist/development/src/mapper/update/SqlUpdateInputProcessor.js +10 -6
  197. package/dist/development/src/mapper/update/SqlUpdateInputProcessor.js.map +1 -1
  198. package/dist/development/src/mapper/update/UpdateBuilder.cjs +35 -2
  199. package/dist/development/src/mapper/update/UpdateBuilder.cjs.map +1 -1
  200. package/dist/development/src/mapper/update/UpdateBuilder.js +36 -3
  201. package/dist/development/src/mapper/update/UpdateBuilder.js.map +1 -1
  202. package/dist/development/src/mapper/update/UpdateBuilderFactory.cjs +3 -2
  203. package/dist/development/src/mapper/update/UpdateBuilderFactory.cjs.map +1 -1
  204. package/dist/development/src/mapper/update/UpdateBuilderFactory.js +3 -2
  205. package/dist/development/src/mapper/update/UpdateBuilderFactory.js.map +1 -1
  206. package/dist/development/src/mapper/update/Updater.cjs +12 -6
  207. package/dist/development/src/mapper/update/Updater.cjs.map +1 -1
  208. package/dist/development/src/mapper/update/Updater.js +13 -7
  209. package/dist/development/src/mapper/update/Updater.js.map +1 -1
  210. package/dist/development/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.cjs +33 -19
  211. package/dist/development/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.cjs.map +1 -1
  212. package/dist/development/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.js +33 -19
  213. package/dist/development/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.js.map +1 -1
  214. package/dist/development/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.cjs +13 -11
  215. package/dist/development/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.cjs.map +1 -1
  216. package/dist/development/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.js +13 -11
  217. package/dist/development/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.js.map +1 -1
  218. package/dist/development/src/mapper/update/relations/OneHasManyUpdateInputProcessor.cjs +17 -8
  219. package/dist/development/src/mapper/update/relations/OneHasManyUpdateInputProcessor.cjs.map +1 -1
  220. package/dist/development/src/mapper/update/relations/OneHasManyUpdateInputProcessor.js +17 -8
  221. package/dist/development/src/mapper/update/relations/OneHasManyUpdateInputProcessor.js.map +1 -1
  222. package/dist/development/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.cjs +19 -16
  223. package/dist/development/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.cjs.map +1 -1
  224. package/dist/development/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.js +19 -16
  225. package/dist/development/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.js.map +1 -1
  226. package/dist/development/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.cjs +19 -16
  227. package/dist/development/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.cjs.map +1 -1
  228. package/dist/development/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.js +19 -16
  229. package/dist/development/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.js.map +1 -1
  230. package/dist/development/src/mapper/update/relations/SetManyRelationHelper.cjs +123 -0
  231. package/dist/development/src/mapper/update/relations/SetManyRelationHelper.cjs.map +1 -0
  232. package/dist/development/src/mapper/update/relations/SetManyRelationHelper.js +123 -0
  233. package/dist/development/src/mapper/update/relations/SetManyRelationHelper.js.map +1 -0
  234. package/dist/development/src/resolvers/GraphQlQueryAstFactory.cjs.map +1 -1
  235. package/dist/development/src/resolvers/GraphQlQueryAstFactory.js.map +1 -1
  236. package/dist/development/src/resolvers/MutationResolver.cjs +76 -79
  237. package/dist/development/src/resolvers/MutationResolver.cjs.map +1 -1
  238. package/dist/development/src/resolvers/MutationResolver.js +78 -81
  239. package/dist/development/src/resolvers/MutationResolver.js.map +1 -1
  240. package/dist/development/src/resolvers/ReadHelpers.cjs +17 -6
  241. package/dist/development/src/resolvers/ReadHelpers.cjs.map +1 -1
  242. package/dist/development/src/resolvers/ReadHelpers.js +17 -6
  243. package/dist/development/src/resolvers/ReadHelpers.js.map +1 -1
  244. package/dist/development/src/resolvers/ReadResolver.cjs +27 -22
  245. package/dist/development/src/resolvers/ReadResolver.cjs.map +1 -1
  246. package/dist/development/src/resolvers/ReadResolver.js +27 -22
  247. package/dist/development/src/resolvers/ReadResolver.js.map +1 -1
  248. package/dist/development/src/schema/CustomTypesProvider.cjs +35 -14
  249. package/dist/development/src/schema/CustomTypesProvider.cjs.map +1 -1
  250. package/dist/development/src/schema/CustomTypesProvider.js +36 -15
  251. package/dist/development/src/schema/CustomTypesProvider.js.map +1 -1
  252. package/dist/development/src/schema/EntityTypeProvider.cjs +11 -7
  253. package/dist/development/src/schema/EntityTypeProvider.cjs.map +1 -1
  254. package/dist/development/src/schema/EntityTypeProvider.js +11 -7
  255. package/dist/development/src/schema/EntityTypeProvider.js.map +1 -1
  256. package/dist/development/src/schema/GraphQlSchemaBuilder.cjs +16 -6
  257. package/dist/development/src/schema/GraphQlSchemaBuilder.cjs.map +1 -1
  258. package/dist/development/src/schema/GraphQlSchemaBuilder.js +16 -6
  259. package/dist/development/src/schema/GraphQlSchemaBuilder.js.map +1 -1
  260. package/dist/development/src/schema/GraphQlSchemaBuilderFactory.cjs +39 -11
  261. package/dist/development/src/schema/GraphQlSchemaBuilderFactory.cjs.map +1 -1
  262. package/dist/development/src/schema/GraphQlSchemaBuilderFactory.js +39 -11
  263. package/dist/development/src/schema/GraphQlSchemaBuilderFactory.js.map +1 -1
  264. package/dist/development/src/schema/MutationProvider.cjs +38 -16
  265. package/dist/development/src/schema/MutationProvider.cjs.map +1 -1
  266. package/dist/development/src/schema/MutationProvider.js +38 -16
  267. package/dist/development/src/schema/MutationProvider.js.map +1 -1
  268. package/dist/development/src/schema/OrderByTypeProvider.cjs +8 -2
  269. package/dist/development/src/schema/OrderByTypeProvider.cjs.map +1 -1
  270. package/dist/development/src/schema/OrderByTypeProvider.js +9 -3
  271. package/dist/development/src/schema/OrderByTypeProvider.js.map +1 -1
  272. package/dist/development/src/schema/QueryProvider.cjs +12 -11
  273. package/dist/development/src/schema/QueryProvider.cjs.map +1 -1
  274. package/dist/development/src/schema/QueryProvider.js +12 -11
  275. package/dist/development/src/schema/QueryProvider.js.map +1 -1
  276. package/dist/development/src/schema/ValidationQueriesProvider.cjs +2 -0
  277. package/dist/development/src/schema/ValidationQueriesProvider.cjs.map +1 -1
  278. package/dist/development/src/schema/ValidationQueriesProvider.js +2 -0
  279. package/dist/development/src/schema/ValidationQueriesProvider.js.map +1 -1
  280. package/dist/development/src/schema/WhereTypeProvider.cjs +17 -5
  281. package/dist/development/src/schema/WhereTypeProvider.cjs.map +1 -1
  282. package/dist/development/src/schema/WhereTypeProvider.js +18 -6
  283. package/dist/development/src/schema/WhereTypeProvider.js.map +1 -1
  284. package/dist/development/src/schema/calendarDate.cjs +21 -0
  285. package/dist/development/src/schema/calendarDate.cjs.map +1 -0
  286. package/dist/development/src/schema/calendarDate.js +21 -0
  287. package/dist/development/src/schema/calendarDate.js.map +1 -0
  288. package/dist/development/src/schema/entities/FieldTypeVisitor.cjs +15 -2
  289. package/dist/development/src/schema/entities/FieldTypeVisitor.cjs.map +1 -1
  290. package/dist/development/src/schema/entities/FieldTypeVisitor.js +15 -2
  291. package/dist/development/src/schema/entities/FieldTypeVisitor.js.map +1 -1
  292. package/dist/development/src/schema/mutations/CreateEntityInputFieldVisitor.cjs +11 -3
  293. package/dist/development/src/schema/mutations/CreateEntityInputFieldVisitor.cjs.map +1 -1
  294. package/dist/development/src/schema/mutations/CreateEntityInputFieldVisitor.js +11 -3
  295. package/dist/development/src/schema/mutations/CreateEntityInputFieldVisitor.js.map +1 -1
  296. package/dist/development/src/schema/mutations/UpdateEntityInputFieldVisitor.cjs +11 -3
  297. package/dist/development/src/schema/mutations/UpdateEntityInputFieldVisitor.cjs.map +1 -1
  298. package/dist/development/src/schema/mutations/UpdateEntityInputFieldVisitor.js +11 -3
  299. package/dist/development/src/schema/mutations/UpdateEntityInputFieldVisitor.js.map +1 -1
  300. package/dist/development/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.cjs +39 -2
  301. package/dist/development/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.cjs.map +1 -1
  302. package/dist/development/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.js +40 -3
  303. package/dist/development/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.js.map +1 -1
  304. package/dist/development/src/schema/utils.cjs +10 -0
  305. package/dist/development/src/schema/utils.cjs.map +1 -1
  306. package/dist/development/src/schema/utils.js +11 -1
  307. package/dist/development/src/schema/utils.js.map +1 -1
  308. package/dist/development/src/schema-json/GraphQLJsBridge.cjs +108 -0
  309. package/dist/development/src/schema-json/GraphQLJsBridge.cjs.map +1 -0
  310. package/dist/development/src/schema-json/GraphQLJsBridge.js +108 -0
  311. package/dist/development/src/schema-json/GraphQLJsBridge.js.map +1 -0
  312. package/dist/development/src/schema-json/JsonColumnTypes.cjs +102 -0
  313. package/dist/development/src/schema-json/JsonColumnTypes.cjs.map +1 -0
  314. package/dist/development/src/schema-json/JsonColumnTypes.js +102 -0
  315. package/dist/development/src/schema-json/JsonColumnTypes.js.map +1 -0
  316. package/dist/development/src/schema-json/JsonContentSchemaBuilder.cjs +418 -0
  317. package/dist/development/src/schema-json/JsonContentSchemaBuilder.cjs.map +1 -0
  318. package/dist/development/src/schema-json/JsonContentSchemaBuilder.js +418 -0
  319. package/dist/development/src/schema-json/JsonContentSchemaBuilder.js.map +1 -0
  320. package/dist/development/src/schema-json/JsonContentSchemaShared.cjs +18 -0
  321. package/dist/development/src/schema-json/JsonContentSchemaShared.cjs.map +1 -0
  322. package/dist/development/src/schema-json/JsonContentSchemaShared.js +18 -0
  323. package/dist/development/src/schema-json/JsonContentSchemaShared.js.map +1 -0
  324. package/dist/development/src/schema-json/JsonEntityTypes.cjs +206 -0
  325. package/dist/development/src/schema-json/JsonEntityTypes.cjs.map +1 -0
  326. package/dist/development/src/schema-json/JsonEntityTypes.js +206 -0
  327. package/dist/development/src/schema-json/JsonEntityTypes.js.map +1 -0
  328. package/dist/development/src/schema-json/JsonFilterTypes.cjs +152 -0
  329. package/dist/development/src/schema-json/JsonFilterTypes.cjs.map +1 -0
  330. package/dist/development/src/schema-json/JsonFilterTypes.js +152 -0
  331. package/dist/development/src/schema-json/JsonFilterTypes.js.map +1 -0
  332. package/dist/development/src/schema-json/JsonInputTypes.cjs +256 -0
  333. package/dist/development/src/schema-json/JsonInputTypes.cjs.map +1 -0
  334. package/dist/development/src/schema-json/JsonInputTypes.js +256 -0
  335. package/dist/development/src/schema-json/JsonInputTypes.js.map +1 -0
  336. package/dist/development/src/schema-json/JsonIntrospectionExtension.cjs +36 -0
  337. package/dist/development/src/schema-json/JsonIntrospectionExtension.cjs.map +1 -0
  338. package/dist/development/src/schema-json/JsonIntrospectionExtension.js +36 -0
  339. package/dist/development/src/schema-json/JsonIntrospectionExtension.js.map +1 -0
  340. package/dist/development/src/schema-json/JsonQueryAstFactory.cjs +107 -0
  341. package/dist/development/src/schema-json/JsonQueryAstFactory.cjs.map +1 -0
  342. package/dist/development/src/schema-json/JsonQueryAstFactory.js +107 -0
  343. package/dist/development/src/schema-json/JsonQueryAstFactory.js.map +1 -0
  344. package/dist/development/src/schema-json/JsonTypeRegistry.cjs +230 -0
  345. package/dist/development/src/schema-json/JsonTypeRegistry.cjs.map +1 -0
  346. package/dist/development/src/schema-json/JsonTypeRegistry.js +230 -0
  347. package/dist/development/src/schema-json/JsonTypeRegistry.js.map +1 -0
  348. package/dist/development/src/utils/ResolveInfoUtils.cjs.map +1 -1
  349. package/dist/development/src/utils/ResolveInfoUtils.js.map +1 -1
  350. package/dist/development/src/utils/uniqueWhereFields.cjs +10 -0
  351. package/dist/development/src/utils/uniqueWhereFields.cjs.map +1 -1
  352. package/dist/development/src/utils/uniqueWhereFields.js +10 -0
  353. package/dist/development/src/utils/uniqueWhereFields.js.map +1 -1
  354. package/dist/production/index.cjs +36 -0
  355. package/dist/production/index.cjs.map +1 -1
  356. package/dist/production/index.js +40 -4
  357. package/dist/production/index.js.map +1 -1
  358. package/dist/production/src/ExecutionContainer.cjs +18 -10
  359. package/dist/production/src/ExecutionContainer.cjs.map +1 -1
  360. package/dist/production/src/ExecutionContainer.js +18 -10
  361. package/dist/production/src/ExecutionContainer.js.map +1 -1
  362. package/dist/production/src/acl/AclScope.cjs +7 -0
  363. package/dist/production/src/acl/AclScope.cjs.map +1 -0
  364. package/dist/production/src/acl/AclScope.js +7 -0
  365. package/dist/production/src/acl/AclScope.js.map +1 -0
  366. package/dist/production/src/acl/Authorizator.cjs +6 -4
  367. package/dist/production/src/acl/Authorizator.cjs.map +1 -1
  368. package/dist/production/src/acl/Authorizator.js +6 -4
  369. package/dist/production/src/acl/Authorizator.js.map +1 -1
  370. package/dist/production/src/acl/EvaluatedPredicateReplacer.cjs +4 -1
  371. package/dist/production/src/acl/EvaluatedPredicateReplacer.cjs.map +1 -1
  372. package/dist/production/src/acl/EvaluatedPredicateReplacer.js +4 -1
  373. package/dist/production/src/acl/EvaluatedPredicateReplacer.js.map +1 -1
  374. package/dist/production/src/acl/PermissionFactory.cjs +57 -68
  375. package/dist/production/src/acl/PermissionFactory.cjs.map +1 -1
  376. package/dist/production/src/acl/PermissionFactory.js +58 -69
  377. package/dist/production/src/acl/PermissionFactory.js.map +1 -1
  378. package/dist/production/src/acl/PredicateFactory.cjs +95 -26
  379. package/dist/production/src/acl/PredicateFactory.cjs.map +1 -1
  380. package/dist/production/src/acl/PredicateFactory.js +95 -26
  381. package/dist/production/src/acl/PredicateFactory.js.map +1 -1
  382. package/dist/production/src/acl/PredicatesInjector.cjs +97 -99
  383. package/dist/production/src/acl/PredicatesInjector.cjs.map +1 -1
  384. package/dist/production/src/acl/PredicatesInjector.js +99 -101
  385. package/dist/production/src/acl/PredicatesInjector.js.map +1 -1
  386. package/dist/production/src/acl/VariableInjector.cjs +7 -2
  387. package/dist/production/src/acl/VariableInjector.cjs.map +1 -1
  388. package/dist/production/src/acl/VariableInjector.js +7 -2
  389. package/dist/production/src/acl/VariableInjector.js.map +1 -1
  390. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.cjs +28 -2
  391. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.cjs.map +1 -1
  392. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.js +29 -3
  393. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.js.map +1 -1
  394. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.cjs +16 -1
  395. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.cjs.map +1 -1
  396. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.js +16 -1
  397. package/dist/production/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.js.map +1 -1
  398. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.cjs +29 -3
  399. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.cjs.map +1 -1
  400. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.js +29 -3
  401. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.js.map +1 -1
  402. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.cjs +14 -0
  403. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.cjs.map +1 -1
  404. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.js +14 -0
  405. package/dist/production/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.js.map +1 -1
  406. package/dist/production/src/input-validation/ValidationDataSelector.cjs +2 -2
  407. package/dist/production/src/input-validation/ValidationDataSelector.cjs.map +1 -1
  408. package/dist/production/src/input-validation/ValidationDataSelector.js +2 -2
  409. package/dist/production/src/input-validation/ValidationDataSelector.js.map +1 -1
  410. package/dist/production/src/input-validation/preValidation/UpdateInputPreValidationProcessor.cjs +24 -3
  411. package/dist/production/src/input-validation/preValidation/UpdateInputPreValidationProcessor.cjs.map +1 -1
  412. package/dist/production/src/input-validation/preValidation/UpdateInputPreValidationProcessor.js +24 -3
  413. package/dist/production/src/input-validation/preValidation/UpdateInputPreValidationProcessor.js.map +1 -1
  414. package/dist/production/src/inputProcessing/UpdateInputVisitor.cjs +52 -2
  415. package/dist/production/src/inputProcessing/UpdateInputVisitor.cjs.map +1 -1
  416. package/dist/production/src/inputProcessing/UpdateInputVisitor.js +52 -2
  417. package/dist/production/src/inputProcessing/UpdateInputVisitor.js.map +1 -1
  418. package/dist/production/src/introspection/IntrospectionSchemaFactory.cjs +11 -6
  419. package/dist/production/src/introspection/IntrospectionSchemaFactory.cjs.map +1 -1
  420. package/dist/production/src/introspection/IntrospectionSchemaFactory.js +11 -6
  421. package/dist/production/src/introspection/IntrospectionSchemaFactory.js.map +1 -1
  422. package/dist/production/src/introspection/introspection.schema.cjs +2 -2
  423. package/dist/production/src/introspection/introspection.schema.cjs.map +1 -1
  424. package/dist/production/src/introspection/introspection.schema.js +2 -2
  425. package/dist/production/src/introspection/introspection.schema.js.map +1 -1
  426. package/dist/production/src/mapper/ErrorUtils.cjs +17 -1
  427. package/dist/production/src/mapper/ErrorUtils.cjs.map +1 -1
  428. package/dist/production/src/mapper/ErrorUtils.js +17 -1
  429. package/dist/production/src/mapper/ErrorUtils.js.map +1 -1
  430. package/dist/production/src/mapper/JunctionTableManager.cjs +18 -12
  431. package/dist/production/src/mapper/JunctionTableManager.cjs.map +1 -1
  432. package/dist/production/src/mapper/JunctionTableManager.js +19 -13
  433. package/dist/production/src/mapper/JunctionTableManager.js.map +1 -1
  434. package/dist/production/src/mapper/Mapper.cjs +111 -37
  435. package/dist/production/src/mapper/Mapper.cjs.map +1 -1
  436. package/dist/production/src/mapper/Mapper.js +112 -38
  437. package/dist/production/src/mapper/Mapper.js.map +1 -1
  438. package/dist/production/src/mapper/MapperFactory.cjs +7 -4
  439. package/dist/production/src/mapper/MapperFactory.cjs.map +1 -1
  440. package/dist/production/src/mapper/MapperFactory.js +7 -4
  441. package/dist/production/src/mapper/MapperFactory.js.map +1 -1
  442. package/dist/production/src/mapper/MutationProcessorHelper.cjs +12 -0
  443. package/dist/production/src/mapper/MutationProcessorHelper.cjs.map +1 -1
  444. package/dist/production/src/mapper/MutationProcessorHelper.js +13 -1
  445. package/dist/production/src/mapper/MutationProcessorHelper.js.map +1 -1
  446. package/dist/production/src/mapper/Result.cjs +1 -0
  447. package/dist/production/src/mapper/Result.cjs.map +1 -1
  448. package/dist/production/src/mapper/Result.js +1 -0
  449. package/dist/production/src/mapper/Result.js.map +1 -1
  450. package/dist/production/src/mapper/delete/DeleteExecutor.cjs +15 -8
  451. package/dist/production/src/mapper/delete/DeleteExecutor.cjs.map +1 -1
  452. package/dist/production/src/mapper/delete/DeleteExecutor.js +15 -8
  453. package/dist/production/src/mapper/delete/DeleteExecutor.js.map +1 -1
  454. package/dist/production/src/mapper/insert/InsertBuilder.cjs +3 -2
  455. package/dist/production/src/mapper/insert/InsertBuilder.cjs.map +1 -1
  456. package/dist/production/src/mapper/insert/InsertBuilder.js +3 -2
  457. package/dist/production/src/mapper/insert/InsertBuilder.js.map +1 -1
  458. package/dist/production/src/mapper/insert/InsertBuilderFactory.cjs +2 -2
  459. package/dist/production/src/mapper/insert/InsertBuilderFactory.cjs.map +1 -1
  460. package/dist/production/src/mapper/insert/InsertBuilderFactory.js +2 -2
  461. package/dist/production/src/mapper/insert/InsertBuilderFactory.js.map +1 -1
  462. package/dist/production/src/mapper/insert/Inserter.cjs +3 -3
  463. package/dist/production/src/mapper/insert/Inserter.cjs.map +1 -1
  464. package/dist/production/src/mapper/insert/Inserter.js +3 -3
  465. package/dist/production/src/mapper/insert/Inserter.js.map +1 -1
  466. package/dist/production/src/mapper/insert/SqlCreateInputProcessor.cjs +3 -2
  467. package/dist/production/src/mapper/insert/SqlCreateInputProcessor.cjs.map +1 -1
  468. package/dist/production/src/mapper/insert/SqlCreateInputProcessor.js +3 -2
  469. package/dist/production/src/mapper/insert/SqlCreateInputProcessor.js.map +1 -1
  470. package/dist/production/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.cjs +9 -8
  471. package/dist/production/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.cjs.map +1 -1
  472. package/dist/production/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.js +9 -8
  473. package/dist/production/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.js.map +1 -1
  474. package/dist/production/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.cjs +4 -4
  475. package/dist/production/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.cjs.map +1 -1
  476. package/dist/production/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.js +4 -4
  477. package/dist/production/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.js.map +1 -1
  478. package/dist/production/src/mapper/insert/relations/OneHasManyCreateInputProcessor.cjs +3 -3
  479. package/dist/production/src/mapper/insert/relations/OneHasManyCreateInputProcessor.cjs.map +1 -1
  480. package/dist/production/src/mapper/insert/relations/OneHasManyCreateInputProcessor.js +3 -3
  481. package/dist/production/src/mapper/insert/relations/OneHasManyCreateInputProcessor.js.map +1 -1
  482. package/dist/production/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.cjs +7 -7
  483. package/dist/production/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.cjs.map +1 -1
  484. package/dist/production/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.js +7 -7
  485. package/dist/production/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.js.map +1 -1
  486. package/dist/production/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.cjs +6 -6
  487. package/dist/production/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.cjs.map +1 -1
  488. package/dist/production/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.js +6 -6
  489. package/dist/production/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.js.map +1 -1
  490. package/dist/production/src/mapper/select/ConditionBuilder.cjs +8 -1
  491. package/dist/production/src/mapper/select/ConditionBuilder.cjs.map +1 -1
  492. package/dist/production/src/mapper/select/ConditionBuilder.js +8 -1
  493. package/dist/production/src/mapper/select/ConditionBuilder.js.map +1 -1
  494. package/dist/production/src/mapper/select/JoinBuilder.cjs +26 -4
  495. package/dist/production/src/mapper/select/JoinBuilder.cjs.map +1 -1
  496. package/dist/production/src/mapper/select/JoinBuilder.js +27 -5
  497. package/dist/production/src/mapper/select/JoinBuilder.js.map +1 -1
  498. package/dist/production/src/mapper/select/OrderByBuilder.cjs +84 -15
  499. package/dist/production/src/mapper/select/OrderByBuilder.cjs.map +1 -1
  500. package/dist/production/src/mapper/select/OrderByBuilder.js +86 -17
  501. package/dist/production/src/mapper/select/OrderByBuilder.js.map +1 -1
  502. package/dist/production/src/mapper/select/OrderByHelper.cjs +17 -7
  503. package/dist/production/src/mapper/select/OrderByHelper.cjs.map +1 -1
  504. package/dist/production/src/mapper/select/OrderByHelper.js +17 -7
  505. package/dist/production/src/mapper/select/OrderByHelper.js.map +1 -1
  506. package/dist/production/src/mapper/select/Path.cjs +25 -3
  507. package/dist/production/src/mapper/select/Path.cjs.map +1 -1
  508. package/dist/production/src/mapper/select/Path.js +26 -4
  509. package/dist/production/src/mapper/select/Path.js.map +1 -1
  510. package/dist/production/src/mapper/select/RelationFetcher.cjs +6 -5
  511. package/dist/production/src/mapper/select/RelationFetcher.cjs.map +1 -1
  512. package/dist/production/src/mapper/select/RelationFetcher.js +6 -5
  513. package/dist/production/src/mapper/select/RelationFetcher.js.map +1 -1
  514. package/dist/production/src/mapper/select/SelectBuilder.cjs +15 -21
  515. package/dist/production/src/mapper/select/SelectBuilder.cjs.map +1 -1
  516. package/dist/production/src/mapper/select/SelectBuilder.js +13 -19
  517. package/dist/production/src/mapper/select/SelectBuilder.js.map +1 -1
  518. package/dist/production/src/mapper/select/SelectHydrator.cjs +92 -31
  519. package/dist/production/src/mapper/select/SelectHydrator.cjs.map +1 -1
  520. package/dist/production/src/mapper/select/SelectHydrator.js +92 -31
  521. package/dist/production/src/mapper/select/SelectHydrator.js.map +1 -1
  522. package/dist/production/src/mapper/select/WhereBuilder.cjs +261 -47
  523. package/dist/production/src/mapper/select/WhereBuilder.cjs.map +1 -1
  524. package/dist/production/src/mapper/select/WhereBuilder.js +262 -48
  525. package/dist/production/src/mapper/select/WhereBuilder.js.map +1 -1
  526. package/dist/production/src/mapper/select/getFieldReadPredicate.cjs +8 -0
  527. package/dist/production/src/mapper/select/getFieldReadPredicate.cjs.map +1 -0
  528. package/dist/production/src/mapper/select/getFieldReadPredicate.js +8 -0
  529. package/dist/production/src/mapper/select/getFieldReadPredicate.js.map +1 -0
  530. package/dist/production/src/mapper/select/handlers/FieldsVisitor.cjs +9 -13
  531. package/dist/production/src/mapper/select/handlers/FieldsVisitor.cjs.map +1 -1
  532. package/dist/production/src/mapper/select/handlers/FieldsVisitor.js +10 -14
  533. package/dist/production/src/mapper/select/handlers/FieldsVisitor.js.map +1 -1
  534. package/dist/production/src/mapper/select/handlers/MetaHandler.cjs +6 -2
  535. package/dist/production/src/mapper/select/handlers/MetaHandler.cjs.map +1 -1
  536. package/dist/production/src/mapper/select/handlers/MetaHandler.js +6 -2
  537. package/dist/production/src/mapper/select/handlers/MetaHandler.js.map +1 -1
  538. package/dist/production/src/mapper/select/optimizer/WhereOptimizer.cjs +229 -3
  539. package/dist/production/src/mapper/select/optimizer/WhereOptimizer.cjs.map +1 -1
  540. package/dist/production/src/mapper/select/optimizer/WhereOptimizer.js +230 -4
  541. package/dist/production/src/mapper/select/optimizer/WhereOptimizer.js.map +1 -1
  542. package/dist/production/src/mapper/select/optimizer/WhereReplacer.cjs +3 -3
  543. package/dist/production/src/mapper/select/optimizer/WhereReplacer.cjs.map +1 -1
  544. package/dist/production/src/mapper/select/optimizer/WhereReplacer.js +1 -1
  545. package/dist/production/src/mapper/select/optimizer/WhereReplacer.js.map +1 -1
  546. package/dist/production/src/mapper/update/SqlUpdateInputProcessor.cjs +9 -5
  547. package/dist/production/src/mapper/update/SqlUpdateInputProcessor.cjs.map +1 -1
  548. package/dist/production/src/mapper/update/SqlUpdateInputProcessor.js +10 -6
  549. package/dist/production/src/mapper/update/SqlUpdateInputProcessor.js.map +1 -1
  550. package/dist/production/src/mapper/update/UpdateBuilder.cjs +35 -2
  551. package/dist/production/src/mapper/update/UpdateBuilder.cjs.map +1 -1
  552. package/dist/production/src/mapper/update/UpdateBuilder.js +36 -3
  553. package/dist/production/src/mapper/update/UpdateBuilder.js.map +1 -1
  554. package/dist/production/src/mapper/update/UpdateBuilderFactory.cjs +3 -2
  555. package/dist/production/src/mapper/update/UpdateBuilderFactory.cjs.map +1 -1
  556. package/dist/production/src/mapper/update/UpdateBuilderFactory.js +3 -2
  557. package/dist/production/src/mapper/update/UpdateBuilderFactory.js.map +1 -1
  558. package/dist/production/src/mapper/update/Updater.cjs +12 -6
  559. package/dist/production/src/mapper/update/Updater.cjs.map +1 -1
  560. package/dist/production/src/mapper/update/Updater.js +13 -7
  561. package/dist/production/src/mapper/update/Updater.js.map +1 -1
  562. package/dist/production/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.cjs +33 -19
  563. package/dist/production/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.cjs.map +1 -1
  564. package/dist/production/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.js +33 -19
  565. package/dist/production/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.js.map +1 -1
  566. package/dist/production/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.cjs +13 -11
  567. package/dist/production/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.cjs.map +1 -1
  568. package/dist/production/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.js +13 -11
  569. package/dist/production/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.js.map +1 -1
  570. package/dist/production/src/mapper/update/relations/OneHasManyUpdateInputProcessor.cjs +17 -8
  571. package/dist/production/src/mapper/update/relations/OneHasManyUpdateInputProcessor.cjs.map +1 -1
  572. package/dist/production/src/mapper/update/relations/OneHasManyUpdateInputProcessor.js +17 -8
  573. package/dist/production/src/mapper/update/relations/OneHasManyUpdateInputProcessor.js.map +1 -1
  574. package/dist/production/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.cjs +19 -16
  575. package/dist/production/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.cjs.map +1 -1
  576. package/dist/production/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.js +19 -16
  577. package/dist/production/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.js.map +1 -1
  578. package/dist/production/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.cjs +19 -16
  579. package/dist/production/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.cjs.map +1 -1
  580. package/dist/production/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.js +19 -16
  581. package/dist/production/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.js.map +1 -1
  582. package/dist/production/src/mapper/update/relations/SetManyRelationHelper.cjs +123 -0
  583. package/dist/production/src/mapper/update/relations/SetManyRelationHelper.cjs.map +1 -0
  584. package/dist/production/src/mapper/update/relations/SetManyRelationHelper.js +123 -0
  585. package/dist/production/src/mapper/update/relations/SetManyRelationHelper.js.map +1 -0
  586. package/dist/production/src/resolvers/GraphQlQueryAstFactory.cjs.map +1 -1
  587. package/dist/production/src/resolvers/GraphQlQueryAstFactory.js.map +1 -1
  588. package/dist/production/src/resolvers/MutationResolver.cjs +76 -79
  589. package/dist/production/src/resolvers/MutationResolver.cjs.map +1 -1
  590. package/dist/production/src/resolvers/MutationResolver.js +78 -81
  591. package/dist/production/src/resolvers/MutationResolver.js.map +1 -1
  592. package/dist/production/src/resolvers/ReadHelpers.cjs +17 -6
  593. package/dist/production/src/resolvers/ReadHelpers.cjs.map +1 -1
  594. package/dist/production/src/resolvers/ReadHelpers.js +17 -6
  595. package/dist/production/src/resolvers/ReadHelpers.js.map +1 -1
  596. package/dist/production/src/resolvers/ReadResolver.cjs +27 -22
  597. package/dist/production/src/resolvers/ReadResolver.cjs.map +1 -1
  598. package/dist/production/src/resolvers/ReadResolver.js +27 -22
  599. package/dist/production/src/resolvers/ReadResolver.js.map +1 -1
  600. package/dist/production/src/schema/CustomTypesProvider.cjs +35 -14
  601. package/dist/production/src/schema/CustomTypesProvider.cjs.map +1 -1
  602. package/dist/production/src/schema/CustomTypesProvider.js +36 -15
  603. package/dist/production/src/schema/CustomTypesProvider.js.map +1 -1
  604. package/dist/production/src/schema/EntityTypeProvider.cjs +11 -7
  605. package/dist/production/src/schema/EntityTypeProvider.cjs.map +1 -1
  606. package/dist/production/src/schema/EntityTypeProvider.js +11 -7
  607. package/dist/production/src/schema/EntityTypeProvider.js.map +1 -1
  608. package/dist/production/src/schema/GraphQlSchemaBuilder.cjs +16 -6
  609. package/dist/production/src/schema/GraphQlSchemaBuilder.cjs.map +1 -1
  610. package/dist/production/src/schema/GraphQlSchemaBuilder.js +16 -6
  611. package/dist/production/src/schema/GraphQlSchemaBuilder.js.map +1 -1
  612. package/dist/production/src/schema/GraphQlSchemaBuilderFactory.cjs +39 -11
  613. package/dist/production/src/schema/GraphQlSchemaBuilderFactory.cjs.map +1 -1
  614. package/dist/production/src/schema/GraphQlSchemaBuilderFactory.js +39 -11
  615. package/dist/production/src/schema/GraphQlSchemaBuilderFactory.js.map +1 -1
  616. package/dist/production/src/schema/MutationProvider.cjs +38 -16
  617. package/dist/production/src/schema/MutationProvider.cjs.map +1 -1
  618. package/dist/production/src/schema/MutationProvider.js +38 -16
  619. package/dist/production/src/schema/MutationProvider.js.map +1 -1
  620. package/dist/production/src/schema/OrderByTypeProvider.cjs +8 -2
  621. package/dist/production/src/schema/OrderByTypeProvider.cjs.map +1 -1
  622. package/dist/production/src/schema/OrderByTypeProvider.js +9 -3
  623. package/dist/production/src/schema/OrderByTypeProvider.js.map +1 -1
  624. package/dist/production/src/schema/QueryProvider.cjs +12 -11
  625. package/dist/production/src/schema/QueryProvider.cjs.map +1 -1
  626. package/dist/production/src/schema/QueryProvider.js +12 -11
  627. package/dist/production/src/schema/QueryProvider.js.map +1 -1
  628. package/dist/production/src/schema/ValidationQueriesProvider.cjs +2 -0
  629. package/dist/production/src/schema/ValidationQueriesProvider.cjs.map +1 -1
  630. package/dist/production/src/schema/ValidationQueriesProvider.js +2 -0
  631. package/dist/production/src/schema/ValidationQueriesProvider.js.map +1 -1
  632. package/dist/production/src/schema/WhereTypeProvider.cjs +17 -5
  633. package/dist/production/src/schema/WhereTypeProvider.cjs.map +1 -1
  634. package/dist/production/src/schema/WhereTypeProvider.js +18 -6
  635. package/dist/production/src/schema/WhereTypeProvider.js.map +1 -1
  636. package/dist/production/src/schema/calendarDate.cjs +21 -0
  637. package/dist/production/src/schema/calendarDate.cjs.map +1 -0
  638. package/dist/production/src/schema/calendarDate.js +21 -0
  639. package/dist/production/src/schema/calendarDate.js.map +1 -0
  640. package/dist/production/src/schema/entities/FieldTypeVisitor.cjs +15 -2
  641. package/dist/production/src/schema/entities/FieldTypeVisitor.cjs.map +1 -1
  642. package/dist/production/src/schema/entities/FieldTypeVisitor.js +15 -2
  643. package/dist/production/src/schema/entities/FieldTypeVisitor.js.map +1 -1
  644. package/dist/production/src/schema/mutations/CreateEntityInputFieldVisitor.cjs +11 -3
  645. package/dist/production/src/schema/mutations/CreateEntityInputFieldVisitor.cjs.map +1 -1
  646. package/dist/production/src/schema/mutations/CreateEntityInputFieldVisitor.js +11 -3
  647. package/dist/production/src/schema/mutations/CreateEntityInputFieldVisitor.js.map +1 -1
  648. package/dist/production/src/schema/mutations/UpdateEntityInputFieldVisitor.cjs +11 -3
  649. package/dist/production/src/schema/mutations/UpdateEntityInputFieldVisitor.cjs.map +1 -1
  650. package/dist/production/src/schema/mutations/UpdateEntityInputFieldVisitor.js +11 -3
  651. package/dist/production/src/schema/mutations/UpdateEntityInputFieldVisitor.js.map +1 -1
  652. package/dist/production/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.cjs +39 -2
  653. package/dist/production/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.cjs.map +1 -1
  654. package/dist/production/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.js +40 -3
  655. package/dist/production/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.js.map +1 -1
  656. package/dist/production/src/schema/utils.cjs +10 -0
  657. package/dist/production/src/schema/utils.cjs.map +1 -1
  658. package/dist/production/src/schema/utils.js +11 -1
  659. package/dist/production/src/schema/utils.js.map +1 -1
  660. package/dist/production/src/schema-json/GraphQLJsBridge.cjs +108 -0
  661. package/dist/production/src/schema-json/GraphQLJsBridge.cjs.map +1 -0
  662. package/dist/production/src/schema-json/GraphQLJsBridge.js +108 -0
  663. package/dist/production/src/schema-json/GraphQLJsBridge.js.map +1 -0
  664. package/dist/production/src/schema-json/JsonColumnTypes.cjs +102 -0
  665. package/dist/production/src/schema-json/JsonColumnTypes.cjs.map +1 -0
  666. package/dist/production/src/schema-json/JsonColumnTypes.js +102 -0
  667. package/dist/production/src/schema-json/JsonColumnTypes.js.map +1 -0
  668. package/dist/production/src/schema-json/JsonContentSchemaBuilder.cjs +418 -0
  669. package/dist/production/src/schema-json/JsonContentSchemaBuilder.cjs.map +1 -0
  670. package/dist/production/src/schema-json/JsonContentSchemaBuilder.js +418 -0
  671. package/dist/production/src/schema-json/JsonContentSchemaBuilder.js.map +1 -0
  672. package/dist/production/src/schema-json/JsonContentSchemaShared.cjs +18 -0
  673. package/dist/production/src/schema-json/JsonContentSchemaShared.cjs.map +1 -0
  674. package/dist/production/src/schema-json/JsonContentSchemaShared.js +18 -0
  675. package/dist/production/src/schema-json/JsonContentSchemaShared.js.map +1 -0
  676. package/dist/production/src/schema-json/JsonEntityTypes.cjs +206 -0
  677. package/dist/production/src/schema-json/JsonEntityTypes.cjs.map +1 -0
  678. package/dist/production/src/schema-json/JsonEntityTypes.js +206 -0
  679. package/dist/production/src/schema-json/JsonEntityTypes.js.map +1 -0
  680. package/dist/production/src/schema-json/JsonFilterTypes.cjs +152 -0
  681. package/dist/production/src/schema-json/JsonFilterTypes.cjs.map +1 -0
  682. package/dist/production/src/schema-json/JsonFilterTypes.js +152 -0
  683. package/dist/production/src/schema-json/JsonFilterTypes.js.map +1 -0
  684. package/dist/production/src/schema-json/JsonInputTypes.cjs +256 -0
  685. package/dist/production/src/schema-json/JsonInputTypes.cjs.map +1 -0
  686. package/dist/production/src/schema-json/JsonInputTypes.js +256 -0
  687. package/dist/production/src/schema-json/JsonInputTypes.js.map +1 -0
  688. package/dist/production/src/schema-json/JsonIntrospectionExtension.cjs +36 -0
  689. package/dist/production/src/schema-json/JsonIntrospectionExtension.cjs.map +1 -0
  690. package/dist/production/src/schema-json/JsonIntrospectionExtension.js +36 -0
  691. package/dist/production/src/schema-json/JsonIntrospectionExtension.js.map +1 -0
  692. package/dist/production/src/schema-json/JsonQueryAstFactory.cjs +107 -0
  693. package/dist/production/src/schema-json/JsonQueryAstFactory.cjs.map +1 -0
  694. package/dist/production/src/schema-json/JsonQueryAstFactory.js +107 -0
  695. package/dist/production/src/schema-json/JsonQueryAstFactory.js.map +1 -0
  696. package/dist/production/src/schema-json/JsonTypeRegistry.cjs +230 -0
  697. package/dist/production/src/schema-json/JsonTypeRegistry.cjs.map +1 -0
  698. package/dist/production/src/schema-json/JsonTypeRegistry.js +230 -0
  699. package/dist/production/src/schema-json/JsonTypeRegistry.js.map +1 -0
  700. package/dist/production/src/utils/ResolveInfoUtils.cjs.map +1 -1
  701. package/dist/production/src/utils/ResolveInfoUtils.js.map +1 -1
  702. package/dist/production/src/utils/uniqueWhereFields.cjs +10 -0
  703. package/dist/production/src/utils/uniqueWhereFields.cjs.map +1 -1
  704. package/dist/production/src/utils/uniqueWhereFields.js +10 -0
  705. package/dist/production/src/utils/uniqueWhereFields.js.map +1 -1
  706. package/dist/tests/cases/integration/graphQlRequests/delete/acl/throughScope.test.d.ts +2 -0
  707. package/dist/tests/cases/integration/graphQlRequests/delete/acl/throughScope.test.d.ts.map +1 -0
  708. package/dist/tests/cases/integration/graphQlRequests/insert/acl/throughScope.test.d.ts +2 -0
  709. package/dist/tests/cases/integration/graphQlRequests/insert/acl/throughScope.test.d.ts.map +1 -0
  710. package/dist/tests/cases/integration/graphQlRequests/insert/memoryBudget.test.d.ts +2 -0
  711. package/dist/tests/cases/integration/graphQlRequests/insert/memoryBudget.test.d.ts.map +1 -0
  712. package/dist/tests/cases/integration/graphQlRequests/query/acl/hasManyCellPredicate.test.d.ts +2 -0
  713. package/dist/tests/cases/integration/graphQlRequests/query/acl/hasManyCellPredicate.test.d.ts.map +1 -0
  714. package/dist/tests/cases/integration/graphQlRequests/query/acl/impliedReadGuard.test.d.ts +2 -0
  715. package/dist/tests/cases/integration/graphQlRequests/query/acl/impliedReadGuard.test.d.ts.map +1 -0
  716. package/dist/tests/cases/integration/graphQlRequests/query/acl/internalColumnAliases.test.d.ts +2 -0
  717. package/dist/tests/cases/integration/graphQlRequests/query/acl/internalColumnAliases.test.d.ts.map +1 -0
  718. package/dist/tests/cases/integration/graphQlRequests/query/acl/manyHasManyGuardedJoin.test.d.ts +2 -0
  719. package/dist/tests/cases/integration/graphQlRequests/query/acl/manyHasManyGuardedJoin.test.d.ts.map +1 -0
  720. package/dist/tests/cases/integration/graphQlRequests/query/acl/maskedRelationField.test.d.ts +2 -0
  721. package/dist/tests/cases/integration/graphQlRequests/query/acl/maskedRelationField.test.d.ts.map +1 -0
  722. package/dist/tests/cases/integration/graphQlRequests/query/acl/mergedRolePredicate.test.d.ts +2 -0
  723. package/dist/tests/cases/integration/graphQlRequests/query/acl/mergedRolePredicate.test.d.ts.map +1 -0
  724. package/dist/tests/cases/integration/graphQlRequests/query/acl/metaReadableThroughContext.test.d.ts +2 -0
  725. package/dist/tests/cases/integration/graphQlRequests/query/acl/metaReadableThroughContext.test.d.ts.map +1 -0
  726. package/dist/tests/cases/integration/graphQlRequests/query/acl/negationAcrossSubquery.test.d.ts +2 -0
  727. package/dist/tests/cases/integration/graphQlRequests/query/acl/negationAcrossSubquery.test.d.ts.map +1 -0
  728. package/dist/tests/cases/integration/graphQlRequests/query/acl/nonAdjacentBackReference.test.d.ts +2 -0
  729. package/dist/tests/cases/integration/graphQlRequests/query/acl/nonAdjacentBackReference.test.d.ts.map +1 -0
  730. package/dist/tests/cases/integration/graphQlRequests/query/acl/notOverGuardedHop.test.d.ts +2 -0
  731. package/dist/tests/cases/integration/graphQlRequests/query/acl/notOverGuardedHop.test.d.ts.map +1 -0
  732. package/dist/tests/cases/integration/graphQlRequests/query/acl/notOverOrCellPredicate.test.d.ts +2 -0
  733. package/dist/tests/cases/integration/graphQlRequests/query/acl/notOverOrCellPredicate.test.d.ts.map +1 -0
  734. package/dist/tests/cases/integration/graphQlRequests/query/acl/orderByCellPredicate.test.d.ts +2 -0
  735. package/dist/tests/cases/integration/graphQlRequests/query/acl/orderByCellPredicate.test.d.ts.map +1 -0
  736. package/dist/tests/cases/integration/graphQlRequests/query/acl/throughScope.test.d.ts +2 -0
  737. package/dist/tests/cases/integration/graphQlRequests/query/acl/throughScope.test.d.ts.map +1 -0
  738. package/dist/tests/cases/integration/graphQlRequests/query/acl/throughScopeFilter.test.d.ts +2 -0
  739. package/dist/tests/cases/integration/graphQlRequests/query/acl/throughScopeFilter.test.d.ts.map +1 -0
  740. package/dist/tests/cases/integration/graphQlRequests/query/acl/throughScopeNullability.test.d.ts +2 -0
  741. package/dist/tests/cases/integration/graphQlRequests/query/acl/throughScopeNullability.test.d.ts.map +1 -0
  742. package/dist/tests/cases/integration/graphQlRequests/query/filter/hasOneDataViewFilter.test.d.ts +2 -0
  743. package/dist/tests/cases/integration/graphQlRequests/query/filter/hasOneDataViewFilter.test.d.ts.map +1 -0
  744. package/dist/tests/cases/integration/graphQlRequests/update/acl/legacyNoRootRootWrites.test.d.ts +2 -0
  745. package/dist/tests/cases/integration/graphQlRequests/update/acl/legacyNoRootRootWrites.test.d.ts.map +1 -0
  746. package/dist/tests/cases/integration/graphQlRequests/update/acl/throughScope.test.d.ts +2 -0
  747. package/dist/tests/cases/integration/graphQlRequests/update/acl/throughScope.test.d.ts.map +1 -0
  748. package/dist/tests/cases/integration/graphQlRequests/update/acl/throughScopeJunction.test.d.ts +2 -0
  749. package/dist/tests/cases/integration/graphQlRequests/update/acl/throughScopeJunction.test.d.ts.map +1 -0
  750. package/dist/tests/cases/integration/graphQlRequests/update/acl/throughScopeLookup.test.d.ts +2 -0
  751. package/dist/tests/cases/integration/graphQlRequests/update/acl/throughScopeLookup.test.d.ts.map +1 -0
  752. package/dist/tests/cases/integration/graphQlRequests/update/acl/throughScopeRootWrites.test.d.ts +2 -0
  753. package/dist/tests/cases/integration/graphQlRequests/update/acl/throughScopeRootWrites.test.d.ts.map +1 -0
  754. package/dist/tests/cases/integration/graphQlRequests/update/acl/throughScopeUpdate.test.d.ts +2 -0
  755. package/dist/tests/cases/integration/graphQlRequests/update/acl/throughScopeUpdate.test.d.ts.map +1 -0
  756. package/dist/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/set.test.d.ts +2 -0
  757. package/dist/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/set.test.d.ts.map +1 -0
  758. package/dist/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/set.test.d.ts +2 -0
  759. package/dist/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/set.test.d.ts.map +1 -0
  760. package/dist/tests/cases/integration/graphQlRequests/update/oneHasMany/set.test.d.ts +2 -0
  761. package/dist/tests/cases/integration/graphQlRequests/update/oneHasMany/set.test.d.ts.map +1 -0
  762. package/dist/tests/cases/integration/graphQlRequests/upsert/acl/throughScope.test.d.ts +2 -0
  763. package/dist/tests/cases/integration/graphQlRequests/upsert/acl/throughScope.test.d.ts.map +1 -0
  764. package/dist/tests/cases/integration/graphQlRequests/validation/utils.d.ts.map +1 -1
  765. package/dist/tests/cases/integration/graphQlSchema/model.d.ts +1 -1
  766. package/dist/tests/cases/unit/checkViolationError.test.d.ts +2 -0
  767. package/dist/tests/cases/unit/checkViolationError.test.d.ts.map +1 -0
  768. package/dist/tests/cases/unit/dateType.test.d.ts +2 -0
  769. package/dist/tests/cases/unit/dateType.test.d.ts.map +1 -0
  770. package/dist/tests/cases/unit/internalColumnAliases.test.d.ts +2 -0
  771. package/dist/tests/cases/unit/internalColumnAliases.test.d.ts.map +1 -0
  772. package/dist/tests/cases/unit/introspectionAcl.test.d.ts +2 -0
  773. package/dist/tests/cases/unit/introspectionAcl.test.d.ts.map +1 -0
  774. package/dist/tests/cases/unit/mutationSqlError.test.d.ts +2 -0
  775. package/dist/tests/cases/unit/mutationSqlError.test.d.ts.map +1 -0
  776. package/dist/tests/cases/unit/pathAlias.test.d.ts +2 -0
  777. package/dist/tests/cases/unit/pathAlias.test.d.ts.map +1 -0
  778. package/dist/tests/src/assert.d.ts.map +1 -1
  779. package/dist/tests/src/tags.d.ts.map +1 -1
  780. package/dist/tests/src/test.d.ts +12 -0
  781. package/dist/tests/src/test.d.ts.map +1 -1
  782. package/dist/tests/src/testGraphql.d.ts +18 -5
  783. package/dist/tests/src/testGraphql.d.ts.map +1 -1
  784. package/dist/tests/src/testUuid.d.ts.map +1 -1
  785. package/dist/tests/tsconfig.tsbuildinfo +1 -1
  786. package/dist/types/ExecutionContainer.d.ts +4 -2
  787. package/dist/types/ExecutionContainer.d.ts.map +1 -1
  788. package/dist/types/acl/AclScope.d.ts +26 -0
  789. package/dist/types/acl/AclScope.d.ts.map +1 -0
  790. package/dist/types/acl/Authorizator.d.ts +0 -1
  791. package/dist/types/acl/Authorizator.d.ts.map +1 -1
  792. package/dist/types/acl/EvaluatedPredicateReplacer.d.ts +1 -0
  793. package/dist/types/acl/EvaluatedPredicateReplacer.d.ts.map +1 -1
  794. package/dist/types/acl/PermissionFactory.d.ts +19 -4
  795. package/dist/types/acl/PermissionFactory.d.ts.map +1 -1
  796. package/dist/types/acl/PredicateFactory.d.ts +31 -15
  797. package/dist/types/acl/PredicateFactory.d.ts.map +1 -1
  798. package/dist/types/acl/PredicatesInjector.d.ts +66 -12
  799. package/dist/types/acl/PredicatesInjector.d.ts.map +1 -1
  800. package/dist/types/acl/VariableInjector.d.ts.map +1 -1
  801. package/dist/types/acl/VariableUtils.d.ts.map +1 -1
  802. package/dist/types/acl/index.d.ts +1 -0
  803. package/dist/types/acl/index.d.ts.map +1 -1
  804. package/dist/types/exception.d.ts.map +1 -1
  805. package/dist/types/extensions/hasManyToHasOneReducer/HasManyToHasOneReducer.d.ts.map +1 -1
  806. package/dist/types/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.d.ts +3 -1
  807. package/dist/types/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.d.ts.map +1 -1
  808. package/dist/types/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.d.ts.map +1 -1
  809. package/dist/types/extensions/paginatedHasMany/PaginatedHasManyCountVisitor.d.ts.map +1 -1
  810. package/dist/types/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.d.ts +3 -1
  811. package/dist/types/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.d.ts.map +1 -1
  812. package/dist/types/extensions/paginatedHasMany/PaginatedHasManyFieldProvider.d.ts.map +1 -1
  813. package/dist/types/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.d.ts.map +1 -1
  814. package/dist/types/extensions/paginatedHasMany/PaginatedHasManyNodesVisitor.d.ts.map +1 -1
  815. package/dist/types/index.d.ts +1 -0
  816. package/dist/types/index.d.ts.map +1 -1
  817. package/dist/types/input-validation/ColumnValueResolver.d.ts.map +1 -1
  818. package/dist/types/input-validation/EntityRulesResolver.d.ts.map +1 -1
  819. package/dist/types/input-validation/JsonSchemaValidator.d.ts.map +1 -1
  820. package/dist/types/input-validation/QueryAstFactory.d.ts.map +1 -1
  821. package/dist/types/input-validation/ValidationContext.d.ts.map +1 -1
  822. package/dist/types/input-validation/ValidationDataSelector.d.ts +2 -1
  823. package/dist/types/input-validation/ValidationDataSelector.d.ts.map +1 -1
  824. package/dist/types/input-validation/ValidationEvaluation.d.ts.map +1 -1
  825. package/dist/types/input-validation/ValidationPath.d.ts.map +1 -1
  826. package/dist/types/input-validation/dependencies/DependencyCollector.d.ts.map +1 -1
  827. package/dist/types/input-validation/dependencies/DependencyMerger.d.ts.map +1 -1
  828. package/dist/types/input-validation/preValidation/CreateInputPreValidationProcessor.d.ts.map +1 -1
  829. package/dist/types/input-validation/preValidation/InputPreValidator.d.ts.map +1 -1
  830. package/dist/types/input-validation/preValidation/UpdateInputPreValidationProcessor.d.ts +6 -0
  831. package/dist/types/input-validation/preValidation/UpdateInputPreValidationProcessor.d.ts.map +1 -1
  832. package/dist/types/inputProcessing/CreateInputVisitor.d.ts.map +1 -1
  833. package/dist/types/inputProcessing/FieldNode.d.ts.map +1 -1
  834. package/dist/types/inputProcessing/ObjectNode.d.ts.map +1 -1
  835. package/dist/types/inputProcessing/UniqueWhereExpander.d.ts.map +1 -1
  836. package/dist/types/inputProcessing/UpdateInputProcessor.d.ts +7 -0
  837. package/dist/types/inputProcessing/UpdateInputProcessor.d.ts.map +1 -1
  838. package/dist/types/inputProcessing/UpdateInputVisitor.d.ts +2 -0
  839. package/dist/types/inputProcessing/UpdateInputVisitor.d.ts.map +1 -1
  840. package/dist/types/introspection/IntrospectionSchemaDefinitionFactory.d.ts.map +1 -1
  841. package/dist/types/introspection/IntrospectionSchemaFactory.d.ts.map +1 -1
  842. package/dist/types/introspection/introspection.schema.d.ts.map +1 -1
  843. package/dist/types/mapper/CheckedPrimary.d.ts.map +1 -1
  844. package/dist/types/mapper/ColumnValue.d.ts.map +1 -1
  845. package/dist/types/mapper/Constraints.d.ts.map +1 -1
  846. package/dist/types/mapper/ErrorUtils.d.ts.map +1 -1
  847. package/dist/types/mapper/EventManager.d.ts +9 -9
  848. package/dist/types/mapper/EventManager.d.ts.map +1 -1
  849. package/dist/types/mapper/JunctionTableManager.d.ts +17 -5
  850. package/dist/types/mapper/JunctionTableManager.d.ts.map +1 -1
  851. package/dist/types/mapper/Mapper.d.ts +26 -13
  852. package/dist/types/mapper/Mapper.d.ts.map +1 -1
  853. package/dist/types/mapper/MapperFactory.d.ts +3 -2
  854. package/dist/types/mapper/MapperFactory.d.ts.map +1 -1
  855. package/dist/types/mapper/MutationProcessorHelper.d.ts +3 -0
  856. package/dist/types/mapper/MutationProcessorHelper.d.ts.map +1 -1
  857. package/dist/types/mapper/Result.d.ts +2 -1
  858. package/dist/types/mapper/Result.d.ts.map +1 -1
  859. package/dist/types/mapper/delete/DeleteExecutor.d.ts +6 -2
  860. package/dist/types/mapper/delete/DeleteExecutor.d.ts.map +1 -1
  861. package/dist/types/mapper/delete/DeleteState.d.ts.map +1 -1
  862. package/dist/types/mapper/delete/DeletedEntitiesStorage.d.ts.map +1 -1
  863. package/dist/types/mapper/delete/helpers.d.ts +1 -1
  864. package/dist/types/mapper/delete/helpers.d.ts.map +1 -1
  865. package/dist/types/mapper/insert/InsertBuilder.d.ts +3 -2
  866. package/dist/types/mapper/insert/InsertBuilder.d.ts.map +1 -1
  867. package/dist/types/mapper/insert/InsertBuilderFactory.d.ts +2 -2
  868. package/dist/types/mapper/insert/InsertBuilderFactory.d.ts.map +1 -1
  869. package/dist/types/mapper/insert/Inserter.d.ts +2 -1
  870. package/dist/types/mapper/insert/Inserter.d.ts.map +1 -1
  871. package/dist/types/mapper/insert/SqlCreateInputProcessor.d.ts +6 -1
  872. package/dist/types/mapper/insert/SqlCreateInputProcessor.d.ts.map +1 -1
  873. package/dist/types/mapper/insert/relations/ManyHasManyCreateInputProcessor.d.ts +7 -2
  874. package/dist/types/mapper/insert/relations/ManyHasManyCreateInputProcessor.d.ts.map +1 -1
  875. package/dist/types/mapper/insert/relations/ManyHasOneCreateInputProcessor.d.ts.map +1 -1
  876. package/dist/types/mapper/insert/relations/OneHasManyCreateInputProcessor.d.ts.map +1 -1
  877. package/dist/types/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.d.ts +1 -1
  878. package/dist/types/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.d.ts.map +1 -1
  879. package/dist/types/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.d.ts.map +1 -1
  880. package/dist/types/mapper/select/ConditionBuilder.d.ts.map +1 -1
  881. package/dist/types/mapper/select/JoinBuilder.d.ts +8 -2
  882. package/dist/types/mapper/select/JoinBuilder.d.ts.map +1 -1
  883. package/dist/types/mapper/select/JoinVisitor.d.ts.map +1 -1
  884. package/dist/types/mapper/select/OrderByBuilder.d.ts +18 -2
  885. package/dist/types/mapper/select/OrderByBuilder.d.ts.map +1 -1
  886. package/dist/types/mapper/select/OrderByHelper.d.ts +2 -0
  887. package/dist/types/mapper/select/OrderByHelper.d.ts.map +1 -1
  888. package/dist/types/mapper/select/Path.d.ts +12 -0
  889. package/dist/types/mapper/select/Path.d.ts.map +1 -1
  890. package/dist/types/mapper/select/RelationFetcher.d.ts.map +1 -1
  891. package/dist/types/mapper/select/SelectBuilder.d.ts.map +1 -1
  892. package/dist/types/mapper/select/SelectExecutionHandler.d.ts +5 -0
  893. package/dist/types/mapper/select/SelectExecutionHandler.d.ts.map +1 -1
  894. package/dist/types/mapper/select/SelectHydrator.d.ts +10 -1
  895. package/dist/types/mapper/select/SelectHydrator.d.ts.map +1 -1
  896. package/dist/types/mapper/select/WhereBuilder.d.ts +33 -1
  897. package/dist/types/mapper/select/WhereBuilder.d.ts.map +1 -1
  898. package/dist/types/mapper/select/getFieldReadPredicate.d.ts +4 -0
  899. package/dist/types/mapper/select/getFieldReadPredicate.d.ts.map +1 -0
  900. package/dist/types/mapper/select/handlers/FieldsVisitor.d.ts +0 -1
  901. package/dist/types/mapper/select/handlers/FieldsVisitor.d.ts.map +1 -1
  902. package/dist/types/mapper/select/handlers/FieldsVisitorFactory.d.ts.map +1 -1
  903. package/dist/types/mapper/select/handlers/MetaHandler.d.ts.map +1 -1
  904. package/dist/types/mapper/select/index.d.ts +1 -0
  905. package/dist/types/mapper/select/index.d.ts.map +1 -1
  906. package/dist/types/mapper/select/optimizer/ConditionOptimizer.d.ts.map +1 -1
  907. package/dist/types/mapper/select/optimizer/WhereOptimizer.d.ts +36 -0
  908. package/dist/types/mapper/select/optimizer/WhereOptimizer.d.ts.map +1 -1
  909. package/dist/types/mapper/select/optimizer/WhereReplacer.d.ts.map +1 -1
  910. package/dist/types/mapper/select/optimizer/helpers.d.ts +1 -1
  911. package/dist/types/mapper/select/optimizer/helpers.d.ts.map +1 -1
  912. package/dist/types/mapper/types.d.ts +8 -1
  913. package/dist/types/mapper/types.d.ts.map +1 -1
  914. package/dist/types/mapper/update/SqlUpdateInputProcessor.d.ts +6 -1
  915. package/dist/types/mapper/update/SqlUpdateInputProcessor.d.ts.map +1 -1
  916. package/dist/types/mapper/update/UpdateBuilder.d.ts +18 -2
  917. package/dist/types/mapper/update/UpdateBuilder.d.ts.map +1 -1
  918. package/dist/types/mapper/update/UpdateBuilderFactory.d.ts +2 -2
  919. package/dist/types/mapper/update/UpdateBuilderFactory.d.ts.map +1 -1
  920. package/dist/types/mapper/update/Updater.d.ts +3 -2
  921. package/dist/types/mapper/update/Updater.d.ts.map +1 -1
  922. package/dist/types/mapper/update/relations/ManyHasManyUpdateInputProcessor.d.ts +15 -3
  923. package/dist/types/mapper/update/relations/ManyHasManyUpdateInputProcessor.d.ts.map +1 -1
  924. package/dist/types/mapper/update/relations/ManyHasOneUpdateInputProcessor.d.ts.map +1 -1
  925. package/dist/types/mapper/update/relations/OneHasManyUpdateInputProcessor.d.ts +5 -0
  926. package/dist/types/mapper/update/relations/OneHasManyUpdateInputProcessor.d.ts.map +1 -1
  927. package/dist/types/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.d.ts.map +1 -1
  928. package/dist/types/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.d.ts.map +1 -1
  929. package/dist/types/mapper/update/relations/SetManyRelationHelper.d.ts +67 -0
  930. package/dist/types/mapper/update/relations/SetManyRelationHelper.d.ts.map +1 -0
  931. package/dist/types/resolvers/GraphQlQueryAstFactory.d.ts +4 -3
  932. package/dist/types/resolvers/GraphQlQueryAstFactory.d.ts.map +1 -1
  933. package/dist/types/resolvers/MutationResolver.d.ts +14 -11
  934. package/dist/types/resolvers/MutationResolver.d.ts.map +1 -1
  935. package/dist/types/resolvers/ReadHelpers.d.ts +1 -2
  936. package/dist/types/resolvers/ReadHelpers.d.ts.map +1 -1
  937. package/dist/types/resolvers/ReadResolver.d.ts +8 -10
  938. package/dist/types/resolvers/ReadResolver.d.ts.map +1 -1
  939. package/dist/types/resolvers/RefreshViewResolver.d.ts.map +1 -1
  940. package/dist/types/resolvers/ValidationResolver.d.ts.map +1 -1
  941. package/dist/types/schema/ColumnTypeResolver.d.ts.map +1 -1
  942. package/dist/types/schema/ConditionTypeProvider.d.ts.map +1 -1
  943. package/dist/types/schema/CustomTypesProvider.d.ts.map +1 -1
  944. package/dist/types/schema/EntityTypeProvider.d.ts +2 -1
  945. package/dist/types/schema/EntityTypeProvider.d.ts.map +1 -1
  946. package/dist/types/schema/EnumsProvider.d.ts.map +1 -1
  947. package/dist/types/schema/FieldAccessVisitor.d.ts.map +1 -1
  948. package/dist/types/schema/GraphQlSchemaBuilder.d.ts.map +1 -1
  949. package/dist/types/schema/GraphQlSchemaBuilderFactory.d.ts +10 -2
  950. package/dist/types/schema/GraphQlSchemaBuilderFactory.d.ts.map +1 -1
  951. package/dist/types/schema/MutationProvider.d.ts +7 -1
  952. package/dist/types/schema/MutationProvider.d.ts.map +1 -1
  953. package/dist/types/schema/OperationExtension.d.ts.map +1 -1
  954. package/dist/types/schema/OrderByTypeProvider.d.ts.map +1 -1
  955. package/dist/types/schema/PaginatedFieldConfigFactory.d.ts.map +1 -1
  956. package/dist/types/schema/QueryProvider.d.ts +2 -1
  957. package/dist/types/schema/QueryProvider.d.ts.map +1 -1
  958. package/dist/types/schema/RefreshViewMutationProvider.d.ts.map +1 -1
  959. package/dist/types/schema/ValidationQueriesProvider.d.ts.map +1 -1
  960. package/dist/types/schema/WhereTypeProvider.d.ts.map +1 -1
  961. package/dist/types/schema/calendarDate.d.ts +6 -0
  962. package/dist/types/schema/calendarDate.d.ts.map +1 -0
  963. package/dist/types/schema/entities/FieldArgsVisitor.d.ts.map +1 -1
  964. package/dist/types/schema/entities/FieldTypeVisitor.d.ts +4 -1
  965. package/dist/types/schema/entities/FieldTypeVisitor.d.ts.map +1 -1
  966. package/dist/types/schema/index.d.ts +1 -0
  967. package/dist/types/schema/index.d.ts.map +1 -1
  968. package/dist/types/schema/mutations/ConnectOrCreateRelationInputProvider.d.ts.map +1 -1
  969. package/dist/types/schema/mutations/CreateEntityInputFieldVisitor.d.ts.map +1 -1
  970. package/dist/types/schema/mutations/CreateEntityRelationAllowedOperationsVisitor.d.ts.map +1 -1
  971. package/dist/types/schema/mutations/CreateEntityRelationInputFieldVisitor.d.ts.map +1 -1
  972. package/dist/types/schema/mutations/CreateEntityRelationInputProvider.d.ts.map +1 -1
  973. package/dist/types/schema/mutations/EntityInputProvider.d.ts.map +1 -1
  974. package/dist/types/schema/mutations/UpdateEntityInputFieldVisitor.d.ts +3 -0
  975. package/dist/types/schema/mutations/UpdateEntityInputFieldVisitor.d.ts.map +1 -1
  976. package/dist/types/schema/mutations/UpdateEntityRelationAllowedOperationsVisitor.d.ts.map +1 -1
  977. package/dist/types/schema/mutations/UpdateEntityRelationInputFieldVisitor.d.ts +1 -0
  978. package/dist/types/schema/mutations/UpdateEntityRelationInputFieldVisitor.d.ts.map +1 -1
  979. package/dist/types/schema/mutations/UpdateEntityRelationInputProvider.d.ts.map +1 -1
  980. package/dist/types/schema/utils.d.ts +7 -0
  981. package/dist/types/schema/utils.d.ts.map +1 -1
  982. package/dist/types/schema-json/GraphQLJsBridge.d.ts +12 -0
  983. package/dist/types/schema-json/GraphQLJsBridge.d.ts.map +1 -0
  984. package/dist/types/schema-json/JsonColumnTypes.d.ts +23 -0
  985. package/dist/types/schema-json/JsonColumnTypes.d.ts.map +1 -0
  986. package/dist/types/schema-json/JsonContentSchemaBuilder.d.ts +56 -0
  987. package/dist/types/schema-json/JsonContentSchemaBuilder.d.ts.map +1 -0
  988. package/dist/types/schema-json/JsonContentSchemaShared.d.ts +19 -0
  989. package/dist/types/schema-json/JsonContentSchemaShared.d.ts.map +1 -0
  990. package/dist/types/schema-json/JsonEntityTypes.d.ts +29 -0
  991. package/dist/types/schema-json/JsonEntityTypes.d.ts.map +1 -0
  992. package/dist/types/schema-json/JsonFilterTypes.d.ts +21 -0
  993. package/dist/types/schema-json/JsonFilterTypes.d.ts.map +1 -0
  994. package/dist/types/schema-json/JsonInputTypes.d.ts +36 -0
  995. package/dist/types/schema-json/JsonInputTypes.d.ts.map +1 -0
  996. package/dist/types/schema-json/JsonIntrospectionExtension.d.ts +5 -0
  997. package/dist/types/schema-json/JsonIntrospectionExtension.d.ts.map +1 -0
  998. package/dist/types/schema-json/JsonQueryAstFactory.d.ts +18 -0
  999. package/dist/types/schema-json/JsonQueryAstFactory.d.ts.map +1 -0
  1000. package/dist/types/schema-json/JsonTypeRegistry.d.ts +57 -0
  1001. package/dist/types/schema-json/JsonTypeRegistry.d.ts.map +1 -0
  1002. package/dist/types/schema-json/index.d.ts +7 -0
  1003. package/dist/types/schema-json/index.d.ts.map +1 -0
  1004. package/dist/types/tsconfig.tsbuildinfo +1 -1
  1005. package/dist/types/utils/Mutex.d.ts.map +1 -1
  1006. package/dist/types/utils/ResolveInfoUtils.d.ts +4 -2
  1007. package/dist/types/utils/ResolveInfoUtils.d.ts.map +1 -1
  1008. package/dist/types/utils/accessor.d.ts.map +1 -1
  1009. package/dist/types/utils/isIt.d.ts.map +1 -1
  1010. package/dist/types/utils/paginationUtils.d.ts.map +1 -1
  1011. package/dist/types/utils/promises.d.ts.map +1 -1
  1012. package/dist/types/utils/singletonFactory.d.ts.map +1 -1
  1013. package/dist/types/utils/strings.d.ts.map +1 -1
  1014. package/dist/types/utils/tuple.d.ts.map +1 -1
  1015. package/dist/types/utils/uniqueWhereFields.d.ts.map +1 -1
  1016. package/dist/types/utils/viewComputedId.d.ts.map +1 -1
  1017. package/package.json +11 -10
  1018. package/src/ExecutionContainer.ts +20 -8
  1019. package/src/acl/AclScope.ts +29 -0
  1020. package/src/acl/Authorizator.ts +7 -5
  1021. package/src/acl/EvaluatedPredicateReplacer.ts +6 -2
  1022. package/src/acl/PermissionFactory.ts +68 -104
  1023. package/src/acl/PredicateFactory.ts +131 -28
  1024. package/src/acl/PredicatesInjector.ts +135 -156
  1025. package/src/acl/VariableInjector.ts +8 -3
  1026. package/src/acl/index.ts +1 -0
  1027. package/src/extensions/hasManyToHasOneReducer/HasManyToHasOneReducerExecutionHandler.ts +14 -3
  1028. package/src/extensions/hasManyToHasOneReducer/HasManyToHasOneRelationReducerVisitor.ts +3 -0
  1029. package/src/extensions/paginatedHasMany/PaginatedHasManyExecutionHandler.ts +10 -2
  1030. package/src/extensions/paginatedHasMany/PaginatedHasManyFieldProviderVisitor.ts +9 -7
  1031. package/src/index.ts +1 -0
  1032. package/src/input-validation/ValidationDataSelector.ts +3 -2
  1033. package/src/input-validation/preValidation/UpdateInputPreValidationProcessor.ts +29 -0
  1034. package/src/inputProcessing/UpdateInputProcessor.ts +6 -0
  1035. package/src/inputProcessing/UpdateInputVisitor.ts +64 -2
  1036. package/src/introspection/IntrospectionSchemaFactory.ts +13 -6
  1037. package/src/mapper/ErrorUtils.ts +22 -1
  1038. package/src/mapper/JunctionTableManager.ts +28 -6
  1039. package/src/mapper/Mapper.ts +137 -29
  1040. package/src/mapper/MapperFactory.ts +7 -3
  1041. package/src/mapper/MutationProcessorHelper.ts +14 -0
  1042. package/src/mapper/Result.ts +1 -0
  1043. package/src/mapper/delete/DeleteExecutor.ts +13 -7
  1044. package/src/mapper/insert/InsertBuilder.ts +3 -2
  1045. package/src/mapper/insert/InsertBuilderFactory.ts +3 -3
  1046. package/src/mapper/insert/Inserter.ts +4 -2
  1047. package/src/mapper/insert/SqlCreateInputProcessor.ts +4 -1
  1048. package/src/mapper/insert/relations/ManyHasManyCreateInputProcessor.ts +10 -7
  1049. package/src/mapper/insert/relations/ManyHasOneCreateInputProcessor.ts +4 -4
  1050. package/src/mapper/insert/relations/OneHasManyCreateInputProcessor.ts +3 -3
  1051. package/src/mapper/insert/relations/OneHasOneInverseCreateInputProcessor.ts +7 -7
  1052. package/src/mapper/insert/relations/OneHasOneOwningCreateInputProcessor.ts +6 -6
  1053. package/src/mapper/select/ConditionBuilder.ts +12 -1
  1054. package/src/mapper/select/JoinBuilder.ts +39 -6
  1055. package/src/mapper/select/OrderByBuilder.ts +140 -19
  1056. package/src/mapper/select/OrderByHelper.ts +19 -10
  1057. package/src/mapper/select/Path.ts +36 -5
  1058. package/src/mapper/select/RelationFetcher.ts +7 -9
  1059. package/src/mapper/select/SelectBuilder.ts +12 -20
  1060. package/src/mapper/select/SelectExecutionHandler.ts +5 -0
  1061. package/src/mapper/select/SelectHydrator.ts +113 -31
  1062. package/src/mapper/select/WhereBuilder.ts +322 -50
  1063. package/src/mapper/select/getFieldReadPredicate.ts +12 -0
  1064. package/src/mapper/select/handlers/FieldsVisitor.ts +10 -15
  1065. package/src/mapper/select/handlers/MetaHandler.ts +5 -3
  1066. package/src/mapper/select/index.ts +1 -0
  1067. package/src/mapper/select/optimizer/WhereOptimizer.ts +279 -6
  1068. package/src/mapper/select/optimizer/WhereReplacer.ts +1 -1
  1069. package/src/mapper/types.ts +16 -1
  1070. package/src/mapper/update/SqlUpdateInputProcessor.ts +8 -2
  1071. package/src/mapper/update/UpdateBuilder.ts +41 -3
  1072. package/src/mapper/update/UpdateBuilderFactory.ts +3 -2
  1073. package/src/mapper/update/Updater.ts +11 -4
  1074. package/src/mapper/update/relations/ManyHasManyUpdateInputProcessor.ts +38 -18
  1075. package/src/mapper/update/relations/ManyHasOneUpdateInputProcessor.ts +11 -9
  1076. package/src/mapper/update/relations/OneHasManyUpdateInputProcessor.ts +17 -5
  1077. package/src/mapper/update/relations/OneHasOneInverseUpdateInputProcessor.ts +16 -13
  1078. package/src/mapper/update/relations/OneHasOneOwningUpdateInputProcessor.ts +16 -13
  1079. package/src/mapper/update/relations/SetManyRelationHelper.ts +199 -0
  1080. package/src/resolvers/GraphQlQueryAstFactory.ts +2 -2
  1081. package/src/resolvers/MutationResolver.ts +87 -85
  1082. package/src/resolvers/ReadHelpers.ts +2 -5
  1083. package/src/resolvers/ReadResolver.ts +29 -23
  1084. package/src/schema/CustomTypesProvider.ts +40 -15
  1085. package/src/schema/EntityTypeProvider.ts +10 -5
  1086. package/src/schema/GraphQlSchemaBuilder.ts +18 -7
  1087. package/src/schema/GraphQlSchemaBuilderFactory.ts +24 -8
  1088. package/src/schema/MutationProvider.ts +41 -16
  1089. package/src/schema/OrderByTypeProvider.ts +9 -3
  1090. package/src/schema/QueryProvider.ts +13 -10
  1091. package/src/schema/ValidationQueriesProvider.ts +2 -0
  1092. package/src/schema/WhereTypeProvider.ts +18 -6
  1093. package/src/schema/calendarDate.ts +26 -0
  1094. package/src/schema/entities/FieldTypeVisitor.ts +17 -1
  1095. package/src/schema/index.ts +1 -0
  1096. package/src/schema/mutations/CreateEntityInputFieldVisitor.ts +10 -2
  1097. package/src/schema/mutations/UpdateEntityInputFieldVisitor.ts +10 -2
  1098. package/src/schema/mutations/UpdateEntityRelationInputFieldVisitor.ts +66 -7
  1099. package/src/schema/utils.ts +14 -0
  1100. package/src/schema-json/GraphQLJsBridge.ts +142 -0
  1101. package/src/schema-json/JsonColumnTypes.ts +116 -0
  1102. package/src/schema-json/JsonContentSchemaBuilder.ts +501 -0
  1103. package/src/schema-json/JsonContentSchemaShared.ts +19 -0
  1104. package/src/schema-json/JsonEntityTypes.ts +237 -0
  1105. package/src/schema-json/JsonFilterTypes.ts +159 -0
  1106. package/src/schema-json/JsonInputTypes.ts +305 -0
  1107. package/src/schema-json/JsonIntrospectionExtension.ts +37 -0
  1108. package/src/schema-json/JsonQueryAstFactory.ts +128 -0
  1109. package/src/schema-json/JsonTypeRegistry.ts +286 -0
  1110. package/src/schema-json/index.ts +6 -0
  1111. package/src/tsconfig.json +3 -1
  1112. package/src/utils/ResolveInfoUtils.ts +2 -2
  1113. package/src/utils/uniqueWhereFields.ts +14 -0
  1114. package/tests/cases/bugs/bug102.test.ts +4 -4
  1115. package/tests/cases/integration/graphQlRequests/delete/acl/throughScope.test.ts +320 -0
  1116. package/tests/cases/integration/graphQlRequests/delete/deleteById.test.ts +4 -3
  1117. package/tests/cases/integration/graphQlRequests/insert/acl/throughScope.test.ts +502 -0
  1118. package/tests/cases/integration/graphQlRequests/insert/memoryBudget.test.ts +96 -0
  1119. package/tests/cases/integration/graphQlRequests/query/acl/differentRowAndFieldPredicate.test.ts +4 -4
  1120. package/tests/cases/integration/graphQlRequests/query/acl/fieldRestrictedByLocale.test.ts +12 -10
  1121. package/tests/cases/integration/graphQlRequests/query/acl/hasManyCellPredicate.test.ts +54 -0
  1122. package/tests/cases/integration/graphQlRequests/query/acl/impliedReadGuard.test.ts +142 -0
  1123. package/tests/cases/integration/graphQlRequests/query/acl/internalColumnAliases.test.ts +326 -0
  1124. package/tests/cases/integration/graphQlRequests/query/acl/isNullAcl.test.ts +7 -4
  1125. package/tests/cases/integration/graphQlRequests/query/acl/manyHasManyGuardedJoin.test.ts +64 -0
  1126. package/tests/cases/integration/graphQlRequests/query/acl/maskedRelationField.test.ts +124 -0
  1127. package/tests/cases/integration/graphQlRequests/query/acl/mergedRolePredicate.test.ts +124 -0
  1128. package/tests/cases/integration/graphQlRequests/query/acl/metaReadableThroughContext.test.ts +315 -0
  1129. package/tests/cases/integration/graphQlRequests/query/acl/negationAcrossSubquery.test.ts +55 -0
  1130. package/tests/cases/integration/graphQlRequests/query/acl/nestedPredicate.test.ts +7 -6
  1131. package/tests/cases/integration/graphQlRequests/query/acl/nonAdjacentBackReference.test.ts +141 -0
  1132. package/tests/cases/integration/graphQlRequests/query/acl/notOverGuardedHop.test.ts +320 -0
  1133. package/tests/cases/integration/graphQlRequests/query/acl/notOverOrCellPredicate.test.ts +156 -0
  1134. package/tests/cases/integration/graphQlRequests/query/acl/orderByCellPredicate.test.ts +513 -0
  1135. package/tests/cases/integration/graphQlRequests/query/acl/predicateElimination.test.ts +25 -23
  1136. package/tests/cases/integration/graphQlRequests/query/acl/relationAcl.test.ts +12 -9
  1137. package/tests/cases/integration/graphQlRequests/query/acl/rowPredicateSubset.test.ts +6 -6
  1138. package/tests/cases/integration/graphQlRequests/query/acl/throughScope.test.ts +350 -0
  1139. package/tests/cases/integration/graphQlRequests/query/acl/throughScopeFilter.test.ts +203 -0
  1140. package/tests/cases/integration/graphQlRequests/query/acl/throughScopeNullability.test.ts +127 -0
  1141. package/tests/cases/integration/graphQlRequests/query/filter/backReferencedFilter.test.ts +3 -1
  1142. package/tests/cases/integration/graphQlRequests/query/filter/hasOneDataViewFilter.test.ts +79 -0
  1143. package/tests/cases/integration/graphQlRequests/query/graphqlFeatures/alias.test.ts +46 -3
  1144. package/tests/cases/integration/graphQlRequests/query/graphqlFeatures/fragments.test.ts +8 -8
  1145. package/tests/cases/integration/graphQlRequests/query/misc/reducedHasMany.test.ts +10 -10
  1146. package/tests/cases/integration/graphQlRequests/query/pagination/hasManyLimit.test.ts +54 -8
  1147. package/tests/cases/integration/graphQlRequests/query/pagination/paginate.test.ts +5 -4
  1148. package/tests/cases/integration/graphQlRequests/query/pagination/paginateAliased.test.ts +5 -4
  1149. package/tests/cases/integration/graphQlRequests/query/relations/advanced.test.ts +17 -8
  1150. package/tests/cases/integration/graphQlRequests/query/relations/manyHasManyInverse.test.ts +6 -6
  1151. package/tests/cases/integration/graphQlRequests/query/relations/manyHasManyOwning.test.ts +6 -6
  1152. package/tests/cases/integration/graphQlRequests/query/relations/manyHasOne.test.ts +12 -9
  1153. package/tests/cases/integration/graphQlRequests/query/relations/oneHasMany.test.ts +15 -15
  1154. package/tests/cases/integration/graphQlRequests/query/relations/oneHasOneInverse.test.ts +6 -4
  1155. package/tests/cases/integration/graphQlRequests/query/relations/oneHasOneOwner.test.ts +6 -4
  1156. package/tests/cases/integration/graphQlRequests/query/sorting/defaultOrdering.test.ts +4 -4
  1157. package/tests/cases/integration/graphQlRequests/query/sorting/randomSort.test.ts +108 -4
  1158. package/tests/cases/integration/graphQlRequests/query/sorting/sortedHasMany.test.ts +2 -2
  1159. package/tests/cases/integration/graphQlRequests/query/view/view.test.ts +6 -6
  1160. package/tests/cases/integration/graphQlRequests/update/acl/legacyNoRootRootWrites.test.ts +127 -0
  1161. package/tests/cases/integration/graphQlRequests/update/acl/throughScope.test.ts +89 -0
  1162. package/tests/cases/integration/graphQlRequests/update/acl/throughScopeJunction.test.ts +296 -0
  1163. package/tests/cases/integration/graphQlRequests/update/acl/throughScopeLookup.test.ts +265 -0
  1164. package/tests/cases/integration/graphQlRequests/update/acl/throughScopeRootWrites.test.ts +441 -0
  1165. package/tests/cases/integration/graphQlRequests/update/acl/throughScopeUpdate.test.ts +415 -0
  1166. package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/set.test.ts +219 -0
  1167. package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/set.test.ts +479 -0
  1168. package/tests/cases/integration/graphQlRequests/update/oneHasMany/set.test.ts +948 -0
  1169. package/tests/cases/integration/graphQlRequests/upsert/acl/throughScope.test.ts +134 -0
  1170. package/tests/cases/integration/graphQlSchema/graphQlSchemaBuilder.test.ts +247 -26
  1171. package/tests/cases/integration/graphQlSchema/schema-acl-allowed.gql +18 -0
  1172. package/tests/cases/integration/graphQlSchema/schema-acl-create-only.gql +2 -0
  1173. package/tests/cases/integration/graphQlSchema/schema-acl-restricted-create.gql +15 -0
  1174. package/tests/cases/integration/graphQlSchema/schema-acl-restricted-delete.gql +12 -0
  1175. package/tests/cases/integration/graphQlSchema/schema-acl-restricted-read.gql +254 -0
  1176. package/tests/cases/integration/graphQlSchema/schema-acl-restricted-update.gql +2 -0
  1177. package/tests/cases/integration/graphQlSchema/schema-acl.gql +2 -0
  1178. package/tests/cases/integration/graphQlSchema/schema-aliased-type.gql +2 -0
  1179. package/tests/cases/integration/graphQlSchema/schema-array.gql +2 -0
  1180. package/tests/cases/integration/graphQlSchema/schema-basic.gql +51 -0
  1181. package/tests/cases/integration/graphQlSchema/schema-bug-66.gql +18 -0
  1182. package/tests/cases/integration/graphQlSchema/schema-column-types.gql +2 -0
  1183. package/tests/cases/integration/graphQlSchema/schema-custom-primary.gql +51 -0
  1184. package/tests/cases/integration/graphQlSchema/schema-deprecation.gql +962 -0
  1185. package/tests/cases/integration/graphQlSchema/schema-description.gql +992 -0
  1186. package/tests/cases/integration/graphQlSchema/schema-has-many-reduction.gql +18 -0
  1187. package/tests/cases/integration/graphQlSchema/schema-mixed-root-through.gql +266 -0
  1188. package/tests/cases/integration/graphQlSchema/schema-new-builder.gql +51 -0
  1189. package/tests/cases/integration/graphQlSchema/schema-no-root-ops.gql +2 -0
  1190. package/tests/cases/integration/graphQlSchema/schema-not-null-through.gql +201 -0
  1191. package/tests/cases/unit/checkViolationError.test.ts +49 -0
  1192. package/tests/cases/unit/dateType.test.ts +46 -0
  1193. package/tests/cases/unit/decimalType.test.ts +2 -2
  1194. package/tests/cases/unit/internalColumnAliases.test.ts +41 -0
  1195. package/tests/cases/unit/introspectionAcl.test.ts +30 -0
  1196. package/tests/cases/unit/mutationSqlError.test.ts +30 -0
  1197. package/tests/cases/unit/pathAlias.test.ts +26 -0
  1198. package/tests/cases/unit/permissionMerger.test.ts +947 -13
  1199. package/tests/cases/unit/predicatesFactory.test.ts +7 -16
  1200. package/tests/cases/unit/predicatesInjector.test.ts +1046 -183
  1201. package/tests/cases/unit/variableInjector.test.ts +12 -0
  1202. package/tests/cases/unit/whereOptimizer.test.ts +62 -0
  1203. package/tests/src/test.ts +51 -9
  1204. package/tests/src/testGraphql.ts +43 -20
  1205. package/tests/tsconfig.json +1 -0
@@ -0,0 +1,948 @@
1
+ import { test } from 'bun:test'
2
+ import { Acl } from '@contember/schema'
3
+ import { execute, failedTransaction, sqlTransaction } from '../../../../../src/test.js'
4
+ import { GQL, SQL } from '../../../../../src/tags.js'
5
+ import { testUuid } from '../../../../../src/testUuid.js'
6
+ import { postWithLocale, postWithNullableLocale } from './schema.js'
7
+
8
+ test('set with default orphanStrategy (disconnect)', async () => {
9
+ await execute({
10
+ schema: postWithNullableLocale,
11
+ query: GQL`mutation {
12
+ updatePost(
13
+ by: {id: "${testUuid(2)}"},
14
+ data: {locales: {set: [{connect: {id: "${testUuid(1)}"}}]}}
15
+ ) {
16
+ ok
17
+ }
18
+ }`,
19
+ executes: [
20
+ ...sqlTransaction([
21
+ {
22
+ sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
23
+ parameters: [testUuid(2)],
24
+ response: { rows: [{ id: testUuid(2) }] },
25
+ },
26
+ // snapshot the members up front - orphans are members from *before* the operation
27
+ {
28
+ sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
29
+ parameters: [testUuid(2)],
30
+ response: { rows: [{ primary_: testUuid(1) }, { primary_: testUuid(3) }] },
31
+ },
32
+ // resolve the connect target primary
33
+ {
34
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ?`,
35
+ parameters: [testUuid(1)],
36
+ response: { rows: [{ id: testUuid(1) }] },
37
+ },
38
+ // orphan (id=3) is disconnected: resolve it
39
+ {
40
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
41
+ parameters: [testUuid(3), testUuid(2)],
42
+ response: { rows: [{ id: testUuid(3) }] },
43
+ },
44
+ // orphan (id=3) disconnected: set post_id to null
45
+ {
46
+ sql:
47
+ SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
48
+ update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
49
+ parameters: [null, testUuid(3)],
50
+ response: { rows: [{ post_id_old__: testUuid(2) }] },
51
+ },
52
+ // connect: point the target locale to the post
53
+ {
54
+ sql:
55
+ SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
56
+ update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
57
+ parameters: [testUuid(2), testUuid(1)],
58
+ response: { rows: [{ post_id_old__: testUuid(99) }] },
59
+ },
60
+ ]),
61
+ ],
62
+ return: {
63
+ data: {
64
+ updatePost: {
65
+ ok: true,
66
+ },
67
+ },
68
+ },
69
+ })
70
+ })
71
+
72
+ test('set with orphanStrategy delete', async () => {
73
+ await execute({
74
+ schema: postWithNullableLocale,
75
+ query: GQL`mutation {
76
+ updatePost(
77
+ by: {id: "${testUuid(2)}"},
78
+ data: {locales: {orphanStrategy: delete, set: [{connect: {id: "${testUuid(1)}"}}]}}
79
+ ) {
80
+ ok
81
+ }
82
+ }`,
83
+ executes: [
84
+ ...sqlTransaction([
85
+ {
86
+ sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
87
+ parameters: [testUuid(2)],
88
+ response: { rows: [{ id: testUuid(2) }] },
89
+ },
90
+ {
91
+ sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
92
+ parameters: [testUuid(2)],
93
+ response: { rows: [{ primary_: testUuid(1) }, { primary_: testUuid(3) }] },
94
+ },
95
+ {
96
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ?`,
97
+ parameters: [testUuid(1)],
98
+ response: { rows: [{ id: testUuid(1) }] },
99
+ },
100
+ // orphan (id=3) is deleted
101
+ {
102
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
103
+ parameters: [testUuid(3), testUuid(2)],
104
+ response: { rows: [{ id: testUuid(3) }] },
105
+ },
106
+ {
107
+ sql: SQL`select "root_"."id" as "id", true as "allowed" from "public"."post_locale" as "root_" where "root_"."id" = ?`,
108
+ parameters: [testUuid(3)],
109
+ response: { rows: [{ id: testUuid(3), allowed: true }] },
110
+ },
111
+ {
112
+ sql: SQL`delete from "public"."post_locale" where "id" in (?)`,
113
+ parameters: [testUuid(3)],
114
+ response: { rows: [{ id: testUuid(3) }] },
115
+ },
116
+ {
117
+ sql:
118
+ SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
119
+ update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
120
+ parameters: [testUuid(2), testUuid(1)],
121
+ response: { rows: [{ post_id_old__: testUuid(99) }] },
122
+ },
123
+ ]),
124
+ ],
125
+ return: {
126
+ data: {
127
+ updatePost: {
128
+ ok: true,
129
+ },
130
+ },
131
+ },
132
+ })
133
+ })
134
+
135
+ test('set without orphans (collection already matches)', async () => {
136
+ await execute({
137
+ schema: postWithNullableLocale,
138
+ query: GQL`mutation {
139
+ updatePost(
140
+ by: {id: "${testUuid(2)}"},
141
+ data: {locales: {set: [{connect: {id: "${testUuid(1)}"}}]}}
142
+ ) {
143
+ ok
144
+ }
145
+ }`,
146
+ executes: [
147
+ ...sqlTransaction([
148
+ {
149
+ sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
150
+ parameters: [testUuid(2)],
151
+ response: { rows: [{ id: testUuid(2) }] },
152
+ },
153
+ // snapshot the members up front - orphans are members from *before* the operation
154
+ {
155
+ sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
156
+ parameters: [testUuid(2)],
157
+ response: { rows: [{ primary_: testUuid(1) }] },
158
+ },
159
+ {
160
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ?`,
161
+ parameters: [testUuid(1)],
162
+ response: { rows: [{ id: testUuid(1) }] },
163
+ },
164
+ {
165
+ sql:
166
+ SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
167
+ update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
168
+ parameters: [testUuid(2), testUuid(1)],
169
+ response: { rows: [{ post_id_old__: testUuid(99) }] },
170
+ },
171
+ ]),
172
+ ],
173
+ return: {
174
+ data: {
175
+ updatePost: {
176
+ ok: true,
177
+ },
178
+ },
179
+ },
180
+ })
181
+ })
182
+
183
+ test('set with a create item and an orphan disconnect', async () => {
184
+ await execute({
185
+ schema: postWithNullableLocale,
186
+ query: GQL`mutation {
187
+ updatePost(
188
+ by: {id: "${testUuid(2)}"},
189
+ data: {locales: {set: [{create: {locale: "cs", title: "cs"}}]}}
190
+ ) {
191
+ ok
192
+ }
193
+ }`,
194
+ executes: [
195
+ ...sqlTransaction([
196
+ {
197
+ sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
198
+ parameters: [testUuid(2)],
199
+ response: { rows: [{ id: testUuid(2) }] },
200
+ },
201
+ // snapshot the members up front - orphans are members from *before* the operation
202
+ {
203
+ sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
204
+ parameters: [testUuid(2)],
205
+ response: { rows: [{ primary_: testUuid(1) }, { primary_: testUuid(3) }] },
206
+ },
207
+ // phase 2: a `create` item names no existing member, so both are orphans and go first
208
+ {
209
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
210
+ parameters: [testUuid(1), testUuid(2)],
211
+ response: { rows: [{ id: testUuid(1) }] },
212
+ },
213
+ {
214
+ sql:
215
+ SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
216
+ update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
217
+ parameters: [null, testUuid(1)],
218
+ response: { rows: [{ post_id_old__: testUuid(2) }] },
219
+ },
220
+ {
221
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
222
+ parameters: [testUuid(3), testUuid(2)],
223
+ response: { rows: [{ id: testUuid(3) }] },
224
+ },
225
+ {
226
+ sql:
227
+ SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
228
+ update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
229
+ parameters: [null, testUuid(3)],
230
+ response: { rows: [{ post_id_old__: testUuid(2) }] },
231
+ },
232
+ // phase 3: only now is the new locale inserted
233
+ {
234
+ sql:
235
+ SQL`with "root_" as (select ? :: uuid as "id", ? :: text as "title", ? :: text as "locale", ? :: uuid as "post_id") insert into "public"."post_locale" ("id", "title", "locale", "post_id") select "root_"."id", "root_"."title", "root_"."locale", "root_"."post_id" from "root_" returning "id"`,
236
+ parameters: [testUuid(1), 'cs', 'cs', testUuid(2)],
237
+ response: { rows: [{ id: testUuid(1) }] },
238
+ },
239
+ ]),
240
+ ],
241
+ return: {
242
+ data: {
243
+ updatePost: {
244
+ ok: true,
245
+ },
246
+ },
247
+ },
248
+ })
249
+ })
250
+
251
+ test('set must be the only item', async () => {
252
+ let error: unknown
253
+ try {
254
+ await execute({
255
+ schema: postWithNullableLocale,
256
+ query: GQL`mutation {
257
+ updatePost(
258
+ by: {id: "${testUuid(2)}"},
259
+ data: {locales: [{set: [{connect: {id: "${testUuid(1)}"}}]}, {connect: {id: "${testUuid(3)}"}}]}
260
+ ) {
261
+ ok
262
+ }
263
+ }`,
264
+ executes: [
265
+ ...sqlTransaction([]),
266
+ ],
267
+ return: {},
268
+ })
269
+ } catch (e) {
270
+ error = e
271
+ }
272
+ if (!(error instanceof Error) || !error.message.includes('"set" operation must be the only item')) {
273
+ throw new Error(`Expected a "set must be the only item" error, got: ${String(error)}`)
274
+ }
275
+ })
276
+
277
+ test('set with an update item (updates an existing member, no orphans)', async () => {
278
+ await execute({
279
+ schema: postWithNullableLocale,
280
+ query: GQL`mutation {
281
+ updatePost(
282
+ by: {id: "${testUuid(2)}"},
283
+ data: {locales: {set: [{update: {by: {id: "${testUuid(1)}"}, data: {title: "Hello"}}}]}}
284
+ ) {
285
+ ok
286
+ }
287
+ }`,
288
+ executes: [
289
+ ...sqlTransaction([
290
+ {
291
+ sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
292
+ parameters: [testUuid(2)],
293
+ response: { rows: [{ id: testUuid(2) }] },
294
+ },
295
+ // snapshot the members up front - orphans are members from *before* the operation
296
+ {
297
+ sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
298
+ parameters: [testUuid(2)],
299
+ response: { rows: [{ primary_: testUuid(1) }] },
300
+ },
301
+ // phase 1 resolves the update target scoped to the owner, so a partial composite
302
+ // unique key would work here just as it does for a plain per-item update
303
+ {
304
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
305
+ parameters: [testUuid(1), testUuid(2)],
306
+ response: { rows: [{ id: testUuid(1) }] },
307
+ },
308
+ // no orphans - the only member is the one the input names
309
+ // phase 3: the update processor resolves it again, then updates
310
+ {
311
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
312
+ parameters: [testUuid(1), testUuid(2)],
313
+ response: { rows: [{ id: testUuid(1) }] },
314
+ },
315
+ {
316
+ sql:
317
+ SQL`with "newData_" as (select ? :: text as "title", "root_"."title" as "title_old__", "root_"."id", "root_"."locale", "root_"."post_id" from "public"."post_locale" as "root_" where "root_"."id" = ?)
318
+ update "public"."post_locale" set "title" = "newData_"."title" from "newData_" where "post_locale"."id" = "newData_"."id" returning "title_old__"`,
319
+ parameters: ['Hello', testUuid(1)],
320
+ response: { rows: [{ title_old__: 'Hi' }] },
321
+ },
322
+ ]),
323
+ ],
324
+ return: {
325
+ data: {
326
+ updatePost: {
327
+ ok: true,
328
+ },
329
+ },
330
+ },
331
+ })
332
+ })
333
+
334
+ test('set with a connectOrCreate item (existing target) and an orphan disconnect', async () => {
335
+ await execute({
336
+ schema: postWithNullableLocale,
337
+ query: GQL`mutation {
338
+ updatePost(
339
+ by: {id: "${testUuid(2)}"},
340
+ data: {locales: {set: [{connectOrCreate: {connect: {id: "${testUuid(1)}"}, create: {locale: "cs", title: "cs"}}}]}}
341
+ ) {
342
+ ok
343
+ }
344
+ }`,
345
+ executes: [
346
+ ...sqlTransaction([
347
+ {
348
+ sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
349
+ parameters: [testUuid(2)],
350
+ response: { rows: [{ id: testUuid(2) }] },
351
+ },
352
+ // snapshot the members up front - orphans are members from *before* the operation
353
+ {
354
+ sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
355
+ parameters: [testUuid(2)],
356
+ response: { rows: [{ primary_: testUuid(1) }, { primary_: testUuid(3) }] },
357
+ },
358
+ // the set helper resolves the connectOrCreate target up-front to mark it desired
359
+ {
360
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ?`,
361
+ parameters: [testUuid(1)],
362
+ response: { rows: [{ id: testUuid(1) }] },
363
+ },
364
+ {
365
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
366
+ parameters: [testUuid(3), testUuid(2)],
367
+ response: { rows: [{ id: testUuid(3) }] },
368
+ },
369
+ {
370
+ sql:
371
+ SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
372
+ update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
373
+ parameters: [null, testUuid(3)],
374
+ response: { rows: [{ post_id_old__: testUuid(2) }] },
375
+ },
376
+ // connectOrCreate processor resolves the target again, finds it, and connects it
377
+ {
378
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ?`,
379
+ parameters: [testUuid(1)],
380
+ response: { rows: [{ id: testUuid(1) }] },
381
+ },
382
+ {
383
+ sql:
384
+ SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
385
+ update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
386
+ parameters: [testUuid(2), testUuid(1)],
387
+ response: { rows: [{ post_id_old__: testUuid(99) }] },
388
+ },
389
+ ]),
390
+ ],
391
+ return: {
392
+ data: {
393
+ updatePost: {
394
+ ok: true,
395
+ },
396
+ },
397
+ },
398
+ })
399
+ })
400
+
401
+ test('set with an upsert item that creates (target does not exist)', async () => {
402
+ await execute({
403
+ schema: postWithNullableLocale,
404
+ query: GQL`mutation {
405
+ updatePost(
406
+ by: {id: "${testUuid(2)}"},
407
+ data: {locales: {set: [{upsert: {by: {id: "${testUuid(1)}"}, update: {title: "upd"}, create: {locale: "cs", title: "cs"}}}]}}
408
+ ) {
409
+ ok
410
+ }
411
+ }`,
412
+ executes: [
413
+ ...sqlTransaction([
414
+ {
415
+ sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
416
+ parameters: [testUuid(2)],
417
+ response: { rows: [{ id: testUuid(2) }] },
418
+ },
419
+ // snapshot the members up front - orphans are members from *before* the operation
420
+ {
421
+ sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
422
+ parameters: [testUuid(2)],
423
+ response: { rows: [{ primary_: testUuid(3) }] },
424
+ },
425
+ // phase 1 resolves the upsert target within the collection - it is not there
426
+ {
427
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
428
+ parameters: [testUuid(1), testUuid(2)],
429
+ response: { rows: [] },
430
+ },
431
+ // phase 2: the member the input does not name is disconnected first
432
+ {
433
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
434
+ parameters: [testUuid(3), testUuid(2)],
435
+ response: { rows: [{ id: testUuid(3) }] },
436
+ },
437
+ {
438
+ sql:
439
+ SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
440
+ update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
441
+ parameters: [null, testUuid(3)],
442
+ response: { rows: [{ post_id_old__: testUuid(2) }] },
443
+ },
444
+ // phase 3: the upsert processor tries the update first, scoped to the owner - not found
445
+ {
446
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
447
+ parameters: [testUuid(1), testUuid(2)],
448
+ response: { rows: [] },
449
+ },
450
+ // falls back to insert
451
+ {
452
+ sql:
453
+ SQL`with "root_" as (select ? :: uuid as "id", ? :: text as "title", ? :: text as "locale", ? :: uuid as "post_id") insert into "public"."post_locale" ("id", "title", "locale", "post_id") select "root_"."id", "root_"."title", "root_"."locale", "root_"."post_id" from "root_" returning "id"`,
454
+ parameters: [testUuid(1), 'cs', 'cs', testUuid(2)],
455
+ response: { rows: [{ id: testUuid(1) }] },
456
+ },
457
+ ]),
458
+ ],
459
+ return: {
460
+ data: {
461
+ updatePost: {
462
+ ok: true,
463
+ },
464
+ },
465
+ },
466
+ })
467
+ })
468
+
469
+ test('set with orphanStrategy delete is rejected when delete is ACL-denied', async () => {
470
+ await execute({
471
+ schema: postWithNullableLocale,
472
+ query: GQL`mutation {
473
+ updatePost(
474
+ by: {id: "${testUuid(2)}"},
475
+ data: {locales: {orphanStrategy: delete, set: [{connect: {id: "${testUuid(1)}"}}]}}
476
+ ) {
477
+ ok
478
+ }
479
+ }`,
480
+ executes: [
481
+ ...failedTransaction([
482
+ {
483
+ sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
484
+ parameters: [testUuid(2)],
485
+ response: { rows: [{ id: testUuid(2) }] },
486
+ },
487
+ {
488
+ sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
489
+ parameters: [testUuid(2)],
490
+ response: { rows: [{ primary_: testUuid(1) }, { primary_: testUuid(3) }] },
491
+ },
492
+ {
493
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ?`,
494
+ parameters: [testUuid(1)],
495
+ response: { rows: [{ id: testUuid(1) }] },
496
+ },
497
+ // orphan (id=3): delete is attempted, but the ACL predicate denies it
498
+ {
499
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
500
+ parameters: [testUuid(3), testUuid(2)],
501
+ response: { rows: [{ id: testUuid(3) }] },
502
+ },
503
+ {
504
+ sql: SQL`select "root_"."id" as "id", true as "allowed" from "public"."post_locale" as "root_" where "root_"."id" = ?`,
505
+ parameters: [testUuid(3)],
506
+ response: { rows: [{ id: testUuid(3), allowed: false }] },
507
+ },
508
+ ]),
509
+ ],
510
+ return: {
511
+ data: {
512
+ updatePost: {
513
+ ok: false,
514
+ },
515
+ },
516
+ },
517
+ })
518
+ })
519
+
520
+ test('empty set clears the whole collection (disconnect)', async () => {
521
+ await execute({
522
+ schema: postWithNullableLocale,
523
+ query: GQL`mutation {
524
+ updatePost(
525
+ by: {id: "${testUuid(2)}"},
526
+ data: {locales: {set: []}}
527
+ ) {
528
+ ok
529
+ }
530
+ }`,
531
+ executes: [
532
+ ...sqlTransaction([
533
+ {
534
+ sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
535
+ parameters: [testUuid(2)],
536
+ response: { rows: [{ id: testUuid(2) }] },
537
+ },
538
+ // no desired members - every current member is an orphan
539
+ {
540
+ sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
541
+ parameters: [testUuid(2)],
542
+ response: { rows: [{ primary_: testUuid(1) }, { primary_: testUuid(3) }] },
543
+ },
544
+ // orphan (id=1) disconnected
545
+ {
546
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
547
+ parameters: [testUuid(1), testUuid(2)],
548
+ response: { rows: [{ id: testUuid(1) }] },
549
+ },
550
+ {
551
+ sql:
552
+ SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
553
+ update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
554
+ parameters: [null, testUuid(1)],
555
+ response: { rows: [{ post_id_old__: testUuid(2) }] },
556
+ },
557
+ // orphan (id=3) disconnected
558
+ {
559
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
560
+ parameters: [testUuid(3), testUuid(2)],
561
+ response: { rows: [{ id: testUuid(3) }] },
562
+ },
563
+ {
564
+ sql:
565
+ SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
566
+ update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
567
+ parameters: [null, testUuid(3)],
568
+ response: { rows: [{ post_id_old__: testUuid(2) }] },
569
+ },
570
+ ]),
571
+ ],
572
+ return: {
573
+ data: {
574
+ updatePost: {
575
+ ok: true,
576
+ },
577
+ },
578
+ },
579
+ })
580
+ })
581
+
582
+ // An upsert whose `by` names a record outside the collection falls back to an insert. Phase 1
583
+ // resolves `by` within the collection, so it marks nothing, and the record the insert creates
584
+ // cannot be an orphan - it did not exist when the snapshot was taken.
585
+ test('set with an upsert item whose "by" matches a record outside the collection', async () => {
586
+ await execute({
587
+ schema: postWithNullableLocale,
588
+ query: GQL`mutation {
589
+ updatePost(
590
+ by: {id: "${testUuid(2)}"},
591
+ data: {locales: {set: [{upsert: {by: {id: "${testUuid(10)}"}, update: {title: "upd"}, create: {locale: "cs", title: "cs"}}}]}}
592
+ ) {
593
+ ok
594
+ }
595
+ }`,
596
+ executes: [
597
+ ...sqlTransaction([
598
+ {
599
+ sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
600
+ parameters: [testUuid(2)],
601
+ response: { rows: [{ id: testUuid(2) }] },
602
+ },
603
+ // snapshot the members up front - orphans are members from *before* the operation
604
+ {
605
+ sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
606
+ parameters: [testUuid(2)],
607
+ response: { rows: [{ primary_: testUuid(3) }] },
608
+ },
609
+ // phase 1 resolves `by` within the collection - not there, so nothing is marked
610
+ {
611
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
612
+ parameters: [testUuid(10), testUuid(2)],
613
+ response: { rows: [] },
614
+ },
615
+ // phase 2: only the pre-existing member (id=3) is orphaned
616
+ {
617
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
618
+ parameters: [testUuid(3), testUuid(2)],
619
+ response: { rows: [{ id: testUuid(3) }] },
620
+ },
621
+ {
622
+ sql:
623
+ SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
624
+ update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
625
+ parameters: [null, testUuid(3)],
626
+ response: { rows: [{ post_id_old__: testUuid(2) }] },
627
+ },
628
+ // phase 3: the upsert processor tries its own scoped update first - not found
629
+ {
630
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
631
+ parameters: [testUuid(10), testUuid(2)],
632
+ response: { rows: [] },
633
+ },
634
+ // falls back to insert; the new record survives the operation
635
+ {
636
+ sql:
637
+ SQL`with "root_" as (select ? :: uuid as "id", ? :: text as "title", ? :: text as "locale", ? :: uuid as "post_id") insert into "public"."post_locale" ("id", "title", "locale", "post_id") select "root_"."id", "root_"."title", "root_"."locale", "root_"."post_id" from "root_" returning "id"`,
638
+ parameters: [testUuid(1), 'cs', 'cs', testUuid(2)],
639
+ response: { rows: [{ id: testUuid(1) }] },
640
+ },
641
+ ]),
642
+ ],
643
+ return: {
644
+ data: {
645
+ updatePost: {
646
+ ok: true,
647
+ },
648
+ },
649
+ },
650
+ })
651
+ })
652
+
653
+ // The relation input type exposes `alias` next to `set`, so it must be accepted (and ignored)
654
+ // rather than rejected as an unexpected key.
655
+ test('set accepts an alias on the relation input', async () => {
656
+ await execute({
657
+ schema: postWithNullableLocale,
658
+ query: GQL`mutation {
659
+ updatePost(
660
+ by: {id: "${testUuid(2)}"},
661
+ data: {locales: {alias: "myAlias", set: [{connect: {id: "${testUuid(1)}"}}]}}
662
+ ) {
663
+ ok
664
+ }
665
+ }`,
666
+ executes: [
667
+ ...sqlTransaction([
668
+ {
669
+ sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
670
+ parameters: [testUuid(2)],
671
+ response: { rows: [{ id: testUuid(2) }] },
672
+ },
673
+ {
674
+ sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
675
+ parameters: [testUuid(2)],
676
+ response: { rows: [{ primary_: testUuid(1) }] },
677
+ },
678
+ {
679
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ?`,
680
+ parameters: [testUuid(1)],
681
+ response: { rows: [{ id: testUuid(1) }] },
682
+ },
683
+ {
684
+ sql:
685
+ SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
686
+ update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
687
+ parameters: [testUuid(2), testUuid(1)],
688
+ response: { rows: [{ post_id_old__: testUuid(2) }] },
689
+ },
690
+ ]),
691
+ ],
692
+ return: {
693
+ data: {
694
+ updatePost: {
695
+ ok: true,
696
+ },
697
+ },
698
+ },
699
+ })
700
+ })
701
+
702
+ // A not-null owning relation has nowhere to put the null, so the default `disconnect` strategy
703
+ // cannot remove an orphan. The engine reports it instead of emitting a doomed UPDATE.
704
+ test('set with the default orphanStrategy fails on a not-null owning relation', async () => {
705
+ await execute({
706
+ schema: postWithLocale,
707
+ query: GQL`mutation {
708
+ updatePost(
709
+ by: {id: "${testUuid(2)}"},
710
+ data: {locales: {set: [{connect: {id: "${testUuid(1)}"}}]}}
711
+ ) {
712
+ ok
713
+ errors {
714
+ type
715
+ }
716
+ }
717
+ }`,
718
+ executes: [
719
+ ...failedTransaction([
720
+ {
721
+ sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
722
+ parameters: [testUuid(2)],
723
+ response: { rows: [{ id: testUuid(2) }] },
724
+ },
725
+ // snapshot the members up front - orphans are members from *before* the operation
726
+ {
727
+ sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
728
+ parameters: [testUuid(2)],
729
+ response: { rows: [{ primary_: testUuid(1) }, { primary_: testUuid(3) }] },
730
+ },
731
+ {
732
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ?`,
733
+ parameters: [testUuid(1)],
734
+ response: { rows: [{ id: testUuid(1) }] },
735
+ },
736
+ // orphan (id=3): resolved, but there is no way to detach it
737
+ {
738
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."id" = ? and "root_"."post_id" = ?`,
739
+ parameters: [testUuid(3), testUuid(2)],
740
+ response: { rows: [{ id: testUuid(3) }] },
741
+ },
742
+ ]),
743
+ ],
744
+ return: {
745
+ data: {
746
+ updatePost: {
747
+ ok: false,
748
+ errors: [{ type: 'NotNullConstraintViolation' }],
749
+ },
750
+ },
751
+ },
752
+ })
753
+ })
754
+
755
+ // Nullable GraphQL variables mean an operation key can arrive as an explicit null. The per-item
756
+ // path strips those before dispatching; `set` items have to behave the same, or the null key
757
+ // picks its branch and the mutation dies with an internal error.
758
+ test('set strips null-valued operation keys from an item', async () => {
759
+ await execute({
760
+ schema: postWithNullableLocale,
761
+ query: GQL`mutation {
762
+ updatePost(
763
+ by: {id: "${testUuid(2)}"},
764
+ data: {locales: {set: [{connect: null, create: {locale: "cs", title: "cs"}}]}}
765
+ ) {
766
+ ok
767
+ }
768
+ }`,
769
+ executes: [
770
+ ...sqlTransaction([
771
+ {
772
+ sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
773
+ parameters: [testUuid(2)],
774
+ response: { rows: [{ id: testUuid(2) }] },
775
+ },
776
+ {
777
+ sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
778
+ parameters: [testUuid(2)],
779
+ response: { rows: [] },
780
+ },
781
+ {
782
+ sql:
783
+ SQL`with "root_" as (select ? :: uuid as "id", ? :: text as "title", ? :: text as "locale", ? :: uuid as "post_id") insert into "public"."post_locale" ("id", "title", "locale", "post_id") select "root_"."id", "root_"."title", "root_"."locale", "root_"."post_id" from "root_" returning "id"`,
784
+ parameters: [testUuid(1), 'cs', 'cs', testUuid(2)],
785
+ response: { rows: [{ id: testUuid(1) }] },
786
+ },
787
+ ]),
788
+ ],
789
+ return: {
790
+ data: {
791
+ updatePost: {
792
+ ok: true,
793
+ },
794
+ },
795
+ },
796
+ })
797
+ })
798
+
799
+ // `set: null` is schema-valid (the field is a nullable list). It must be rejected with a user error
800
+ // rather than routed into the set path, where it would clear the collection.
801
+ test('set: null is rejected as a missing operation', async () => {
802
+ let error: unknown
803
+ try {
804
+ await execute({
805
+ schema: postWithNullableLocale,
806
+ query: GQL`mutation {
807
+ updatePost(
808
+ by: {id: "${testUuid(2)}"},
809
+ data: {locales: {set: null}}
810
+ ) {
811
+ ok
812
+ }
813
+ }`,
814
+ executes: [
815
+ ...sqlTransaction([
816
+ {
817
+ sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
818
+ parameters: [testUuid(2)],
819
+ response: { rows: [{ id: testUuid(2) }] },
820
+ },
821
+ ]),
822
+ ],
823
+ return: {},
824
+ })
825
+ } catch (e) {
826
+ error = e
827
+ }
828
+ if (!(error instanceof Error) || !error.message.includes('Expected exactly one of')) {
829
+ throw new Error(`Expected a user error about a missing operation, got: ${String(error)}`)
830
+ }
831
+ })
832
+
833
+ // The owner scope is what lets a partial composite unique key address a member, so phase 1 has to
834
+ // resolve `update.by` the same way the processor does - a global lookup would reject `{locale}`
835
+ // as non-unique on an entity whose unique key is (locale, post).
836
+ test('set resolves a partial composite unique `by` within the collection', async () => {
837
+ await execute({
838
+ schema: postWithNullableLocale,
839
+ query: GQL`mutation {
840
+ updatePost(
841
+ by: {id: "${testUuid(2)}"},
842
+ data: {locales: {set: [{update: {by: {locale: "cs"}, data: {title: "Hello"}}}]}}
843
+ ) {
844
+ ok
845
+ }
846
+ }`,
847
+ executes: [
848
+ ...sqlTransaction([
849
+ {
850
+ sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
851
+ parameters: [testUuid(2)],
852
+ response: { rows: [{ id: testUuid(2) }] },
853
+ },
854
+ {
855
+ sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ?`,
856
+ parameters: [testUuid(2)],
857
+ response: { rows: [{ primary_: testUuid(1) }] },
858
+ },
859
+ // phase 1: `{locale: "cs"}` alone is only unique once the owner completes it
860
+ {
861
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."locale" = ? and "root_"."post_id" = ?`,
862
+ parameters: ['cs', testUuid(2)],
863
+ response: { rows: [{ id: testUuid(1) }] },
864
+ },
865
+ // phase 3: the update processor resolves it again, then updates
866
+ {
867
+ sql: SQL`select "root_"."id" from "public"."post_locale" as "root_" where "root_"."locale" = ? and "root_"."post_id" = ?`,
868
+ parameters: ['cs', testUuid(2)],
869
+ response: { rows: [{ id: testUuid(1) }] },
870
+ },
871
+ {
872
+ sql:
873
+ SQL`with "newData_" as (select ? :: text as "title", "root_"."title" as "title_old__", "root_"."id", "root_"."locale", "root_"."post_id" from "public"."post_locale" as "root_" where "root_"."id" = ?)
874
+ update "public"."post_locale" set "title" = "newData_"."title" from "newData_" where "post_locale"."id" = "newData_"."id" returning "title_old__"`,
875
+ parameters: ['Hello', testUuid(1)],
876
+ response: { rows: [{ title_old__: 'Hi' }] },
877
+ },
878
+ ]),
879
+ ],
880
+ return: {
881
+ data: {
882
+ updatePost: {
883
+ ok: true,
884
+ },
885
+ },
886
+ },
887
+ })
888
+ })
889
+
890
+ // Orphans are found by the FK column and the target's read predicate only, like the many-has-many
891
+ // junction read. The owner's read predicate must not hide members from the diff.
892
+ const restrictedReadPermissions: Acl.Permissions = {
893
+ Post: {
894
+ predicates: {
895
+ post_read_predicate: { id: { eq: testUuid(2) } },
896
+ },
897
+ operations: {
898
+ read: { id: 'post_read_predicate' },
899
+ update: { id: true, locales: true },
900
+ },
901
+ },
902
+ PostLocale: {
903
+ predicates: {
904
+ locale_read_predicate: { locale: { eq: 'cs' } },
905
+ },
906
+ operations: {
907
+ read: { id: 'locale_read_predicate', post: true, locale: 'locale_read_predicate' },
908
+ update: { post: true },
909
+ },
910
+ },
911
+ }
912
+
913
+ test('set applies only the target read predicate when computing orphans', async () => {
914
+ await execute({
915
+ schema: postWithNullableLocale,
916
+ permissions: restrictedReadPermissions,
917
+ variables: {},
918
+ query: GQL`mutation {
919
+ updatePost(
920
+ by: {id: "${testUuid(2)}"},
921
+ data: {locales: {set: []}}
922
+ ) {
923
+ ok
924
+ }
925
+ }`,
926
+ executes: [
927
+ ...sqlTransaction([
928
+ {
929
+ sql: SQL`select "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?`,
930
+ parameters: [testUuid(2)],
931
+ response: { rows: [{ id: testUuid(2) }] },
932
+ },
933
+ {
934
+ sql: SQL`select "root_"."id" as "primary_" from "public"."post_locale" as "root_" where "root_"."post_id" = ? and "root_"."locale" = ?`,
935
+ parameters: [testUuid(2), 'cs'],
936
+ response: { rows: [] },
937
+ },
938
+ ]),
939
+ ],
940
+ return: {
941
+ data: {
942
+ updatePost: {
943
+ ok: true,
944
+ },
945
+ },
946
+ },
947
+ })
948
+ })