graphile-build-pg 5.0.0-alpha.1 → 5.0.0-alpha.11

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 (111) hide show
  1. package/CHANGELOG.md +281 -0
  2. package/README.md +3 -3
  3. package/dist/behavior.d.ts +2 -3
  4. package/dist/behavior.d.ts.map +1 -1
  5. package/dist/behavior.js +1 -2
  6. package/dist/behavior.js.map +1 -1
  7. package/dist/index.d.ts +2 -0
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +5 -1
  10. package/dist/index.js.map +1 -1
  11. package/dist/plugins/PgAllRowsPlugin.d.ts +0 -1
  12. package/dist/plugins/PgAllRowsPlugin.d.ts.map +1 -1
  13. package/dist/plugins/PgAllRowsPlugin.js +5 -12
  14. package/dist/plugins/PgAllRowsPlugin.js.map +1 -1
  15. package/dist/plugins/PgAttributesPlugin.d.ts +0 -1
  16. package/dist/plugins/PgAttributesPlugin.d.ts.map +1 -1
  17. package/dist/plugins/PgAttributesPlugin.js +13 -15
  18. package/dist/plugins/PgAttributesPlugin.js.map +1 -1
  19. package/dist/plugins/PgBasicsPlugin.d.ts +13 -1
  20. package/dist/plugins/PgBasicsPlugin.d.ts.map +1 -1
  21. package/dist/plugins/PgBasicsPlugin.js +77 -0
  22. package/dist/plugins/PgBasicsPlugin.js.map +1 -1
  23. package/dist/plugins/PgCodecsPlugin.d.ts +0 -1
  24. package/dist/plugins/PgCodecsPlugin.d.ts.map +1 -1
  25. package/dist/plugins/PgCodecsPlugin.js +8 -9
  26. package/dist/plugins/PgCodecsPlugin.js.map +1 -1
  27. package/dist/plugins/PgConditionArgumentPlugin.d.ts.map +1 -1
  28. package/dist/plugins/PgConditionArgumentPlugin.js +27 -17
  29. package/dist/plugins/PgConditionArgumentPlugin.js.map +1 -1
  30. package/dist/plugins/PgConditionCustomFieldsPlugin.d.ts +6 -0
  31. package/dist/plugins/PgConditionCustomFieldsPlugin.d.ts.map +1 -1
  32. package/dist/plugins/PgConditionCustomFieldsPlugin.js +45 -22
  33. package/dist/plugins/PgConditionCustomFieldsPlugin.js.map +1 -1
  34. package/dist/plugins/PgConnectionArgOrderByPlugin.d.ts.map +1 -1
  35. package/dist/plugins/PgConnectionArgOrderByPlugin.js +27 -14
  36. package/dist/plugins/PgConnectionArgOrderByPlugin.js.map +1 -1
  37. package/dist/plugins/PgConnectionTotalCountPlugin.d.ts.map +1 -1
  38. package/dist/plugins/PgConnectionTotalCountPlugin.js +6 -5
  39. package/dist/plugins/PgConnectionTotalCountPlugin.js.map +1 -1
  40. package/dist/plugins/PgCustomTypeFieldPlugin.d.ts.map +1 -1
  41. package/dist/plugins/PgCustomTypeFieldPlugin.js +36 -39
  42. package/dist/plugins/PgCustomTypeFieldPlugin.js.map +1 -1
  43. package/dist/plugins/PgEnumTablesPlugin.d.ts +13 -0
  44. package/dist/plugins/PgEnumTablesPlugin.d.ts.map +1 -1
  45. package/dist/plugins/PgEnumTablesPlugin.js +18 -5
  46. package/dist/plugins/PgEnumTablesPlugin.js.map +1 -1
  47. package/dist/plugins/PgFirstLastBeforeAfterArgsPlugin.js +11 -6
  48. package/dist/plugins/PgFirstLastBeforeAfterArgsPlugin.js.map +1 -1
  49. package/dist/plugins/PgInterfaceModeUnionAllRowsPlugin.d.ts +20 -0
  50. package/dist/plugins/PgInterfaceModeUnionAllRowsPlugin.d.ts.map +1 -0
  51. package/dist/plugins/PgInterfaceModeUnionAllRowsPlugin.js +206 -0
  52. package/dist/plugins/PgInterfaceModeUnionAllRowsPlugin.js.map +1 -0
  53. package/dist/plugins/PgIntrospectionPlugin.d.ts +1 -1
  54. package/dist/plugins/PgIntrospectionPlugin.d.ts.map +1 -1
  55. package/dist/plugins/PgIntrospectionPlugin.js +8 -3
  56. package/dist/plugins/PgIntrospectionPlugin.js.map +1 -1
  57. package/dist/plugins/PgJWTPlugin.d.ts.map +1 -1
  58. package/dist/plugins/PgJWTPlugin.js +6 -9
  59. package/dist/plugins/PgJWTPlugin.js.map +1 -1
  60. package/dist/plugins/PgMutationCreatePlugin.d.ts.map +1 -1
  61. package/dist/plugins/PgMutationCreatePlugin.js +29 -18
  62. package/dist/plugins/PgMutationCreatePlugin.js.map +1 -1
  63. package/dist/plugins/PgMutationPayloadEdgePlugin.d.ts +0 -1
  64. package/dist/plugins/PgMutationPayloadEdgePlugin.d.ts.map +1 -1
  65. package/dist/plugins/PgMutationPayloadEdgePlugin.js +4 -12
  66. package/dist/plugins/PgMutationPayloadEdgePlugin.js.map +1 -1
  67. package/dist/plugins/PgMutationUpdateDeletePlugin.d.ts.map +1 -1
  68. package/dist/plugins/PgMutationUpdateDeletePlugin.js +23 -35
  69. package/dist/plugins/PgMutationUpdateDeletePlugin.js.map +1 -1
  70. package/dist/plugins/PgOrderAllAttributesPlugin.d.ts.map +1 -1
  71. package/dist/plugins/PgOrderAllAttributesPlugin.js +10 -13
  72. package/dist/plugins/PgOrderAllAttributesPlugin.js.map +1 -1
  73. package/dist/plugins/PgOrderByPrimaryKeyPlugin.js +3 -3
  74. package/dist/plugins/PgOrderByPrimaryKeyPlugin.js.map +1 -1
  75. package/dist/plugins/PgOrderCustomFieldsPlugin.d.ts.map +1 -1
  76. package/dist/plugins/PgOrderCustomFieldsPlugin.js +21 -21
  77. package/dist/plugins/PgOrderCustomFieldsPlugin.js.map +1 -1
  78. package/dist/plugins/PgPolymorphismPlugin.d.ts.map +1 -1
  79. package/dist/plugins/PgPolymorphismPlugin.js +21 -15
  80. package/dist/plugins/PgPolymorphismPlugin.js.map +1 -1
  81. package/dist/plugins/PgProceduresPlugin.js +6 -6
  82. package/dist/plugins/PgProceduresPlugin.js.map +1 -1
  83. package/dist/plugins/PgRefsPlugin.js +1 -1
  84. package/dist/plugins/PgRefsPlugin.js.map +1 -1
  85. package/dist/plugins/PgRelationsPlugin.d.ts +0 -2
  86. package/dist/plugins/PgRelationsPlugin.d.ts.map +1 -1
  87. package/dist/plugins/PgRelationsPlugin.js +148 -162
  88. package/dist/plugins/PgRelationsPlugin.js.map +1 -1
  89. package/dist/plugins/PgRowByUniquePlugin.d.ts.map +1 -1
  90. package/dist/plugins/PgRowByUniquePlugin.js +7 -10
  91. package/dist/plugins/PgRowByUniquePlugin.js.map +1 -1
  92. package/dist/plugins/PgTableNodePlugin.d.ts +0 -1
  93. package/dist/plugins/PgTableNodePlugin.d.ts.map +1 -1
  94. package/dist/plugins/PgTableNodePlugin.js +32 -26
  95. package/dist/plugins/PgTableNodePlugin.js.map +1 -1
  96. package/dist/plugins/PgTablesPlugin.d.ts +0 -1
  97. package/dist/plugins/PgTablesPlugin.d.ts.map +1 -1
  98. package/dist/plugins/PgTablesPlugin.js +26 -25
  99. package/dist/plugins/PgTablesPlugin.js.map +1 -1
  100. package/dist/plugins/PgTypesPlugin.d.ts +0 -1
  101. package/dist/plugins/PgTypesPlugin.d.ts.map +1 -1
  102. package/dist/plugins/PgTypesPlugin.js +10 -11
  103. package/dist/plugins/PgTypesPlugin.js.map +1 -1
  104. package/dist/preset.d.ts.map +1 -1
  105. package/dist/preset.js +2 -0
  106. package/dist/preset.js.map +1 -1
  107. package/dist/utils.d.ts +15 -0
  108. package/dist/utils.d.ts.map +1 -1
  109. package/dist/utils.js +32 -1
  110. package/dist/utils.js.map +1 -1
  111. package/package.json +21 -12
package/CHANGELOG.md CHANGED
@@ -1,5 +1,286 @@
1
1
  # graphile-build-pg
2
2
 
3
+ ## 5.0.0-alpha.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [#349](https://github.com/benjie/postgraphile-private/pull/349)
8
+ [`a94f11091`](https://github.com/benjie/postgraphile-private/commit/a94f11091520b52d90fd007986760848ed20017b)
9
+ Thanks [@benjie](https://github.com/benjie)! - **Overhaul behavior system**
10
+
11
+ Previously the behavior system worked during the schema building process,
12
+ inside the various schema hooks. So looking at the behavior of a `relation`
13
+ might have looked like:
14
+
15
+ ```ts
16
+ GraphQLObjectType_fields_field(field, build, context) {
17
+ const relation = context.scope.pgRelationOrWhatever;
18
+
19
+ // Establish a default behavior, e.g. you might give it different default behavior
20
+ // depending on if the remote table is in the same schema or not
21
+ const defaultBehavior = someCondition(relation) ? "behavior_if_true" : "behavior_if_false";
22
+
23
+ // Now establish the user-specified behavior for the entity, inheriting from all the
24
+ // relevant places.
25
+ const behavior = getBehavior([
26
+ relation.remoteResource.codec.extensions,
27
+ relation.remoteResource.extensions,
28
+ relation.extensions
29
+ ]);
30
+
31
+ // Finally check this behavior string against `behavior_to_test`, being sure to apply
32
+ // the "schema-time smart defaulting" that we established in `defaultBehavior` above.
33
+ if (build.behavior.matches(behavior, "behavior_to_test", defaultBehavior)) {
34
+ doTheThing();
35
+ }
36
+ ```
37
+
38
+ This meant that each plugin might treat the behavior of the entity different -
39
+ for example `postgraphile-plugin-connection-filter` might have a different
40
+ `someCondition()` under which the "filter" behavior would apply by default,
41
+ whereas the built in `condition` plugin might have a different one.
42
+
43
+ Moreover, each place needs to know to call `getBehavior` with the same list of
44
+ extension sources in the same order, otherwise subtle (or not so subtle)
45
+ differences in the schema would occur.
46
+
47
+ And finally, because each entity doesn't have an established behavior, you
48
+ can't ask "what's the final behavior for this entity" because it's dynamic,
49
+ depending on which plugin is viewing it.
50
+
51
+ This update fixes all of this; now each entity has a single behavior that's
52
+ established once. Each plugin can register `entityBehaviors` for the various
53
+ behavior entity types (or global behaviors which apply to all entity types if
54
+ that makes more sense). So the hook code equivalent to the above would now be
55
+ more like:
56
+
57
+ ```ts
58
+ GraphQLObjectType_fields_field(field, build, context) {
59
+ const relation = context.scope.pgRelationOrWhatever;
60
+ // Do the thing if the relation has the given behavior. Simples.
61
+ if (build.behavior.pgCodecRelationMatches(relation, "behavior_to_test")) {
62
+ doTheThing();
63
+ }
64
+ ```
65
+
66
+ This code is much more to the point, much easier for plugin authors to
67
+ implement, and also a lot easier to debug since everything has a single
68
+ established behavior now (except `refs`, which aren't really an entity in
69
+ their own right, but a combination of entities...).
70
+
71
+ These changes haven't changed any of the schemas in the test suite, but they
72
+ may impact you. This could be a breaking change - so be sure to do a schema
73
+ diff before/after this.
74
+
75
+ - [#355](https://github.com/benjie/postgraphile-private/pull/355)
76
+ [`1fe47a2b0`](https://github.com/benjie/postgraphile-private/commit/1fe47a2b08d6e7153a22dde3a99b7a9bf50c4f84)
77
+ Thanks [@benjie](https://github.com/benjie)! - **MAJOR BREAKING CHANGE**:
78
+ implicit application of args/input fields has been removed.
79
+
80
+ Previously we would track the fieldArgs that you accessed (via `.get()`,
81
+ `.getRaw()` or `.apply()`) and those that you _did not access_ would
82
+ automatically have their `applyPlan` called, if they had one. This isn't
83
+ likely to be particularly useful for pure Gra*fast* users (unless they want to
84
+ adopt this pattern) but it's extremely useful for plugin-based schemas as it
85
+ allows plugins to add arguments that can influence their field's plan _without
86
+ having to wrap the field's plan resolver function_. This is fairly critical,
87
+ otherwise each behavior added (`first:`, `condition:`, `orderBy:`, `filter:`,
88
+ `ignoreArchived:`, etc etc) would wrap the plan resolver with another function
89
+ layer, and they would get _messy_.
90
+
91
+ However, implicit is rarely good. And it turns out that it severely limited
92
+ what I wanted to do for improving the `fieldArgs` APIs.
93
+
94
+ I decided to remove this implicit functionality by making it more explicit, so
95
+ now args/input fields can specify the relevant
96
+ `autoApplyAfterParent{Plan,SubscribePlan,InputPlan,ApplyPlan}: true` property
97
+ and we'll only apply them at a single level.
98
+
99
+ From a user perspective, little has changed. From a plugin author perspective,
100
+ if you were relying on the implicit `applyPlan` then you should now add the
101
+ relevant `autoApply*` property next to your `applyPlan` method.
102
+
103
+ - [#363](https://github.com/benjie/postgraphile-private/pull/363)
104
+ [`bcfffd5fe`](https://github.com/benjie/postgraphile-private/commit/bcfffd5fe14d5bbc3517c62041da585a3bf1bab1)
105
+ Thanks [@benjie](https://github.com/benjie)! - Fix bug causing `@foreignKey`
106
+ relation to not show up under rare circumstances (by updating
107
+ PgRelationsPlugin to use codec, not resource, as the primary entity).
108
+
109
+ - [#362](https://github.com/benjie/postgraphile-private/pull/362)
110
+ [`e443db39b`](https://github.com/benjie/postgraphile-private/commit/e443db39b07f9d71f7a1ce402475004e072a2d1d)
111
+ Thanks [@benjie](https://github.com/benjie)! - Use original case for table
112
+ resource names.
113
+
114
+ - Updated dependencies
115
+ [[`339fe20d0`](https://github.com/benjie/postgraphile-private/commit/339fe20d0c6e8600d263ce8093cd85a6ea8adbbf),
116
+ [`56237691b`](https://github.com/benjie/postgraphile-private/commit/56237691bf3eed321b7159e17f36e3651356946f),
117
+ [`ed1982f31`](https://github.com/benjie/postgraphile-private/commit/ed1982f31a845ceb3aafd4b48d667649f06778f5),
118
+ [`a94f11091`](https://github.com/benjie/postgraphile-private/commit/a94f11091520b52d90fd007986760848ed20017b),
119
+ [`1fe47a2b0`](https://github.com/benjie/postgraphile-private/commit/1fe47a2b08d6e7153a22dde3a99b7a9bf50c4f84),
120
+ [`198ac74d5`](https://github.com/benjie/postgraphile-private/commit/198ac74d52fe1e47d602fe2b7c52f216d5216b25),
121
+ [`6878c589c`](https://github.com/benjie/postgraphile-private/commit/6878c589cc9fc8f05a6efd377e1272ae24fbf256),
122
+ [`2ac706f18`](https://github.com/benjie/postgraphile-private/commit/2ac706f18660c855fe20f460b50694fdd04a7768),
123
+ [`77e011294`](https://github.com/benjie/postgraphile-private/commit/77e01129450ab78d55d3868661e37b0c99db3da5),
124
+ [`dad4d4aae`](https://github.com/benjie/postgraphile-private/commit/dad4d4aaee499098104841740c9049b1deb6ac5f),
125
+ [`e443db39b`](https://github.com/benjie/postgraphile-private/commit/e443db39b07f9d71f7a1ce402475004e072a2d1d)]:
126
+ - tamedevil@0.0.0-alpha.3
127
+ - pg-sql2@5.0.0-alpha.3
128
+ - grafast@0.0.1-alpha.9
129
+ - graphile-build@5.0.0-alpha.10
130
+ - graphile-config@0.0.1-alpha.4
131
+ - @dataplan/pg@0.0.1-alpha.10
132
+
133
+ ## 5.0.0-alpha.10
134
+
135
+ ### Patch Changes
136
+
137
+ - Updated dependencies
138
+ [[`dd3ef599c`](https://github.com/benjie/postgraphile-private/commit/dd3ef599c7f2530fd1a19a852d334b7349e49e70)]:
139
+ - grafast@0.0.1-alpha.8
140
+ - @dataplan/pg@0.0.1-alpha.9
141
+ - graphile-build@5.0.0-alpha.9
142
+
143
+ ## 5.0.0-alpha.9
144
+
145
+ ### Patch Changes
146
+
147
+ - [#341](https://github.com/benjie/postgraphile-private/pull/341)
148
+ [`2fcbe688c`](https://github.com/benjie/postgraphile-private/commit/2fcbe688c11b355f0688b96e99012a829cf8b7cb)
149
+ Thanks [@benjie](https://github.com/benjie)! - Ensure interfaces with zero
150
+ implementations don't cause a crash.
151
+
152
+ - Updated dependencies
153
+ [[`5c9d32264`](https://github.com/benjie/postgraphile-private/commit/5c9d322644028e33f5273fb9bcaaf6a80f1f7360),
154
+ [`2fcbe688c`](https://github.com/benjie/postgraphile-private/commit/2fcbe688c11b355f0688b96e99012a829cf8b7cb),
155
+ [`3a984718a`](https://github.com/benjie/postgraphile-private/commit/3a984718a322685304777dec7cd48a1efa15539d),
156
+ [`fe9154b23`](https://github.com/benjie/postgraphile-private/commit/fe9154b23f6e45c56ff5827dfe758bdf4974e215),
157
+ [`adc7ae5e0`](https://github.com/benjie/postgraphile-private/commit/adc7ae5e002961c8b8286500527752f21139ab9e)]:
158
+ - grafast@0.0.1-alpha.7
159
+ - @dataplan/pg@0.0.1-alpha.8
160
+ - graphile-build@5.0.0-alpha.8
161
+ - graphile-config@0.0.1-alpha.3
162
+
163
+ ## 5.0.0-alpha.8
164
+
165
+ ### Patch Changes
166
+
167
+ - [#338](https://github.com/benjie/postgraphile-private/pull/338)
168
+ [`dcc3d0355`](https://github.com/benjie/postgraphile-private/commit/dcc3d03558d28506260dcfc79e1a797b60ec1773)
169
+ Thanks [@benjie](https://github.com/benjie)! - `@interface mode:union`
170
+ interfaces now also gain root fields.
171
+
172
+ - [#338](https://github.com/benjie/postgraphile-private/pull/338)
173
+ [`ca1526b70`](https://github.com/benjie/postgraphile-private/commit/ca1526b7028b0b9d506b6ccda7da046b64af1ab6)
174
+ Thanks [@benjie](https://github.com/benjie)! - Fix startCursor/endCursor for
175
+ connections using pgUnionAll steps.
176
+
177
+ - [#338](https://github.com/benjie/postgraphile-private/pull/338)
178
+ [`3426b0f4a`](https://github.com/benjie/postgraphile-private/commit/3426b0f4adb0c5d80c66e51c203214f06f364d3a)
179
+ Thanks [@benjie](https://github.com/benjie)! - Fix bugs in pgUnionAll
180
+ connections relating to PageInfo
181
+
182
+ - Updated dependencies
183
+ [[`f75926f4b`](https://github.com/benjie/postgraphile-private/commit/f75926f4b9aee33adff8bdf6b1a4137582cb47ba),
184
+ [`ca1526b70`](https://github.com/benjie/postgraphile-private/commit/ca1526b7028b0b9d506b6ccda7da046b64af1ab6),
185
+ [`3426b0f4a`](https://github.com/benjie/postgraphile-private/commit/3426b0f4adb0c5d80c66e51c203214f06f364d3a)]:
186
+ - grafast@0.0.1-alpha.6
187
+ - @dataplan/pg@0.0.1-alpha.7
188
+ - graphile-build@5.0.0-alpha.7
189
+
190
+ ## 5.0.0-alpha.7
191
+
192
+ ### Patch Changes
193
+
194
+ - [#335](https://github.com/benjie/postgraphile-private/pull/335)
195
+ [`ef8432511`](https://github.com/benjie/postgraphile-private/commit/ef84325111416a9663417bb58ec664998040cf7c)
196
+ Thanks [@benjie](https://github.com/benjie)! - Have ref fields support
197
+ ordering and filtering.
198
+
199
+ - Updated dependencies
200
+ [[`86e503d78`](https://github.com/benjie/postgraphile-private/commit/86e503d785626ad9a2e91ec2e70b272dd632d425),
201
+ [`2850e4732`](https://github.com/benjie/postgraphile-private/commit/2850e4732ff173347357dba048eaf3c1ef775497),
202
+ [`24822d0dc`](https://github.com/benjie/postgraphile-private/commit/24822d0dc87d41f0b0737d6e00cf4022de4bab5e)]:
203
+ - grafast@0.0.1-alpha.5
204
+ - graphile-build@5.0.0-alpha.6
205
+ - @dataplan/pg@0.0.1-alpha.6
206
+
207
+ ## 5.0.0-alpha.6
208
+
209
+ ### Patch Changes
210
+
211
+ - [#334](https://github.com/benjie/postgraphile-private/pull/334)
212
+ [`1ea7acdf5`](https://github.com/benjie/postgraphile-private/commit/1ea7acdf5cbf39c876d5a7990ff456eb0803ac0b)
213
+ Thanks [@benjie](https://github.com/benjie)! - Tweak peerDependencies
214
+
215
+ - Updated dependencies
216
+ [[`1ea7acdf5`](https://github.com/benjie/postgraphile-private/commit/1ea7acdf5cbf39c876d5a7990ff456eb0803ac0b)]:
217
+ - @dataplan/pg@0.0.1-alpha.5
218
+
219
+ ## 5.0.0-alpha.5
220
+
221
+ ### Patch Changes
222
+
223
+ - Updated dependencies
224
+ [[`45dcf3a8f`](https://github.com/benjie/postgraphile-private/commit/45dcf3a8fd8bad5c8b82a7cbff2db4dacb916950),
225
+ [`f34bd5a3c`](https://github.com/benjie/postgraphile-private/commit/f34bd5a3c353693b86a0307357a3620110700e1c)]:
226
+ - grafast@0.0.1-alpha.4
227
+ - @dataplan/pg@0.0.1-alpha.4
228
+ - graphile-build@5.0.0-alpha.5
229
+
230
+ ## 5.0.0-alpha.4
231
+
232
+ ### Patch Changes
233
+
234
+ - [#332](https://github.com/benjie/postgraphile-private/pull/332)
235
+ [`faa1c9eaa`](https://github.com/benjie/postgraphile-private/commit/faa1c9eaa25cbd6f0e25635f6a100d0dc9be6106)
236
+ Thanks [@benjie](https://github.com/benjie)! - Adjust dependencies and
237
+ peerDependencies and peerDependenciesMeta.
238
+
239
+ - Updated dependencies
240
+ [[`faa1c9eaa`](https://github.com/benjie/postgraphile-private/commit/faa1c9eaa25cbd6f0e25635f6a100d0dc9be6106)]:
241
+ - graphile-build@5.0.0-alpha.4
242
+ - @dataplan/pg@0.0.1-alpha.3
243
+
244
+ ## 5.0.0-alpha.3
245
+
246
+ ### Patch Changes
247
+
248
+ - [`7f857950a`](https://github.com/benjie/postgraphile-private/commit/7f857950a7e4ec763c936eb6bd1fb77824041d71)
249
+ Thanks [@benjie](https://github.com/benjie)! - Upgrade to the latest
250
+ TypeScript/tslib
251
+
252
+ - [`9605165d5`](https://github.com/benjie/postgraphile-private/commit/9605165d5857c97053778275836b95bf19c0b1c9)
253
+ Thanks [@benjie](https://github.com/benjie)! - Fix naming conflict that occurs
254
+ with `@enum` smart tag when not using `@enumName`. New `enumTableEnum`
255
+ inflector.
256
+ - Updated dependencies
257
+ [[`21e95326d`](https://github.com/benjie/postgraphile-private/commit/21e95326d72eaad7a8860c4c21a11736191f169b),
258
+ [`87e6c65a7`](https://github.com/benjie/postgraphile-private/commit/87e6c65a7a687044895b3b6c9f131384984e7674),
259
+ [`2389f47ec`](https://github.com/benjie/postgraphile-private/commit/2389f47ecf3b708f1085fdeb818eacaaeb257a2d),
260
+ [`82cc01152`](https://github.com/benjie/postgraphile-private/commit/82cc01152ee06dafce45299661afd77ad943d785),
261
+ [`e91ee201d`](https://github.com/benjie/postgraphile-private/commit/e91ee201d80d3b32e4e632b101f4c25362a1a05b),
262
+ [`865bec590`](https://github.com/benjie/postgraphile-private/commit/865bec5901f666e147f5d4088152d1f0d2584827),
263
+ [`7f857950a`](https://github.com/benjie/postgraphile-private/commit/7f857950a7e4ec763c936eb6bd1fb77824041d71),
264
+ [`d39a5d409`](https://github.com/benjie/postgraphile-private/commit/d39a5d409ffe1a5855740ecbff1ad11ec0bf6660)]:
265
+ - graphile-export@0.0.2-alpha.2
266
+ - tamedevil@0.0.0-alpha.2
267
+ - grafast@0.0.1-alpha.3
268
+ - pg-sql2@5.0.0-alpha.2
269
+ - @dataplan/pg@0.0.1-alpha.3
270
+ - graphile-build@5.0.0-alpha.3
271
+ - graphile-config@0.0.1-alpha.2
272
+ - pg-introspection@0.0.1-alpha.2
273
+
274
+ ## 5.0.0-alpha.2
275
+
276
+ ### Patch Changes
277
+
278
+ - Updated dependencies
279
+ [[`3df3f1726`](https://github.com/benjie/postgraphile-private/commit/3df3f17269bb896cdee90ed8c4ab46fb821a1509)]:
280
+ - grafast@0.0.1-alpha.2
281
+ - @dataplan/pg@0.0.1-alpha.2
282
+ - graphile-build@5.0.0-alpha.2
283
+
3
284
  ## 5.0.0-alpha.1
4
285
 
5
286
  ### Patch Changes
package/README.md CHANGED
@@ -39,12 +39,12 @@ And please give some love to our featured sponsors 🤩:
39
39
 
40
40
  <table><tr>
41
41
  <td align="center"><a href="https://surge.io/"><img src="https://graphile.org/images/sponsors/surge.png" width="90" height="90" alt="Surge" /><br />Surge</a> *</td>
42
- <td align="center"><a href="https://www.netflix.com/"><img src="https://graphile.org/images/sponsors/Netflix.png" width="90" height="90" alt="Netflix" /><br />Netflix</a> *</td>
43
42
  <td align="center"><a href="https://www.the-guild.dev/"><img src="https://graphile.org/images/sponsors/theguild.png" width="90" height="90" alt="The Guild" /><br />The Guild</a> *</td>
43
+ <td align="center"><a href="https://dovetailapp.com/"><img src="https://graphile.org/images/sponsors/dovetail.png" width="90" height="90" alt="Dovetail" /><br />Dovetail</a> *</td>
44
44
  <td align="center"><a href="https://qwick.com/"><img src="https://graphile.org/images/sponsors/qwick.png" width="90" height="90" alt="Qwick" /><br />Qwick</a> *</td>
45
45
  </tr><tr>
46
- <td align="center"><a href="http://chads.website"><img src="https://graphile.org/images/sponsors/chadf.png" width="90" height="90" alt="Chad Furman" /><br />Chad Furman</a> *</td>
47
- <td align="center"><a href="https://dovetailapp.com/"><img src="https://graphile.org/images/sponsors/dovetail.png" width="90" height="90" alt="Dovetail" /><br />Dovetail</a> *</td>
46
+ <td align="center"><a href="https://www.netflix.com/"><img src="https://graphile.org/images/sponsors/Netflix.png" width="90" height="90" alt="Netflix" /><br />Netflix</a> *</td>
47
+ <td align="center"><a href=""><img src="https://graphile.org/images/sponsors/chadf.png" width="90" height="90" alt="Chad Furman" /><br />Chad Furman</a> *</td>
48
48
  <td align="center"><a href="https://www.enzuzo.com/"><img src="https://graphile.org/images/sponsors/enzuzo.png" width="90" height="90" alt="Enzuzo" /><br />Enzuzo</a> *</td>
49
49
  <td align="center"><a href="https://stellate.co/"><img src="https://graphile.org/images/sponsors/Stellate.png" width="90" height="90" alt="Stellate" /><br />Stellate</a> *</td>
50
50
  </tr></table>
@@ -3,9 +3,8 @@ import type { PgCodecExtensions, PgCodecRefExtensions, PgCodecRelationExtensions
3
3
  type ArrayOrDirect<T> = Array<T> | T;
4
4
  /**
5
5
  * Takes a smart tags object and extracts the 'behavior' (or 'behaviour')
6
- * property and coerces it to be a string. Returns null if no behavior was
7
- * specified (in which case the default behavior should be used).
6
+ * property and coerces it to be a string.
8
7
  */
9
- export declare function getBehavior(extensions: ArrayOrDirect<Partial<PgResourceExtensions | PgCodecRelationExtensions | PgCodecExtensions | PgCodecRefExtensions> | undefined>): string | null;
8
+ export declare function getBehavior(extensions: ArrayOrDirect<Partial<PgResourceExtensions | PgCodecRelationExtensions | PgCodecExtensions | PgCodecRefExtensions> | undefined>): string;
10
9
  export {};
11
10
  //# sourceMappingURL=behavior.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"behavior.d.ts","sourceRoot":"","sources":["../src/behavior.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,cAAc,CAAC;AAOtB,KAAK,aAAa,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAErC;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,UAAU,EAAE,aAAa,CACrB,OAAO,CACH,oBAAoB,GACpB,yBAAyB,GACzB,iBAAiB,GACjB,oBAAoB,CACvB,GACD,SAAS,CACZ,GACA,MAAM,GAAG,IAAI,CA2Cf"}
1
+ {"version":3,"file":"behavior.d.ts","sourceRoot":"","sources":["../src/behavior.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,cAAc,CAAC;AAOtB,KAAK,aAAa,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAErC;;;GAGG;AACH,wBAAgB,WAAW,CACzB,UAAU,EAAE,aAAa,CACrB,OAAO,CACH,oBAAoB,GACpB,yBAAyB,GACzB,iBAAiB,GACjB,oBAAoB,CACvB,GACD,SAAS,CACZ,GACA,MAAM,CA2CR"}
package/dist/behavior.js CHANGED
@@ -6,8 +6,7 @@ const grafast_1 = require("grafast");
6
6
  const util_1 = require("util");
7
7
  /**
8
8
  * Takes a smart tags object and extracts the 'behavior' (or 'behaviour')
9
- * property and coerces it to be a string. Returns null if no behavior was
10
- * specified (in which case the default behavior should be used).
9
+ * property and coerces it to be a string.
11
10
  */
12
11
  function getBehavior(extensions) {
13
12
  const allExtensions = Array.isArray(extensions) ? extensions : [extensions];
@@ -1 +1 @@
1
- {"version":3,"file":"behavior.js","sourceRoot":"","sources":["../src/behavior.ts"],"names":[],"mappings":";;;AAAA,2BAAyB;AAQzB,qCAAgC;AAChC,+BAA+B;AAO/B;;;;GAIG;AACH,SAAgB,WAAW,CACzB,UAQC;IAED,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAC5E,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,KAAK,MAAM,UAAU,IAAI,aAAa,EAAE;QACtC,4FAA4F;QAC5F,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;QAClC,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;QACjC,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;QAEjC,uBAAuB;QACvB,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;KACjC;IACD,OAAO,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE3B,SAAS,GAAG,CACV,WAAiE;QAEjE,MAAM,QAAQ,GACZ,OAAO,WAAW,KAAK,Q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ED
@@ -14,6 +14,7 @@ export { PgCustomTypeFieldPlugin } from "./plugins/PgCustomTypeFieldPlugin.js";
14
14
  export { PgEnumTablesPlugin } from "./plugins/PgEnumTablesPlugin.js";
15
15
  export { PgFakeConstraintsPlugin } from "./plugins/PgFakeConstraintsPlugin.js";
16
16
  export { PgFirstLastBeforeAfterArgsPlugin } from "./plugins/PgFirstLastBeforeAfterArgsPlugin.js";
17
+ export { PgInterfaceModeUnionAllRowsPlugin } from "./plugins/PgInterfaceModeUnionAllRowsPlugin.js";
17
18
  export { PgIntrospectionPlugin } from "./plugins/PgIntrospectionPlugin.js";
18
19
  export { PgJWTPlugin } from "./plugins/PgJWTPlugin.js";
19
20
  export { PgMutationCreatePlugin } from "./plugins/PgMutationCreatePlugin.js";
@@ -22,6 +23,7 @@ export { PgMutationUpdateDeletePlugin } from "./plugins/PgMutationUpdateDeletePl
22
23
  export { PgOrderAllAttributesPlugin } from "./plugins/PgOrderAllAttributesPlugin.js";
23
24
  export { PgOrderByPrimaryKeyPlugin } from "./plugins/PgOrderByPrimaryKeyPlugin.js";
24
25
  export { PgOrderCustomFieldsPlugin } from "./plugins/PgOrderCustomFieldsPlugin.js";
26
+ export { PgPolymorphismPlugin } from "./plugins/PgPolymorphismPlugin.js";
25
27
  export { PgProceduresPlugin } from "./plugins/PgProceduresPlugin.js";
26
28
  export { PgRBACPlugin } from "./plugins/PgRBACPlugin.js";
27
29
  export { PgRegistryPlugin } from "./plugins/PgRegistryPlugin.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,E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
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addBehaviorToTags = exports.defaultPreset = exports.PgTypesPlugin = exports.PgTablesPlugin = exports.PgTableNodePlugin = exports.PgRowByUniquePlugin = exports.PgRelationsPlugin = exports.PgRegistryPlugin = exports.PgRBACPlugin = exports.PgProceduresPlugin = exports.PgOrderCustomFieldsPlugin = exports.PgOrderByPrimaryKeyPlugin = exports.PgOrderAllAttributesPlugin = exports.PgMutationUpdateDeletePlugin = exports.PgMutationPayloadEdgePlugin = exports.PgMutationCreatePlugin = exports.PgJWTPlugin = exports.PgIntrospectionPlugin = exports.PgFirstLastBeforeAfterArgsPlugin = exports.PgFakeConstraintsPlugin = exports.PgEnumTablesPlugin = exports.PgCustomTypeFieldPlugin = exports.PgConnectionTotalCountPlugin = exports.PgConnectionArgOrderByPlugin = exports.PgConnectionArgOrderByDefaultValuePlugin = exports.PgConditionCustomFieldsPlugin = exports.PgConditionArgumentPlugin = exports.PgCodecsPlugin = exports.PgBasicsPlugin = exports.PgAttributesPlugin = exports.PgAttributeDeprecationPlugin = exports.PgAllRowsPlugin = exports.withPgClientFromPgService = exports.getWithPgClientFromPgService = void 0;
3
+ exports.addBehaviorToTags = exports.defaultPreset = exports.PgTypesPlugin = exports.PgTablesPlugin = exports.PgTableNodePlugin = exports.PgRowByUniquePlugin = exports.PgRelationsPlugin = exports.PgRegistryPlugin = exports.PgRBACPlugin = exports.PgProceduresPlugin = exports.PgPolymorphismPlugin = exports.PgOrderCustomFieldsPlugin = exports.PgOrderByPrimaryKeyPlugin = exports.PgOrderAllAttributesPlugin = exports.PgMutationUpdateDeletePlugin = exports.PgMutationPayloadEdgePlugin = exports.PgMutationCreatePlugin = exports.PgJWTPlugin = exports.PgIntrospectionPlugin = exports.PgInterfaceModeUnionAllRowsPlugin = exports.PgFirstLastBeforeAfterArgsPlugin = exports.PgFakeConstraintsPlugin = exports.PgEnumTablesPlugin = exports.PgCustomTypeFieldPlugin = exports.PgConnectionTotalCountPlugin = exports.PgConnectionArgOrderByPlugin = exports.PgConnectionArgOrderByDefaultValuePlugin = exports.PgConditionCustomFieldsPlugin = exports.PgConditionArgumentPlugin = exports.PgCodecsPlugin = exports.PgBasicsPlugin = exports.PgAttributesPlugin = exports.PgAttributeDeprecationPlugin = exports.PgAllRowsPlugin = exports.withPgClientFromPgService = exports.getWithPgClientFromPgService = void 0;
4
4
  var pgServices_js_1 = require("./pgServices.js");
5
5
  Object.defineProperty(exports, "getWithPgClientFromPgService", { enumerable: true, get: function () { return pgServices_js_1.getWithPgClientFromPgService; } });
6
6
  Object.defineProperty(exports, "withPgClientFromPgService", { enumerable: true, get: function () { return pgServices_js_1.withPgClientFromPgService; } });
@@ -32,6 +32,8 @@ var PgFakeConstraintsPlugin_js_1 = require("./plugins/PgFakeConstraintsPlugin.js
32
32
  Object.defineProperty(exports, "PgFakeConstraintsPlugin", { enumerable: true, get: function () { return PgFakeConstraintsPlugin_js_1.PgFakeConstraintsPlugin; } });
33
33
  var PgFirstLastBeforeAfterArgsPlugin_js_1 = require("./plugins/PgFirstLastBeforeAfterArgsPlugin.js");
34
34
  Object.defineProperty(exports, "PgFirstLastBeforeAfterArgsPlugin", { enumerable: true, get: function () { return PgFirstLastBeforeAfterArgsPlugin_js_1.PgFirstLastBeforeAfterArgsPlugin; } });
35
+ var PgInterfaceModeUnionAllRowsPlugin_js_1 = require("./plugins/PgInterfaceModeUnionAllRowsPlugin.js");
36
+ Object.defineProperty(exports, "PgInterfaceModeUnionAllRowsPlugin", { enumerable: true, get: function () { return PgInterfaceModeUnionAllRowsPlugin_js_1.PgInterfaceModeUnionAllRowsPlugin; } });
35
37
  var PgIntrospectionPlugin_js_1 = require("./plugins/PgIntrospectionPlugin.js");
36
38
  Object.defineProperty(exports, "PgIntrospectionPlugin", { enumerable: true, get: function () { return PgIntrospectionPlugin_js_1.PgIntrospectionPlugin; } });
37
39
  var PgJWTPlugin_js_1 = require("./plugins/PgJWTPlugin.js");
@@ -48,6 +50,8 @@ var PgOrderByPrimaryKeyPlugin_js_1 = require("./plugins/PgOrderByPrimaryKeyPlugi
48
50
  Object.defineProperty(exports, "PgOrderByPrimaryKeyPlugin", { enumerable: true, get: function () { return PgOrderByPrimaryKeyPlugin_js_1.PgOrderByPrimaryKeyPlugin; } });
49
51
  var PgOrderCustomFieldsPlugin_js_1 = require("./plugins/PgOrderCustomFieldsPlugin.js");
50
52
  Object.defineProperty(exports, "PgOrderCustomFieldsPlugin", { enumerable: true, get: function () { return PgOrderCustomFieldsPlugin_js_1.PgOrderCustomFieldsPlugin; } });
53
+ var PgPolymorphismPlugin_js_1 = require("./plugins/PgPolymorphismPlugin.js");
54
+ Object.defineProperty(exports, "PgPolymorphismPlugin", { enumerable: true, get: function () { return PgPolymorphismPlugin_js_1.PgPolymorphismPlugin; } });
51
55
  var PgProceduresPlugin_js_1 = require("./plugins/PgProceduresPlugin.js");
52
56
  Object.defineProperty(exports, "PgProceduresPlugin", { enumerable: true, get: function () { return PgProceduresPlugin_js_1.PgProceduresPlugin; } });
53
57
  var PgRBACPlugin_js_1 = require("./plugins/PgRBACPlugin.js");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAOA,iDAGyB;AAFvB,6HAAA,4BAA4B,OAAA;AAC5B,0HAAA,yBAAyB,OAAA;AAE3B,mEAA+D;AAAtD,qHAAA,eAAe,OAAA;AACxB,6FAAyF;AAAhF,+IAAA,4BAA4B,OAAA;AACrC,yEAAqE;AAA5D,2HAAA,kBAAkB,OAAA;AAC3B,iEAA6D;AAApD,mHAAA,cAAc,OAAA;AACvB,iEAA6D;AAApD,mHAAA,cAAc,OAAA;AACvB,uFAAmF;AAA1E,yIAAA,yBAAyB,OAAA;AAClC,+FAA2F;AAAlF,iJAAA,6BAA6B,OAAA;AACtC,qHAAiH;AAAxG,uKAAA,wCAAwC,OAAA;AACjD,6FAAyF;AAAhF,+IAAA,4BAA4B,OA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AAA;AACvB,+DAA2D;AAAlD,iHAAA,aAAa,OAAA;AACtB,yCAA4C;AAAnC,0GAAA,aAAa,OAAA;AACtB,uCAA+C;AAAtC,6GAAA,iBAAiB,OAAA"}
@@ -1,4 +1,3 @@
1
- import "graphile-build";
2
1
  import "./PgTablesPlugin.js";
3
2
  import "graphile-config";
4
3
  import type { PgResource } from "@dataplan/pg";
@@ -1 +1 @@
1
- {"version":3,"file":"PgAllRowsPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/PgAllRowsPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AACxB,OAAO,qBAAqB,CAAC;AAC7B,OAAO,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAS/C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,aAAa,CAAC;QACtB,UAAU,UAAU;YAClB;;;eAGG;YACH,iBAAiB,CACf,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAC5C,MAAM,CAAC;YAEV;;;eAGG;YACH,WAAW,CACT,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAC5C,MAAM,CAAC;SACX;KACF;CACF;AAED,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,MAqJ5C,CAAC"}
1
+ {"version":3,"file":"PgAllRowsPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/PgAllRowsPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAQ/C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,aAAa,CAAC;QACtB,UAAU,UAAU;YAClB;;;eAGG;YACH,iBAAiB,CACf,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAC5C,MAAM,CAAC;YAEV;;;eAGG;YACH,WAAW,CACT,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAC5C,MAAM,CAAC;SACX;KACF;CACF;AAED,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,MA0I5C,CAAC"}
@@ -1,12 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PgAllRowsPlugin = void 0;
4
- require("graphile-build");
5
4
  require("./PgTablesPlugin.js");
6
5
  require("graphile-config");
7
6
  const grafast_1 = require("grafast");
8
- const graphile_export_1 = require("graphile-export");
9
- const behavior_js_1 = require("../behavior.js");
7
+ const graphile_build_1 = require("graphile-build");
10
8
  const utils_js_1 = require("../utils.js");
11
9
  const version_js_1 = require("../version.js");
12
10
  exports.PgAllRowsPlugin = {
@@ -44,12 +42,7 @@ exports.PgAllRowsPlugin = {
44
42
  if (!type) {
45
43
  continue;
46
44
  }
47
- const behavior = (0, behavior_js_1.getBehavior)([
48
- resource.codec.extensions,
49
- resource.extensions,
50
- ]);
51
- const defaultBehavior = "connection -list";
52
- if (build.behavior.matches(behavior, "query:resource:list", defaultBehavior)) {
45
+ if (build.behavior.pgResourceMatches(resource, "query:resource:list")) {
53
46
  const fieldName = build.inflection.allRowsList(resource);
54
47
  fields = build.extend(fields, {
55
48
  [fieldName]: fieldWithHooks({
@@ -61,13 +54,13 @@ exports.PgAllRowsPlugin = {
61
54
  type: new GraphQLList(new GraphQLNonNull(type)),
62
55
  description: `Reads a set of \`${build.inflection.tableType(resource.codec)}\`.`,
63
56
  deprecationReason: (0, utils_js_1.tagToString)(resource.extensions?.tags?.deprecated),
64
- plan: (0, graphile_export_1.EXPORTABLE)((resource) => function plan() {
57
+ plan: (0, graphile_build_1.EXPORTABLE)((resource) => function plan() {
65
58
  return resource.find();
66
59
  }, [resource]),
67
60
  })),
68
61
  }, `Adding 'all rows' list field for PgResource ${resource}`);
69
62
  }
70
- if (build.behavior.matches(behavior, "query:resource:connection", defaultBehavior)) {
63
+ if (build.behavior.pgResourceMatches(resource, "query:resource:connection")) {
71
64
  const fieldName = build.inflection.allRowsConnection(resource);
72
65
  const connectionType = build.getTypeByName(build.inflection.tableConnectionType(resource.codec));
73
66
  if (connectionType) {
@@ -81,7 +74,7 @@ exports.PgAllRowsPlugin = {
81
74
  type: connectionType,
82
75
  description: `Reads and enables pagination through a set of \`${build.inflection.tableType(resource.codec)}\`.`,
83
76
  deprecationReason: (0, utils_js_1.tagToString)(resource.extensions?.tags?.deprecated),
84
- plan: (0, graphile_export_1.EXPORTABLE)((connection, resource) => function plan() {
77
+ plan: (0, graphile_build_1.EXPORTABLE)((connection, resource) => function plan() {
85
78
  return connection(resource.find());
86
79
  }, [grafast_1.connection, resource]),
87
80
  })),
@@ -1 +1 @@
1
- {"version":3,"file":"PgAllRowsPlugin.js","sourceRoot":"","sources":["../../src/plugins/PgAllRowsPlugin.ts"],"names":[],"mappings":";;;AAAA,0BAAwB;AACxB,+BAA6B;AAC7B,2BAAyB;AAGzB,qCAAqC;AACrC,qDAA6C;AAG7C,gDAA6C;AAC7C,0CAA0C;AAC1C,8CAAwC;AA0B3B,QAAA,eAAe,GAA0B;IACpD,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,2DAA2D;IACxE,OAAO,EAAE,oBAAO;IAChB,KAAK,EAAE,CAAC,gBAAgB,CAAC;IAEzB,UAAU,EAAE;QACV,GAAG,EAAE;YACH,iBAAiB,CAAC,OAAO,EAAE,QAAQ;gBACjC,OAAO,IAAI,CAAC,eAAe,CACzB,IAAI,CAAC,SAAS,CACZ,OAAO,IAAI,CAAC,SAAS,CAAC,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,EACD,GAAG,EAAE,CAAC,CAAC;oCACL,IAAI,EAAE,cAAc;oCACpB,WAAW,EAAE,mDAAmD,KAAK,CAAC,UAAU,CAAC,SAAS,CACxF,QAAQ,CAAC,KAAK,CACf,KAAK;oCACN,iBAAiB,EAAE,IAAA,sBAAW,EAC5B,QAAQ,CAAC,UAAU,EAAE,IAAI,EAAE,UAAU,CACtC;oCACD,IAAI,EAAE,IAAA,2BAAU,EACd,CAAC,UAAU,EAAE,QAAQ,EAAE,EAAE,CACvB,SAAS,IAAI;wCACX,OAAO,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;oCACrC,CAAC,EACH,CAAC,oBAAU,EAAE,QAAQ,CAAC,CACvB;iCACF,CAAC,CACH;6BACF,EACD,qDAAqD,QAAQ,EAAE,CAChE,CAAC;yBACH;qBACF;iBACF;gBACD,OAAO,MAAM,CAAC;YAChB,CAAC;SACF;KACF;CACF,CAAC"}
@@ -1,4 +1,3 @@
1
- import "graphile-build";
2
1
  import "./PgTablesPlugin.js";
3
2
  import "../interfaces.js";
4
3
  import "graphile-config";
@@ -1 +1 @@
1
- {"version":3,"file":"PgAttributesPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/PgAttributesPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AACxB,OAAO,qBAAqB,CAAC;AAC7B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAGV,gBAAgB,EAGhB,qBAAqB,EAGtB,MAAM,cAAc,CAAC;AAatB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,aAAa,CAAC;QACtB,UAAU,UAAU;YAClB;;;;;;;eAOG;YACH,cAAc,CACZ,IAAI,EAAE,aAAa,CAAC,UAAU,EAC9B,OAAO,EAAE;gBACP,KAAK,EAAE,qBAAqB,CAAC;gBAC7B,aAAa,EAAE,MAAM,CAAC;gBACtB,SAAS,CAAC,EAAE,OAAO,CAAC;aACr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AAE,aAAa,CAAC,UAAU,EAC9B,KAAK,EAAE,qBAAqB,EAC5B,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,MAAM,CAAC;YAEV;;;;eAIG;YACH,SAAS,CACP,IAAI,EAAE,aAAa,CAAC,UAAU,EAC9B,OAAO,EAAE;gBACP,aAAa,EAAE,MAAM,CAAC;gBACtB,KAAK,EAAE,qBAAqB,CAAC;aAC9B,GACA,MAAM,CAAC;SACX;QAED,UAAU,gBAAgB;YACxB,WAAW,CAAC,EAAE,OAAO,CAAC;YACtB,SAAS,CAAC,EAAE,OAAO,CAAC;YACpB,aAAa,CAAC,EAAE,OAAO,CAAC;YACxB,WAAW,CAAC,EAAE,OAAO,CAAC;YACtB,gBAAgB,CAAC,EAAE,OAAO,CAAC;YAC3B,WAAW,CAAC,EAAE,gBAAgB,CAAC;SAChC;KACF;CACF;AAuOD,eAAO,MAAM,kBAAkB,EAAE,cAAc,CAAC,MAsO/C,CAAC"}
@@ -1,13 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PgAttributesPlugin = void 0;
4
- require("graphile-build");
5
4
  require("./PgTablesPlugin.js");
6
5
  require("../interfaces.js");
7
6
  require("graphile-config");
8
7
  const pg_1 = require("@dataplan/pg");
9
- const graphile_export_1 = require("graphile-export");
10
- const behavior_js_1 = require("../behavior.js");
8
+ const graphile_build_1 = require("graphile-build");
11
9
  const version_js_1 = require("../version.js");
12
10
  function unwrapCodec(codec) {
13
11
  if (codec.arrayOfCodec) {
@@ -16,7 +14,7 @@ function unwrapCodec(codec) {
16
14
  return codec;
17
15
  }
18
16
  // TODO: get rid of this! Determine the resources at build time
19
- const getResource = (0, graphile_export_1.EXPORTABLE)((PgResource) => (registry, baseCodec, pgResources, $record) => {
17
+ const getResource = (0, graphile_build_1.EXPORTABLE)((PgResource) => (registry, baseCodec, pgResources, $record) => {
20
18
  const executor = $record.resource.executor;
21
19
  const resource = pgResources.find((potentialSource) =>
22
20
  // These have already been filtered by codec
@@ -37,8 +35,7 @@ function processAttribute(fields, build, context, attributeName, overrideName) {
37
35
  const pgCodec = rawPgCodec;
38
36
  const isInterface = context.type === "GraphQLInterfaceType";
39
37
  const attribute = pgCodec.attributes[attributeName];
40
- const behavior = (0, behavior_js_1.getBehavior)([pgCodec.extensions, attribute.extensions]);
41
- if (!build.behavior.matches(behavior, "attribute:select", "select")) {
38
+ if (!build.behavior.pgCodecAttributeMatches([pgCodec, attribute], "attribute:select")) {
42
39
  // Don't allow selecting this attribute.
43
40
  return;
44
41
  }
@@ -74,7 +71,7 @@ function processAttribute(fields, build, context, attributeName, overrideName) {
74
71
  // See if there's a resource to pull record types from (e.g. for relations/etc)
75
72
  if (!baseCodec.attributes) {
76
73
  // Simply get the value
77
- return (0, graphile_export_1.EXPORTABLE)((attributeName) => ($record) => {
74
+ return (0, graphile_build_1.EXPORTABLE)((attributeName) => ($record) => {
78
75
  return $record.get(attributeName);
79
76
  }, [attributeName]);
80
77
  }
@@ -90,7 +87,7 @@ function processAttribute(fields, build, context, attributeName, overrideName) {
90
87
  * the base table using e.g. `(table.column).attribute =
91
88
  * joined_thing.column`
92
89
  */
93
- return (0, graphile_export_1.EXPORTABLE)((attributeName, baseCodec, getResource, notNull, pgResources, pgSelectSingleFromRecord, registry) => ($record) => {
90
+ return (0, graphile_build_1.EXPORTABLE)((attributeName, baseCodec, getResource, notNull, pgResources, pgSelectSingleFromRecord, registry) => ($record) => {
94
91
  const $plan = $record.get(attributeName);
95
92
  const $select = pgSelectSingleFromRecord(getResource(registry, baseCodec, pgResources, $record), $plan);
96
93
  if (notNull) {
@@ -116,7 +113,7 @@ function processAttribute(fields, build, context, attributeName, overrideName) {
116
113
  * the base table using e.g. `(table.column).attribute =
117
114
  * joined_thing.column`
118
115
  */
119
- return (0, graphile_export_1.EXPORTABLE)((attributeName, baseCodec, getResource, pgResources, pgSelectFromRecords, registry) => ($record) => {
116
+ return (0, graphile_build_1.EXPORTABLE)((attributeName, baseCodec, getResource, pgResources, pgSelectFromRecords, registry) => ($record) => {
120
117
  const $val = $record.get(attributeName);
121
118
  const $select = pgSelectFromRecords(getResource(registry, baseCodec, pgResources, $record), $val);
122
119
  $select.setTrusted();
@@ -169,6 +166,9 @@ exports.PgAttributesPlugin = {
169
166
  },
170
167
  },
171
168
  schema: {
169
+ entityBehavior: {
170
+ pgCodecAttribute: "select base update insert",
171
+ },
172
172
  hooks: {
173
173
  GraphQLInterfaceType_fields(fields, build, context) {
174
174
  const { scope: { pgCodec, pgPolymorphism }, } = context;
@@ -245,17 +245,13 @@ exports.PgAttributesPlugin = {
245
245
  }
246
246
  const pgCodec = rawPgCodec;
247
247
  return Object.entries(pgCodec.attributes).reduce((memo, [attributeName, attribute]) => build.recoverable(memo, () => {
248
- const behavior = (0, behavior_js_1.getBehavior)([
249
- pgCodec.extensions,
250
- attribute.extensions,
251
- ]);
252
248
  const action = isPgBaseInput
253
249
  ? "base"
254
250
  : isPgPatch
255
251
  ? "update"
256
252
  : "insert";
257
253
  const fieldBehaviorScope = `attribute:${action}`;
258
- if (!build.behavior.matches(behavior, fieldBehaviorScope, action)) {
254
+ if (!build.behavior.pgCodecAttributeMatches([pgCodec, attribute], fieldBehaviorScope)) {
259
255
  return memo;
260
256
  }
261
257
  const fieldName = inflection.attribute({
@@ -283,7 +279,9 @@ exports.PgAttributesPlugin = {
283
279
  !attribute.extensions?.tags?.notNull) ||
284
280
  attribute.hasDefault ||
285
281
  Boolean(attribute.extensions?.tags?.hasDefault), attributeType),
286
- applyPlan: (0, graphile_export_1.EXPORTABLE)((attributeName) => function plan($insert, val) {
282
+ autoApplyAfterParentInputPlan: true,
283
+ autoApplyAfterParentApplyPlan: true,
284
+ applyPlan: (0, graphile_build_1.EXPORTABLE)((attributeName) => function plan($insert, val) {
287
285
  $insert.set(attributeName, val.get());
288
286
  }, [attributeName]),
289
287
  }),