graphile-build-pg 5.0.0-alpha.10 → 5.0.0-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +236 -0
- package/README.md +1 -3
- package/dist/behavior.d.ts +2 -3
- package/dist/behavior.d.ts.map +1 -1
- package/dist/behavior.js +1 -2
- package/dist/behavior.js.map +1 -1
- package/dist/pgServices.d.ts +4 -0
- package/dist/pgServices.d.ts.map +1 -1
- package/dist/pgServices.js +16 -6
- package/dist/pgServices.js.map +1 -1
- package/dist/plugins/PgAllRowsPlugin.d.ts.map +1 -1
- package/dist/plugins/PgAllRowsPlugin.js +2 -8
- package/dist/plugins/PgAllRowsPlugin.js.map +1 -1
- package/dist/plugins/PgAttributesPlugin.d.ts.map +1 -1
- package/dist/plugins/PgAttributesPlugin.js +71 -65
- package/dist/plugins/PgAttributesPlugin.js.map +1 -1
- package/dist/plugins/PgBasicsPlugin.d.ts +18 -1
- package/dist/plugins/PgBasicsPlugin.d.ts.map +1 -1
- package/dist/plugins/PgBasicsPlugin.js +79 -0
- package/dist/plugins/PgBasicsPlugin.js.map +1 -1
- package/dist/plugins/PgCodecsPlugin.d.ts.map +1 -1
- package/dist/plugins/PgCodecsPlugin.js +12 -8
- package/dist/plugins/PgCodecsPlugin.js.map +1 -1
- package/dist/plugins/PgConditionArgumentPlugin.d.ts.map +1 -1
- package/dist/plugins/PgConditionArgumentPlugin.js +25 -15
- package/dist/plugins/PgConditionArgumentPlugin.js.map +1 -1
- package/dist/plugins/PgConditionCustomFieldsPlugin.d.ts +6 -0
- package/dist/plugins/PgConditionCustomFieldsPlugin.d.ts.map +1 -1
- package/dist/plugins/PgConditionCustomFieldsPlugin.js +43 -20
- package/dist/plugins/PgConditionCustomFieldsPlugin.js.map +1 -1
- package/dist/plugins/PgConnectionArgOrderByPlugin.d.ts.map +1 -1
- package/dist/plugins/PgConnectionArgOrderByPlugin.js +22 -9
- package/dist/plugins/PgConnectionArgOrderByPlugin.js.map +1 -1
- package/dist/plugins/PgConnectionTotalCountPlugin.d.ts.map +1 -1
- package/dist/plugins/PgConnectionTotalCountPlugin.js +4 -3
- package/dist/plugins/PgConnectionTotalCountPlugin.js.map +1 -1
- package/dist/plugins/PgCustomTypeFieldPlugin.d.ts.map +1 -1
- package/dist/plugins/PgCustomTypeFieldPlugin.js +28 -30
- package/dist/plugins/PgCustomTypeFieldPlugin.js.map +1 -1
- package/dist/plugins/PgFirstLastBeforeAfterArgsPlugin.js +5 -0
- package/dist/plugins/PgFirstLastBeforeAfterArgsPlugin.js.map +1 -1
- package/dist/plugins/PgInterfaceModeUnionAllRowsPlugin.d.ts.map +1 -1
- package/dist/plugins/PgInterfaceModeUnionAllRowsPlugin.js +21 -6
- package/dist/plugins/PgInterfaceModeUnionAllRowsPlugin.js.map +1 -1
- package/dist/plugins/PgIntrospectionPlugin.d.ts +1 -0
- package/dist/plugins/PgIntrospectionPlugin.d.ts.map +1 -1
- package/dist/plugins/PgIntrospectionPlugin.js +6 -0
- package/dist/plugins/PgIntrospectionPlugin.js.map +1 -1
- package/dist/plugins/PgJWTPlugin.d.ts.map +1 -1
- package/dist/plugins/PgJWTPlugin.js +3 -6
- package/dist/plugins/PgJWTPlugin.js.map +1 -1
- package/dist/plugins/PgMutationCreatePlugin.d.ts.map +1 -1
- package/dist/plugins/PgMutationCreatePlugin.js +24 -12
- package/dist/plugins/PgMutationCreatePlugin.js.map +1 -1
- package/dist/plugins/PgMutationPayloadEdgePlugin.d.ts.map +1 -1
- package/dist/plugins/PgMutationPayloadEdgePlugin.js +8 -11
- package/dist/plugins/PgMutationPayloadEdgePlugin.js.map +1 -1
- package/dist/plugins/PgMutationUpdateDeletePlugin.d.ts.map +1 -1
- package/dist/plugins/PgMutationUpdateDeletePlugin.js +10 -24
- package/dist/plugins/PgMutationUpdateDeletePlugin.js.map +1 -1
- package/dist/plugins/PgOrderAllAttributesPlugin.d.ts.map +1 -1
- package/dist/plugins/PgOrderAllAttributesPlugin.js +7 -10
- package/dist/plugins/PgOrderAllAttributesPlugin.js.map +1 -1
- package/dist/plugins/PgOrderCustomFieldsPlugin.d.ts.map +1 -1
- package/dist/plugins/PgOrderCustomFieldsPlugin.js +19 -19
- package/dist/plugins/PgOrderCustomFieldsPlugin.js.map +1 -1
- package/dist/plugins/PgPolymorphismPlugin.d.ts.map +1 -1
- package/dist/plugins/PgPolymorphismPlugin.js +24 -19
- package/dist/plugins/PgPolymorphismPlugin.js.map +1 -1
- package/dist/plugins/PgProceduresPlugin.d.ts +1 -1
- package/dist/plugins/PgProceduresPlugin.d.ts.map +1 -1
- package/dist/plugins/PgProceduresPlugin.js +5 -4
- package/dist/plugins/PgProceduresPlugin.js.map +1 -1
- package/dist/plugins/PgRefsPlugin.js +1 -1
- package/dist/plugins/PgRefsPlugin.js.map +1 -1
- package/dist/plugins/PgRelationsPlugin.d.ts +0 -1
- package/dist/plugins/PgRelationsPlugin.d.ts.map +1 -1
- package/dist/plugins/PgRelationsPlugin.js +112 -87
- package/dist/plugins/PgRelationsPlugin.js.map +1 -1
- package/dist/plugins/PgRowByUniquePlugin.d.ts.map +1 -1
- package/dist/plugins/PgRowByUniquePlugin.js +4 -7
- package/dist/plugins/PgRowByUniquePlugin.js.map +1 -1
- package/dist/plugins/PgTableNodePlugin.d.ts.map +1 -1
- package/dist/plugins/PgTableNodePlugin.js +25 -18
- package/dist/plugins/PgTableNodePlugin.js.map +1 -1
- package/dist/plugins/PgTablesPlugin.d.ts.map +1 -1
- package/dist/plugins/PgTablesPlugin.js +25 -22
- package/dist/plugins/PgTablesPlugin.js.map +1 -1
- package/dist/plugins/PgTypesPlugin.d.ts.map +1 -1
- package/dist/plugins/PgTypesPlugin.js +4 -3
- package/dist/plugins/PgTypesPlugin.js.map +1 -1
- package/dist/utils.d.ts +15 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +32 -1
- package/dist/utils.js.map +1 -1
- package/package.json +12 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,241 @@
|
|
|
1
1
|
# graphile-build-pg
|
|
2
2
|
|
|
3
|
+
## 5.0.0-alpha.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#399](https://github.com/benjie/postgraphile-private/pull/399)
|
|
8
|
+
[`409581534`](https://github.com/benjie/postgraphile-private/commit/409581534f41ac2cf0ff21c77c2bcd8eaa8218fd)
|
|
9
|
+
Thanks [@benjie](https://github.com/benjie)! - Change many of the dependencies
|
|
10
|
+
to be instead (or also) peerDependencies, to avoid duplicate modules.
|
|
11
|
+
|
|
12
|
+
- [#396](https://github.com/benjie/postgraphile-private/pull/396)
|
|
13
|
+
[`17fe531d7`](https://github.com/benjie/postgraphile-private/commit/17fe531d729e88a7126b0e2e06fc1ee9ab3ac5b8)
|
|
14
|
+
Thanks [@benjie](https://github.com/benjie)! - pgUnionAll uses a slightly more
|
|
15
|
+
optimal SQL (where JSON isn't cast to `::text` and then back to `::json`)
|
|
16
|
+
|
|
17
|
+
- [#376](https://github.com/benjie/postgraphile-private/pull/376)
|
|
18
|
+
[`326aa99cd`](https://github.com/benjie/postgraphile-private/commit/326aa99cd5e6b5cc8f30e4500382738eb63b792d)
|
|
19
|
+
Thanks [@benjie](https://github.com/benjie)! - Can now give constraints
|
|
20
|
+
separate forward/backward behaviors
|
|
21
|
+
|
|
22
|
+
- [#400](https://github.com/benjie/postgraphile-private/pull/400)
|
|
23
|
+
[`9238d3ce4`](https://github.com/benjie/postgraphile-private/commit/9238d3ce4f6f59295ba849d6325286e4847c1bac)
|
|
24
|
+
Thanks [@benjie](https://github.com/benjie)! - Use `file://` URLs in import()
|
|
25
|
+
to fix compatibility with Windows (e.g. when loading `graphile.config.mjs`).
|
|
26
|
+
|
|
27
|
+
- [#396](https://github.com/benjie/postgraphile-private/pull/396)
|
|
28
|
+
[`b5eb7c490`](https://github.com/benjie/postgraphile-private/commit/b5eb7c490305b869e1bfc176a5a417e28f1411cd)
|
|
29
|
+
Thanks [@benjie](https://github.com/benjie)! - Cursor pagination over nullable
|
|
30
|
+
columns _should_ now work, although it is untested.
|
|
31
|
+
|
|
32
|
+
- [#399](https://github.com/benjie/postgraphile-private/pull/399)
|
|
33
|
+
[`976958e80`](https://github.com/benjie/postgraphile-private/commit/976958e80c791819cd80e96df8209dcff1918585)
|
|
34
|
+
Thanks [@benjie](https://github.com/benjie)! - Plugins can now use
|
|
35
|
+
build.grafast rather than adding grafast as a peerDependency.
|
|
36
|
+
|
|
37
|
+
- [#396](https://github.com/benjie/postgraphile-private/pull/396)
|
|
38
|
+
[`7573bf374`](https://github.com/benjie/postgraphile-private/commit/7573bf374897228b613b19f37b4e076737db3279)
|
|
39
|
+
Thanks [@benjie](https://github.com/benjie)! - Address a decent number of
|
|
40
|
+
TODO/FIXME/etc comments in the codebase.
|
|
41
|
+
|
|
42
|
+
- [#378](https://github.com/benjie/postgraphile-private/pull/378)
|
|
43
|
+
[`95b2ab41e`](https://github.com/benjie/postgraphile-private/commit/95b2ab41e41976de852276b83f7fb5924555e7c5)
|
|
44
|
+
Thanks [@benjie](https://github.com/benjie)! - Support for nested arrays via
|
|
45
|
+
PostgreSQL domains.
|
|
46
|
+
|
|
47
|
+
- [#383](https://github.com/benjie/postgraphile-private/pull/383)
|
|
48
|
+
[`2c8586b36`](https://github.com/benjie/postgraphile-private/commit/2c8586b367b76af91d1785cc90455c70911fdec7)
|
|
49
|
+
Thanks [@benjie](https://github.com/benjie)! - Change
|
|
50
|
+
'objectType.extensions.grafast.Step' to
|
|
51
|
+
'objectType.extensions.grafast.assertStep', accept it via object spec,
|
|
52
|
+
deprecate registerObjectType form that accepts it (pass via object spec
|
|
53
|
+
instead), improve typings around it.
|
|
54
|
+
|
|
55
|
+
- [#378](https://github.com/benjie/postgraphile-private/pull/378)
|
|
56
|
+
[`6f545683c`](https://github.com/benjie/postgraphile-private/commit/6f545683c981af4ee40d51b272a053b01d535491)
|
|
57
|
+
Thanks [@benjie](https://github.com/benjie)! - Fix bug handling domains over
|
|
58
|
+
composite types.
|
|
59
|
+
|
|
60
|
+
- [#396](https://github.com/benjie/postgraphile-private/pull/396)
|
|
61
|
+
[`b66d2503b`](https://github.com/benjie/postgraphile-private/commit/b66d2503b90eb458af709bb593e5a00d869df03f)
|
|
62
|
+
Thanks [@benjie](https://github.com/benjie)! - hasNextPage (via hasMore) now
|
|
63
|
+
uses an access plan rather than a lambda plan.
|
|
64
|
+
|
|
65
|
+
- [#401](https://github.com/benjie/postgraphile-private/pull/401)
|
|
66
|
+
[`b868aa63f`](https://github.com/benjie/postgraphile-private/commit/b868aa63f7759396b71fdd1e8eda1012352ad595)
|
|
67
|
+
Thanks [@benjie](https://github.com/benjie)! - Added `Build.dataplanPg` so
|
|
68
|
+
plugins don't need to import this module.
|
|
69
|
+
|
|
70
|
+
- [#396](https://github.com/benjie/postgraphile-private/pull/396)
|
|
71
|
+
[`3caaced6c`](https://github.com/benjie/postgraphile-private/commit/3caaced6cfbac4a187a245a61eb103edcb8cd4c9)
|
|
72
|
+
Thanks [@benjie](https://github.com/benjie)! - When fetching a single row, an
|
|
73
|
+
`ORDER BY` clause will no longer be added.
|
|
74
|
+
|
|
75
|
+
- [#396](https://github.com/benjie/postgraphile-private/pull/396)
|
|
76
|
+
[`9f2507ed9`](https://github.com/benjie/postgraphile-private/commit/9f2507ed9fe8a6abe93c9c8a1cff410446587fd6)
|
|
77
|
+
Thanks [@benjie](https://github.com/benjie)! - Codecs can now (optionally)
|
|
78
|
+
have executors associated (typically useful for record codecs); so we've
|
|
79
|
+
eradicated runtime resource definition for columns that use composite types
|
|
80
|
+
(or lists thereof) - all composite types accessible from attributes are now
|
|
81
|
+
guaranteed to have a table-like resource generated in the registry.
|
|
82
|
+
- Updated dependencies
|
|
83
|
+
[[`659508371`](https://github.com/benjie/postgraphile-private/commit/659508371e79e76b581532978fe26d50a54e6248),
|
|
84
|
+
[`409581534`](https://github.com/benjie/postgraphile-private/commit/409581534f41ac2cf0ff21c77c2bcd8eaa8218fd),
|
|
85
|
+
[`4d64ac127`](https://github.com/benjie/postgraphile-private/commit/4d64ac12799be55680448aab6906312bcbc525ab),
|
|
86
|
+
[`17fe531d7`](https://github.com/benjie/postgraphile-private/commit/17fe531d729e88a7126b0e2e06fc1ee9ab3ac5b8),
|
|
87
|
+
[`b7533bd4d`](https://github.com/benjie/postgraphile-private/commit/b7533bd4dfc210cb8b113b8fa06f163a212aa5e4),
|
|
88
|
+
[`56b52295c`](https://github.com/benjie/postgraphile-private/commit/56b52295c77d1748c01754d5e71702e05c8a2dd3),
|
|
89
|
+
[`9feb769c2`](https://github.com/benjie/postgraphile-private/commit/9feb769c2df0c57971ed26a937be4a1bee7a7524),
|
|
90
|
+
[`b5eb7c490`](https://github.com/benjie/postgraphile-private/commit/b5eb7c490305b869e1bfc176a5a417e28f1411cd),
|
|
91
|
+
[`976958e80`](https://github.com/benjie/postgraphile-private/commit/976958e80c791819cd80e96df8209dcff1918585),
|
|
92
|
+
[`7573bf374`](https://github.com/benjie/postgraphile-private/commit/7573bf374897228b613b19f37b4e076737db3279),
|
|
93
|
+
[`95b2ab41e`](https://github.com/benjie/postgraphile-private/commit/95b2ab41e41976de852276b83f7fb5924555e7c5),
|
|
94
|
+
[`2c8586b36`](https://github.com/benjie/postgraphile-private/commit/2c8586b367b76af91d1785cc90455c70911fdec7),
|
|
95
|
+
[`8230fcaeb`](https://github.com/benjie/postgraphile-private/commit/8230fcaeb0286c905fc0dad4b7af2d94bac88a44),
|
|
96
|
+
[`c43802d74`](https://github.com/benjie/postgraphile-private/commit/c43802d7419f93d18964c654f16d0937a2e23ca0),
|
|
97
|
+
[`b118b8f6d`](https://github.com/benjie/postgraphile-private/commit/b118b8f6dc18196212cfb0a05486e1dd8d77ccf8),
|
|
98
|
+
[`b66d2503b`](https://github.com/benjie/postgraphile-private/commit/b66d2503b90eb458af709bb593e5a00d869df03f),
|
|
99
|
+
[`9008c4f87`](https://github.com/benjie/postgraphile-private/commit/9008c4f87df53be4051c49f9836358dc2baa59df),
|
|
100
|
+
[`47ff7e824`](https://github.com/benjie/postgraphile-private/commit/47ff7e824b2fc96c11f601c3814d0200208711ce),
|
|
101
|
+
[`e8c81cd20`](https://github.com/benjie/postgraphile-private/commit/e8c81cd2046390ed5b6799aa7ff3d90b28a1861a),
|
|
102
|
+
[`3caaced6c`](https://github.com/benjie/postgraphile-private/commit/3caaced6cfbac4a187a245a61eb103edcb8cd4c9),
|
|
103
|
+
[`9f2507ed9`](https://github.com/benjie/postgraphile-private/commit/9f2507ed9fe8a6abe93c9c8a1cff410446587fd6)]:
|
|
104
|
+
- @dataplan/pg@0.0.1-alpha.11
|
|
105
|
+
- graphile-build@5.0.0-alpha.11
|
|
106
|
+
- grafast@0.0.1-alpha.10
|
|
107
|
+
- pg-introspection@0.0.1-alpha.3
|
|
108
|
+
|
|
109
|
+
## 5.0.0-alpha.11
|
|
110
|
+
|
|
111
|
+
### Patch Changes
|
|
112
|
+
|
|
113
|
+
- [#349](https://github.com/benjie/postgraphile-private/pull/349)
|
|
114
|
+
[`a94f11091`](https://github.com/benjie/postgraphile-private/commit/a94f11091520b52d90fd007986760848ed20017b)
|
|
115
|
+
Thanks [@benjie](https://github.com/benjie)! - **Overhaul behavior system**
|
|
116
|
+
|
|
117
|
+
Previously the behavior system worked during the schema building process,
|
|
118
|
+
inside the various schema hooks. So looking at the behavior of a `relation`
|
|
119
|
+
might have looked like:
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
GraphQLObjectType_fields_field(field, build, context) {
|
|
123
|
+
const relation = context.scope.pgRelationOrWhatever;
|
|
124
|
+
|
|
125
|
+
// Establish a default behavior, e.g. you might give it different default behavior
|
|
126
|
+
// depending on if the remote table is in the same schema or not
|
|
127
|
+
const defaultBehavior = someCondition(relation) ? "behavior_if_true" : "behavior_if_false";
|
|
128
|
+
|
|
129
|
+
// Now establish the user-specified behavior for the entity, inheriting from all the
|
|
130
|
+
// relevant places.
|
|
131
|
+
const behavior = getBehavior([
|
|
132
|
+
relation.remoteResource.codec.extensions,
|
|
133
|
+
relation.remoteResource.extensions,
|
|
134
|
+
relation.extensions
|
|
135
|
+
]);
|
|
136
|
+
|
|
137
|
+
// Finally check this behavior string against `behavior_to_test`, being sure to apply
|
|
138
|
+
// the "schema-time smart defaulting" that we established in `defaultBehavior` above.
|
|
139
|
+
if (build.behavior.matches(behavior, "behavior_to_test", defaultBehavior)) {
|
|
140
|
+
doTheThing();
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
This meant that each plugin might treat the behavior of the entity different -
|
|
145
|
+
for example `postgraphile-plugin-connection-filter` might have a different
|
|
146
|
+
`someCondition()` under which the "filter" behavior would apply by default,
|
|
147
|
+
whereas the built in `condition` plugin might have a different one.
|
|
148
|
+
|
|
149
|
+
Moreover, each place needs to know to call `getBehavior` with the same list of
|
|
150
|
+
extension sources in the same order, otherwise subtle (or not so subtle)
|
|
151
|
+
differences in the schema would occur.
|
|
152
|
+
|
|
153
|
+
And finally, because each entity doesn't have an established behavior, you
|
|
154
|
+
can't ask "what's the final behavior for this entity" because it's dynamic,
|
|
155
|
+
depending on which plugin is viewing it.
|
|
156
|
+
|
|
157
|
+
This update fixes all of this; now each entity has a single behavior that's
|
|
158
|
+
established once. Each plugin can register `entityBehaviors` for the various
|
|
159
|
+
behavior entity types (or global behaviors which apply to all entity types if
|
|
160
|
+
that makes more sense). So the hook code equivalent to the above would now be
|
|
161
|
+
more like:
|
|
162
|
+
|
|
163
|
+
```ts
|
|
164
|
+
GraphQLObjectType_fields_field(field, build, context) {
|
|
165
|
+
const relation = context.scope.pgRelationOrWhatever;
|
|
166
|
+
// Do the thing if the relation has the given behavior. Simples.
|
|
167
|
+
if (build.behavior.pgCodecRelationMatches(relation, "behavior_to_test")) {
|
|
168
|
+
doTheThing();
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
This code is much more to the point, much easier for plugin authors to
|
|
173
|
+
implement, and also a lot easier to debug since everything has a single
|
|
174
|
+
established behavior now (except `refs`, which aren't really an entity in
|
|
175
|
+
their own right, but a combination of entities...).
|
|
176
|
+
|
|
177
|
+
These changes haven't changed any of the schemas in the test suite, but they
|
|
178
|
+
may impact you. This could be a breaking change - so be sure to do a schema
|
|
179
|
+
diff before/after this.
|
|
180
|
+
|
|
181
|
+
- [#355](https://github.com/benjie/postgraphile-private/pull/355)
|
|
182
|
+
[`1fe47a2b0`](https://github.com/benjie/postgraphile-private/commit/1fe47a2b08d6e7153a22dde3a99b7a9bf50c4f84)
|
|
183
|
+
Thanks [@benjie](https://github.com/benjie)! - **MAJOR BREAKING CHANGE**:
|
|
184
|
+
implicit application of args/input fields has been removed.
|
|
185
|
+
|
|
186
|
+
Previously we would track the fieldArgs that you accessed (via `.get()`,
|
|
187
|
+
`.getRaw()` or `.apply()`) and those that you _did not access_ would
|
|
188
|
+
automatically have their `applyPlan` called, if they had one. This isn't
|
|
189
|
+
likely to be particularly useful for pure Gra*fast* users (unless they want to
|
|
190
|
+
adopt this pattern) but it's extremely useful for plugin-based schemas as it
|
|
191
|
+
allows plugins to add arguments that can influence their field's plan _without
|
|
192
|
+
having to wrap the field's plan resolver function_. This is fairly critical,
|
|
193
|
+
otherwise each behavior added (`first:`, `condition:`, `orderBy:`, `filter:`,
|
|
194
|
+
`ignoreArchived:`, etc etc) would wrap the plan resolver with another function
|
|
195
|
+
layer, and they would get _messy_.
|
|
196
|
+
|
|
197
|
+
However, implicit is rarely good. And it turns out that it severely limited
|
|
198
|
+
what I wanted to do for improving the `fieldArgs` APIs.
|
|
199
|
+
|
|
200
|
+
I decided to remove this implicit functionality by making it more explicit, so
|
|
201
|
+
now args/input fields can specify the relevant
|
|
202
|
+
`autoApplyAfterParent{Plan,SubscribePlan,InputPlan,ApplyPlan}: true` property
|
|
203
|
+
and we'll only apply them at a single level.
|
|
204
|
+
|
|
205
|
+
From a user perspective, little has changed. From a plugin author perspective,
|
|
206
|
+
if you were relying on the implicit `applyPlan` then you should now add the
|
|
207
|
+
relevant `autoApply*` property next to your `applyPlan` method.
|
|
208
|
+
|
|
209
|
+
- [#363](https://github.com/benjie/postgraphile-private/pull/363)
|
|
210
|
+
[`bcfffd5fe`](https://github.com/benjie/postgraphile-private/commit/bcfffd5fe14d5bbc3517c62041da585a3bf1bab1)
|
|
211
|
+
Thanks [@benjie](https://github.com/benjie)! - Fix bug causing `@foreignKey`
|
|
212
|
+
relation to not show up under rare circumstances (by updating
|
|
213
|
+
PgRelationsPlugin to use codec, not resource, as the primary entity).
|
|
214
|
+
|
|
215
|
+
- [#362](https://github.com/benjie/postgraphile-private/pull/362)
|
|
216
|
+
[`e443db39b`](https://github.com/benjie/postgraphile-private/commit/e443db39b07f9d71f7a1ce402475004e072a2d1d)
|
|
217
|
+
Thanks [@benjie](https://github.com/benjie)! - Use original case for table
|
|
218
|
+
resource names.
|
|
219
|
+
|
|
220
|
+
- Updated dependencies
|
|
221
|
+
[[`339fe20d0`](https://github.com/benjie/postgraphile-private/commit/339fe20d0c6e8600d263ce8093cd85a6ea8adbbf),
|
|
222
|
+
[`56237691b`](https://github.com/benjie/postgraphile-private/commit/56237691bf3eed321b7159e17f36e3651356946f),
|
|
223
|
+
[`ed1982f31`](https://github.com/benjie/postgraphile-private/commit/ed1982f31a845ceb3aafd4b48d667649f06778f5),
|
|
224
|
+
[`a94f11091`](https://github.com/benjie/postgraphile-private/commit/a94f11091520b52d90fd007986760848ed20017b),
|
|
225
|
+
[`1fe47a2b0`](https://github.com/benjie/postgraphile-private/commit/1fe47a2b08d6e7153a22dde3a99b7a9bf50c4f84),
|
|
226
|
+
[`198ac74d5`](https://github.com/benjie/postgraphile-private/commit/198ac74d52fe1e47d602fe2b7c52f216d5216b25),
|
|
227
|
+
[`6878c589c`](https://github.com/benjie/postgraphile-private/commit/6878c589cc9fc8f05a6efd377e1272ae24fbf256),
|
|
228
|
+
[`2ac706f18`](https://github.com/benjie/postgraphile-private/commit/2ac706f18660c855fe20f460b50694fdd04a7768),
|
|
229
|
+
[`77e011294`](https://github.com/benjie/postgraphile-private/commit/77e01129450ab78d55d3868661e37b0c99db3da5),
|
|
230
|
+
[`dad4d4aae`](https://github.com/benjie/postgraphile-private/commit/dad4d4aaee499098104841740c9049b1deb6ac5f),
|
|
231
|
+
[`e443db39b`](https://github.com/benjie/postgraphile-private/commit/e443db39b07f9d71f7a1ce402475004e072a2d1d)]:
|
|
232
|
+
- tamedevil@0.0.0-alpha.3
|
|
233
|
+
- pg-sql2@5.0.0-alpha.3
|
|
234
|
+
- grafast@0.0.1-alpha.9
|
|
235
|
+
- graphile-build@5.0.0-alpha.10
|
|
236
|
+
- graphile-config@0.0.1-alpha.4
|
|
237
|
+
- @dataplan/pg@0.0.1-alpha.10
|
|
238
|
+
|
|
3
239
|
## 5.0.0-alpha.10
|
|
4
240
|
|
|
5
241
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -38,14 +38,12 @@ and development via sponsorship.
|
|
|
38
38
|
And please give some love to our featured sponsors 🤩:
|
|
39
39
|
|
|
40
40
|
<table><tr>
|
|
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
41
|
<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
42
|
<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
43
|
<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
|
-
</tr><tr>
|
|
46
44
|
<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>
|
|
45
|
+
</tr><tr>
|
|
47
46
|
<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
|
-
<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
47
|
<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
48
|
</tr></table>
|
|
51
49
|
|
package/dist/behavior.d.ts
CHANGED
|
@@ -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.
|
|
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
|
|
8
|
+
export declare function getBehavior(extensions: ArrayOrDirect<Partial<PgResourceExtensions | PgCodecRelationExtensions | PgCodecExtensions | PgCodecRefExtensions> | undefined>): string;
|
|
10
9
|
export {};
|
|
11
10
|
//# sourceMappingURL=behavior.d.ts.map
|
package/dist/behavior.d.ts.map
CHANGED
|
@@ -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
|
|
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.
|
|
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];
|
package/dist/behavior.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"behavior.js","sourceRoot":"","sources":["../src/behavior.ts"],"names":[],"mappings":";;;AAAA,2BAAyB;AAQzB,qCAAgC;AAChC,+BAA+B;AAO/B
|
|
1
|
+
{"version":3,"file":"behavior.js","sourceRoot":"","sources":["../src/behavior.ts"],"names":[],"mappings":";;;AAAA,2BAAyB;AAQzB,qCAAgC;AAChC,+BAA+B;AAO/B;;;GAGG;AACH,SAAgB,WAAW,CACzB,UAQC;IAED,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UA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AAS,eAAe,CAAC,QAAiB;IACxC,OAAO,CACL,OAAO,QAAQ,KAAK,QAAQ;QAC5B,0FAA0F,CAAC,IAAI,CAC7F,QAAQ,CACT,CACF,CAAC;AACJ,CAAC"}
|
package/dist/pgServices.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { PgClient, WithPgClient } from "@dataplan/pg";
|
|
2
2
|
import type { PromiseOrDirect } from "grafast";
|
|
3
|
+
/**
|
|
4
|
+
* Is "thenable".
|
|
5
|
+
*/
|
|
6
|
+
export declare function isPromiseLike<T>(t: T | Promise<T> | PromiseLike<T>): t is PromiseLike<T>;
|
|
3
7
|
/**
|
|
4
8
|
* Get or build the 'withPgClient' callback function for a given database
|
|
5
9
|
* config, caching it to make future lookups faster.
|
package/dist/pgServices.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pgServices.d.ts","sourceRoot":"","sources":["../src/pgServices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"pgServices.d.ts","sourceRoot":"","sources":["../src/pgServices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,GACjC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAErB;AA2DD;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,cAAc,CAAC,sBAAsB,GAC5C,eAAe,CAAC,YAAY,CAAC,CA2D/B;AAED,wBAAsB,yBAAyB,CAAC,CAAC,EAC/C,MAAM,EAAE,cAAc,CAAC,sBAAsB,EAC7C,UAAU,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAAG,IAAI,EAC5C,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAC7C,OAAO,CAAC,CAAC,CAAC,CAUZ;AAGD,wBAAsB,kCAAkC,CAAC,CAAC,EACxD,MAAM,EAAE,cAAc,CAAC,sBAAsB,EAC7C,UAAU,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAAG,IAAI,EAC5C,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAC7C,OAAO,CAAC,CAAC,CAAC,CAWZ"}
|
package/dist/pgServices.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withSuperuserPgClientFromPgService = exports.withPgClientFromPgService = exports.getWithPgClientFromPgService = void 0;
|
|
4
|
-
const
|
|
3
|
+
exports.withSuperuserPgClientFromPgService = exports.withPgClientFromPgService = exports.getWithPgClientFromPgService = exports.isPromiseLike = void 0;
|
|
4
|
+
const node_url_1 = require("node:url");
|
|
5
|
+
/**
|
|
6
|
+
* Is "thenable".
|
|
7
|
+
*/
|
|
8
|
+
function isPromiseLike(t) {
|
|
9
|
+
return t != null && typeof t.then === "function";
|
|
10
|
+
}
|
|
11
|
+
exports.isPromiseLike = isPromiseLike;
|
|
5
12
|
const isTest = process.env.NODE_ENV === "test";
|
|
6
13
|
const withPgClientDetailsByConfigCache = new Map();
|
|
7
14
|
function reallyLoadAdaptor(adaptorString) {
|
|
@@ -11,7 +18,10 @@ function reallyLoadAdaptor(adaptorString) {
|
|
|
11
18
|
}
|
|
12
19
|
catch (e) {
|
|
13
20
|
if (e.code === "ERR_REQUIRE_ESM") {
|
|
14
|
-
const
|
|
21
|
+
const importSpecifier = adaptorString.match(/^([a-z]:|\.\/|\/)/i)
|
|
22
|
+
? (0, node_url_1.pathToFileURL)(adaptorString).href
|
|
23
|
+
: adaptorString;
|
|
24
|
+
const adaptorPromise = import(importSpecifier);
|
|
15
25
|
return adaptorPromise.then((adaptor) => adaptor?.createWithPgClient ? adaptor : adaptor?.default);
|
|
16
26
|
}
|
|
17
27
|
else {
|
|
@@ -28,7 +38,7 @@ function loadAdaptor(adaptorString) {
|
|
|
28
38
|
else {
|
|
29
39
|
const result = reallyLoadAdaptor(adaptorString);
|
|
30
40
|
loadAdaptorCache.set(adaptorString, result);
|
|
31
|
-
if (
|
|
41
|
+
if (isPromiseLike(result)) {
|
|
32
42
|
result.then((resolved) => {
|
|
33
43
|
loadAdaptorCache.set(adaptorString, resolved);
|
|
34
44
|
}, () => { });
|
|
@@ -43,7 +53,7 @@ function loadAdaptor(adaptorString) {
|
|
|
43
53
|
function getWithPgClientFromPgService(config) {
|
|
44
54
|
const existing = withPgClientDetailsByConfigCache.get(config);
|
|
45
55
|
if (existing) {
|
|
46
|
-
if (
|
|
56
|
+
if (isPromiseLike(existing)) {
|
|
47
57
|
return existing.then((v) => {
|
|
48
58
|
v.retainers++;
|
|
49
59
|
return v.withPgClient;
|
|
@@ -97,7 +107,7 @@ function getWithPgClientFromPgService(config) {
|
|
|
97
107
|
exports.getWithPgClientFromPgService = getWithPgClientFromPgService;
|
|
98
108
|
async function withPgClientFromPgService(config, pgSettings, callback) {
|
|
99
109
|
const withPgClientFromPgService = getWithPgClientFromPgService(config);
|
|
100
|
-
const withPgClient =
|
|
110
|
+
const withPgClient = isPromiseLike(withPgClientFromPgService)
|
|
101
111
|
? await withPgClientFromPgService
|
|
102
112
|
: withPgClientFromPgService;
|
|
103
113
|
try {
|
package/dist/pgServices.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pgServices.js","sourceRoot":"","sources":["../src/pgServices.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"pgServices.js","sourceRoot":"","sources":["../src/pgServices.ts"],"names":[],"mappings":";;;AAEA,uCAAyC;AAEzC;;GAEG;AACH,SAAgB,aAAa,CAC3B,CAAkC;IAElC,OAAO,CAAC,IAAI,IAAI,IAAI,OAAQ,CAAS,CAAC,IAAI,KAAK,UAAU,CAAC;AAC5D,CAAC;AAJD,sCAIC;AAID,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,CAAC;AAO/C,MAAM,gCAAgC,GAAG,IAAI,GAAG,EAG7C,CAAC;AAEJ,SAAS,iBAAiB,CAExB,aAAuB;IACvB,IAAI;QACF,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;QACvC,OAAO,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC;KACjE;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,CAAC,IAAI,KAAK,iBAAiB,EAAE;YAChC,MAAM,eAAe,GAAG,aAAa,CAAC,KAAK,CAAC,oBAAoB,CAAC;gBAC/D,CAAC,CAAC,IAAA,wBAAa,EAAC,aAAa,CAAC,CAAC,IAAI;gBACnC,CAAC,CAAC,aAAa,CAAC;YAClB,MAAM,cAAc,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;YAC/C,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CACrC,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,CACzD,CAAC;SACH;aAAM;YACL,MAAM,CAAC,CAAC;SACT;KACF;AACH,CAAC;AAED,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAA2C,CAAC;AAC5E,SAAS,WAAW,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AAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;KAC5C;AACH,CAAC;AA7DD,oEA6DC;AAEM,KAAK,UAAU,yBAAyB,CAC7C,MAA6C,EAC7C,UAA4C,EAC5C,QAA8C;IAE9C,MAAM,yBAAyB,GAAG,4BAA4B,CAAC,MAAM,CAAC,CAAC;IACvE,MAAM,YAAY,GAAG,aAAa,CAAC,yBAAyB,CAAC;QAC3D,CAAC,CAAC,MAAM,yBAAyB;QACjC,CAAC,CAAC,yBAAyB,CAAC;IAC9B,IAAI;QACF,OAAO,MAAM,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;KACjD;YAAS;QACR,YAAY,CAAC,OAAQ,EAAE,CAAC;KACzB;AACH,CAAC;AAdD,8DAcC;AAED,yCAAyC;AAClC,KAAK,UAAU,kCAAkC,CACtD,MAA6C,EAC7C,UAA4C,EAC5C,QAA8C;IAE9C,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAClD,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC,kBAAkB,CACnD,MAAM,CAAC,eAAe,EACtB,WAAW,CACZ,CAAC;IACF,IAAI;QACF,OAAO,MAAM,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;KACjD;YAAS;QACR,YAAY,CAAC,OAAO,EAAE,EAAE,CAAC;KAC1B;AACH,CAAC;AAfD,gFAeC"}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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"}
|
|
@@ -5,7 +5,6 @@ require("./PgTablesPlugin.js");
|
|
|
5
5
|
require("graphile-config");
|
|
6
6
|
const grafast_1 = require("grafast");
|
|
7
7
|
const graphile_build_1 = require("graphile-build");
|
|
8
|
-
const behavior_js_1 = require("../behavior.js");
|
|
9
8
|
const utils_js_1 = require("../utils.js");
|
|
10
9
|
const version_js_1 = require("../version.js");
|
|
11
10
|
exports.PgAllRowsPlugin = {
|
|
@@ -43,12 +42,7 @@ exports.PgAllRowsPlugin = {
|
|
|
43
42
|
if (!type) {
|
|
44
43
|
continue;
|
|
45
44
|
}
|
|
46
|
-
|
|
47
|
-
resource.codec.extensions,
|
|
48
|
-
resource.extensions,
|
|
49
|
-
]);
|
|
50
|
-
const defaultBehavior = "connection -list";
|
|
51
|
-
if (build.behavior.matches(behavior, "query:resource:list", defaultBehavior)) {
|
|
45
|
+
if (build.behavior.pgResourceMatches(resource, "query:resource:list")) {
|
|
52
46
|
const fieldName = build.inflection.allRowsList(resource);
|
|
53
47
|
fields = build.extend(fields, {
|
|
54
48
|
[fieldName]: fieldWithHooks({
|
|
@@ -66,7 +60,7 @@ exports.PgAllRowsPlugin = {
|
|
|
66
60
|
})),
|
|
67
61
|
}, `Adding 'all rows' list field for PgResource ${resource}`);
|
|
68
62
|
}
|
|
69
|
-
if (build.behavior.
|
|
63
|
+
if (build.behavior.pgResourceMatches(resource, "query:resource:connection")) {
|
|
70
64
|
const fieldName = build.inflection.allRowsConnection(resource);
|
|
71
65
|
const connectionType = build.getTypeByName(build.inflection.tableConnectionType(resource.codec));
|
|
72
66
|
if (connectionType) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PgAllRowsPlugin.js","sourceRoot":"","sources":["../../src/plugins/PgAllRowsPlugin.ts"],"names":[],"mappings":";;;AAAA,+BAA6B;AAC7B,2BAAyB;AAGzB,qCAAqC;AACrC,mDAA4C;AAG5C,
|
|
1
|
+
{"version":3,"file":"PgAllRowsPlugin.js","sourceRoot":"","sources":["../../src/plugins/PgAllRowsPlugin.ts"],"names":[],"mappings":";;;AAAA,+BAA6B;AAC7B,2BAAyB;AAGzB,qCAAqC;AACrC,mDAA4C;AAG5C,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,IAAI,CAAC,yBAAyB,CAAC,QAAQ,CAAC,CAAC,EAAE,CAClE,CACF,CAAC;YACJ,CAAC;YACD,WAAW,CAAC,OAAO,EAAE,QAAQ;gBAC3B,OAAO,IAAI,CAAC,SAAS,CACnB,IAAI,CAAC,SAAS,CACZ,OAAO,IAAI,CAAC,SAAS,CAA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,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PgAttributesPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/PgAttributesPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAGV,gBAAgB,EAGhB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"PgAttributesPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/PgAttributesPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAGV,gBAAgB,EAGhB,qBAAqB,EAEtB,MAAM,cAAc,CAAC;AAStB,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;aACrB,GACA,MAAM,CAAC;YAEV;;;eAGG;YACH,mBAAmB,CACjB,IAAI,EAAE,aAAa,CAAC,UAAU,EAC9B,KAAK,EA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