graphile-utils 5.0.0-beta.37 → 5.0.0-beta.39
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 +319 -0
- package/README.md +38 -28
- package/dist/exportable.js +1 -2
- package/dist/exportable.js.map +1 -1
- package/dist/gql.js +1 -2
- package/dist/gql.js.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/makeAddInflectorsPlugin.js +1 -2
- package/dist/makeAddInflectorsPlugin.js.map +1 -1
- package/dist/makeAddPgTableConditionPlugin.d.ts +4 -4
- package/dist/makeAddPgTableConditionPlugin.d.ts.map +1 -1
- package/dist/makeAddPgTableConditionPlugin.js +11 -10
- package/dist/makeAddPgTableConditionPlugin.js.map +1 -1
- package/dist/makeAddPgTableOrderByPlugin.d.ts +4 -9
- package/dist/makeAddPgTableOrderByPlugin.d.ts.map +1 -1
- package/dist/makeAddPgTableOrderByPlugin.js +27 -28
- package/dist/makeAddPgTableOrderByPlugin.js.map +1 -1
- package/dist/makeChangeNullabilityPlugin.d.ts.map +1 -1
- package/dist/makeChangeNullabilityPlugin.js +1 -2
- package/dist/makeChangeNullabilityPlugin.js.map +1 -1
- package/dist/makeExtendSchemaPlugin.d.ts +25 -29
- package/dist/makeExtendSchemaPlugin.d.ts.map +1 -1
- package/dist/makeExtendSchemaPlugin.js +215 -22
- package/dist/makeExtendSchemaPlugin.js.map +1 -1
- package/dist/makePgSmartTagsPlugin.d.ts.map +1 -1
- package/dist/makePgSmartTagsPlugin.js +4 -4
- package/dist/makePgSmartTagsPlugin.js.map +1 -1
- package/dist/makeProcessSchemaPlugin.js +1 -2
- package/dist/makeProcessSchemaPlugin.js.map +1 -1
- package/dist/makeWrapPlansPlugin.d.ts +1 -1
- package/dist/makeWrapPlansPlugin.d.ts.map +1 -1
- package/dist/makeWrapPlansPlugin.js +3 -6
- package/dist/makeWrapPlansPlugin.js.map +1 -1
- package/dist/parseIdentifierParts.js +1 -2
- package/dist/parseIdentifierParts.js.map +1 -1
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,324 @@
|
|
|
1
1
|
# graphile-utils
|
|
2
2
|
|
|
3
|
+
## 5.0.0-beta.39
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2482](https://github.com/graphile/crystal/pull/2482)
|
|
8
|
+
[`459e1869a2ec58925b2bac5458af487c52a8ca37`](https://github.com/graphile/crystal/commit/459e1869a2ec58925b2bac5458af487c52a8ca37)
|
|
9
|
+
Thanks [@benjie](https://github.com/benjie)! - Minimum version of Node.js
|
|
10
|
+
bumped to Node 22 (the latest LTS).
|
|
11
|
+
|
|
12
|
+
- [#2527](https://github.com/graphile/crystal/pull/2527)
|
|
13
|
+
[`576fb8bad56cb940ab444574d752e914d462018a`](https://github.com/graphile/crystal/commit/576fb8bad56cb940ab444574d752e914d462018a)
|
|
14
|
+
Thanks [@{](https://github.com/{)! - In order to make the libraries more type
|
|
15
|
+
safe, `makeGrafastSchema` (from `grafast`) and `makeExtendSchemaPlugin` (from
|
|
16
|
+
`postgraphile/utils`) have deprecated the `typeDefs`/`plans` pattern since
|
|
17
|
+
`plans` (like `resolvers` in the traditional format) ended up being a
|
|
18
|
+
mish-mash of lots of different types and `__`-prefixed fields for special
|
|
19
|
+
cases.
|
|
20
|
+
|
|
21
|
+
Instead the configuration should be split into `typeDefs` with `objects`,
|
|
22
|
+
`interfaces`, `unions`, `inputObjects`, `scalars` and `enums`; and object and
|
|
23
|
+
input object fields should be specified via the `plans` entry within the type
|
|
24
|
+
to avoid conflicts with `resolveType`/`isTypeOf`/`planType`/`scope` and
|
|
25
|
+
similar type-level (rather than field-level) properties. Similarly, enum
|
|
26
|
+
values should be added under a `values` property. This also means these
|
|
27
|
+
type-level fields no longer have the `__` prefix.
|
|
28
|
+
|
|
29
|
+
Migration is quite straightforward:
|
|
30
|
+
|
|
31
|
+
1. **Add new top-level properties**. Add `objects`, `interfaces`, `unions`,
|
|
32
|
+
`inputObjects`, `scalars`, and `enums` as top level properties alongside
|
|
33
|
+
`typeDefs` and `plans`. Each should be an empty object. You can skip any
|
|
34
|
+
where you're not defining types of that kind.
|
|
35
|
+
1. **Split definitions based on type kind**. For each type defined in `plans`
|
|
36
|
+
move it into the appropriate new property based on the keyword used to
|
|
37
|
+
define the type in the `typeDefs` (`type` → `objects`, `interface`
|
|
38
|
+
→ `interfaces`, `union` → `unions`, `input object` →
|
|
39
|
+
`inputObjects`, `scalar` → `scalars`, `enum` → `enums`).
|
|
40
|
+
1. **Move field plans into nested `plans: {...}` object**. For each type
|
|
41
|
+
defined in the new `objects` and `inputObjects` maps: create a
|
|
42
|
+
`plans: { ... }` entry inside the type and move all fields (anything not
|
|
43
|
+
prefixed with `__`) inside this new (nested) property.
|
|
44
|
+
1. **Move enum values into nested `values: {...}` object**. For each type
|
|
45
|
+
defined in the new `enums` map: create a `values: { ... }` entry inside the
|
|
46
|
+
type and move all values (anything not prefixed with `__`) inside this new
|
|
47
|
+
(nested) property.
|
|
48
|
+
1. **Remove `__` prefixes**. For each type across
|
|
49
|
+
`objects`/`interfaces`/`unions`/`interfaceObjects`/`scalars` and `enums`:
|
|
50
|
+
remove the `__` prefix from any methods/properties.
|
|
51
|
+
|
|
52
|
+
Example:
|
|
53
|
+
|
|
54
|
+
```diff
|
|
55
|
+
typeDefs: ...,
|
|
56
|
+
-plans: {
|
|
57
|
+
+objects: {
|
|
58
|
+
|
|
59
|
+
- __isTypeOf(v) {
|
|
60
|
+
+ isTypeOf(v) {
|
|
61
|
+
return v.username != null;
|
|
62
|
+
},
|
|
63
|
+
+ plans: {
|
|
64
|
+
fieldName($source, fieldArgs) {
|
|
65
|
+
// ...
|
|
66
|
+
},
|
|
67
|
+
+ },
|
|
68
|
+
},
|
|
69
|
+
+},
|
|
70
|
+
+interfaces: {,
|
|
71
|
+
MyInterface: {
|
|
72
|
+
- __resolveType($specifier) {
|
|
73
|
+
+ resolveType($specifier) {
|
|
74
|
+
// ...
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
+},
|
|
78
|
+
+enums: {
|
|
79
|
+
MyEnum: {
|
|
80
|
+
+ values: {
|
|
81
|
+
ONE: {value: 1},
|
|
82
|
+
TWO: {value: 2},
|
|
83
|
+
THREE: {value: 3},
|
|
84
|
+
+ }
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Other changes:
|
|
90
|
+
|
|
91
|
+
- `ObjectPlans`/`GrafastPlans`/`FieldPlans`/`InputObjectPlans`/`ScalarPlans`
|
|
92
|
+
all changed to signular
|
|
93
|
+
- `InterfaceOrUnionPlans` split to `InterfacePlan`/`UnionPlan` (identical
|
|
94
|
+
currently)
|
|
95
|
+
- Shape of `ObjectPlan`/`InterfacePlan`/`UnionPlan` has changed;
|
|
96
|
+
`DeprecatedObjectPlan`/etc exist for backcompat
|
|
97
|
+
- `FieldArgs` can now accept an input shape indicating the args and their
|
|
98
|
+
types
|
|
99
|
+
- `FieldPlanResolver<TArgs, TParentStep, TResultStep>` has switched the order
|
|
100
|
+
of the first two generic parameters:
|
|
101
|
+
`FieldPlanResolver<TParentStep, TArgs, TResultStep>` - this is to reflect
|
|
102
|
+
the order of the arguments to the function. Also null has been removed from
|
|
103
|
+
the generics.
|
|
104
|
+
- Various generics (including `GrafastFieldConfig`) that used to take a
|
|
105
|
+
GraphQL type instance as a generic parameter no longer do - you need to use
|
|
106
|
+
external code generation because TypeScript cannot handle the dynamic
|
|
107
|
+
creation.
|
|
108
|
+
- `GrafastFieldConfig` last two generics swapped order.
|
|
109
|
+
- `GrafastArgumentConfig` generics completely changed
|
|
110
|
+
|
|
111
|
+
- Updated dependencies
|
|
112
|
+
[[`0e36cb9077c76710d2e407830323f86c5038126e`](https://github.com/graphile/crystal/commit/0e36cb9077c76710d2e407830323f86c5038126e),
|
|
113
|
+
[`c0c3f48fa9f60cb9a4436ea135979b779ecc71ec`](https://github.com/graphile/crystal/commit/c0c3f48fa9f60cb9a4436ea135979b779ecc71ec),
|
|
114
|
+
[`cef9a37f846b4af105ac20960530d65c9f44afa9`](https://github.com/graphile/crystal/commit/cef9a37f846b4af105ac20960530d65c9f44afa9),
|
|
115
|
+
[`56ce94a847c6a4094643665cbf5d3712f56140b6`](https://github.com/graphile/crystal/commit/56ce94a847c6a4094643665cbf5d3712f56140b6),
|
|
116
|
+
[`070467c4ea693a2516fc8006bebb88b1ab96fb26`](https://github.com/graphile/crystal/commit/070467c4ea693a2516fc8006bebb88b1ab96fb26),
|
|
117
|
+
[`192a27e08763ea26607344a2ea6c7f5c595cc2a3`](https://github.com/graphile/crystal/commit/192a27e08763ea26607344a2ea6c7f5c595cc2a3),
|
|
118
|
+
[`142e39f26ce329f09bee0b5427f1ddc5103e610e`](https://github.com/graphile/crystal/commit/142e39f26ce329f09bee0b5427f1ddc5103e610e),
|
|
119
|
+
[`6ef6abce15936a896156d5316020df55cf7d18e3`](https://github.com/graphile/crystal/commit/6ef6abce15936a896156d5316020df55cf7d18e3),
|
|
120
|
+
[`0239c2d519300a72f545e0db7c371adae4ade2a9`](https://github.com/graphile/crystal/commit/0239c2d519300a72f545e0db7c371adae4ade2a9),
|
|
121
|
+
[`09d95319be3e25e023dfbab9d1542dfe06f65355`](https://github.com/graphile/crystal/commit/09d95319be3e25e023dfbab9d1542dfe06f65355),
|
|
122
|
+
[`0ea439d33ccef7f8d01ac5f54893ab2bbf1cbd4d`](https://github.com/graphile/crystal/commit/0ea439d33ccef7f8d01ac5f54893ab2bbf1cbd4d),
|
|
123
|
+
[`8034614d1078b1bd177b6e7fcc949420614e3245`](https://github.com/graphile/crystal/commit/8034614d1078b1bd177b6e7fcc949420614e3245),
|
|
124
|
+
[`a830770e775a65ce1d09fa767f38e84f5c0e5139`](https://github.com/graphile/crystal/commit/a830770e775a65ce1d09fa767f38e84f5c0e5139),
|
|
125
|
+
[`459e1869a2ec58925b2bac5458af487c52a8ca37`](https://github.com/graphile/crystal/commit/459e1869a2ec58925b2bac5458af487c52a8ca37),
|
|
126
|
+
[`c350e49e372ec12a4cbf04fb6b4260e01832d12b`](https://github.com/graphile/crystal/commit/c350e49e372ec12a4cbf04fb6b4260e01832d12b),
|
|
127
|
+
[`3176ea3e57d626b39613a73117ef97627370ec83`](https://github.com/graphile/crystal/commit/3176ea3e57d626b39613a73117ef97627370ec83),
|
|
128
|
+
[`46a42f5547c041289aa98657ebc6815f4b6c8539`](https://github.com/graphile/crystal/commit/46a42f5547c041289aa98657ebc6815f4b6c8539),
|
|
129
|
+
[`be3f174c5aae8fe78a240e1bc4e1de7f18644b43`](https://github.com/graphile/crystal/commit/be3f174c5aae8fe78a240e1bc4e1de7f18644b43),
|
|
130
|
+
[`c43ed67b9d3acbadb172ee88ba9c2a4d32528a25`](https://github.com/graphile/crystal/commit/c43ed67b9d3acbadb172ee88ba9c2a4d32528a25),
|
|
131
|
+
[`576fb8bad56cb940ab444574d752e914d462018a`](https://github.com/graphile/crystal/commit/576fb8bad56cb940ab444574d752e914d462018a),
|
|
132
|
+
[`9f459101fa4428aa4bac71531e75f99e33da8e17`](https://github.com/graphile/crystal/commit/9f459101fa4428aa4bac71531e75f99e33da8e17),
|
|
133
|
+
[`921665df8babe2651ab3b5886ab68bb518f2125b`](https://github.com/graphile/crystal/commit/921665df8babe2651ab3b5886ab68bb518f2125b),
|
|
134
|
+
[`78bb1a615754d772a5fda000e96073c91fa9eba7`](https://github.com/graphile/crystal/commit/78bb1a615754d772a5fda000e96073c91fa9eba7),
|
|
135
|
+
[`ab0bcda5fc3c136eea09493a7d9ed4542975858e`](https://github.com/graphile/crystal/commit/ab0bcda5fc3c136eea09493a7d9ed4542975858e),
|
|
136
|
+
[`455f4811d37ad8fff91183c7a88621bcf9d79acf`](https://github.com/graphile/crystal/commit/455f4811d37ad8fff91183c7a88621bcf9d79acf),
|
|
137
|
+
[`45adaff886e7cd72b864150927be6c0cb4a7dfe8`](https://github.com/graphile/crystal/commit/45adaff886e7cd72b864150927be6c0cb4a7dfe8),
|
|
138
|
+
[`b05d57b932ea00d10715dcab9f79d443408881fc`](https://github.com/graphile/crystal/commit/b05d57b932ea00d10715dcab9f79d443408881fc)]:
|
|
139
|
+
- grafast@0.1.1-beta.22
|
|
140
|
+
- @dataplan/pg@0.0.1-beta.33
|
|
141
|
+
- graphile-build-pg@5.0.0-beta.39
|
|
142
|
+
- graphile-build@5.0.0-beta.34
|
|
143
|
+
- graphile-config@0.0.1-beta.16
|
|
144
|
+
- tamedevil@0.0.0-beta.8
|
|
145
|
+
|
|
146
|
+
## 5.0.0-beta.38
|
|
147
|
+
|
|
148
|
+
### Patch Changes
|
|
149
|
+
|
|
150
|
+
- [`d68c5831ed66dc8a7a79aab2100ca733409c6f72`](https://github.com/graphile/crystal/commit/d68c5831ed66dc8a7a79aab2100ca733409c6f72)
|
|
151
|
+
Thanks [@benjie](https://github.com/benjie)! - Improve error messages around
|
|
152
|
+
correct usage of typeDefs and gql helper.
|
|
153
|
+
|
|
154
|
+
- [#2355](https://github.com/graphile/crystal/pull/2355)
|
|
155
|
+
[`7bb77961a38abea8a07980a3f47bc3ca22dac8f8`](https://github.com/graphile/crystal/commit/7bb77961a38abea8a07980a3f47bc3ca22dac8f8)
|
|
156
|
+
Thanks [@benjie](https://github.com/benjie)! - Fix bug in makeWrapPlansPlugin
|
|
157
|
+
where the default plan resolver used was incorrect; use the new
|
|
158
|
+
`defaultPlanResolver` export from `grafast` instead of building our own.
|
|
159
|
+
|
|
160
|
+
- [#2376](https://github.com/graphile/crystal/pull/2376)
|
|
161
|
+
[`da6f3c04efe3d8634c0bc3fcf93ac2518de85322`](https://github.com/graphile/crystal/commit/da6f3c04efe3d8634c0bc3fcf93ac2518de85322)
|
|
162
|
+
Thanks [@benjie](https://github.com/benjie)! - Overhaul Grafast to remove more
|
|
163
|
+
input planning - inputs should be evaluated at runtime - and remove more
|
|
164
|
+
plan-time step evaluation.
|
|
165
|
+
|
|
166
|
+
`FieldArgs.get` is no more; use `FieldArgs.getRaw` or use `bakedInput()`
|
|
167
|
+
(TODO: document) to get the "baked" version of a raw input value.
|
|
168
|
+
|
|
169
|
+
Input object fields no longer have `applyPlan`/`inputPlan`, instead having the
|
|
170
|
+
runtime equivalents `apply()` and `baked()`. `FieldArgs` is no longer
|
|
171
|
+
available on input object fields, since these fields are no longer called at
|
|
172
|
+
plantime; instead, the actual value is passed.
|
|
173
|
+
|
|
174
|
+
`FieldArgs` gains `.typeAt(path)` method that details the GraphQL input type
|
|
175
|
+
at the given path.
|
|
176
|
+
|
|
177
|
+
Field arguments are no longer passed `FieldArgs`, instead they're passed a
|
|
178
|
+
(similar) `FieldArg` object representing the argument value itself.
|
|
179
|
+
|
|
180
|
+
`autoApplyAfterParentPlan` is no more - instead if an argument has `applyPlan`
|
|
181
|
+
it will be called automatically unless it was called during the field plan
|
|
182
|
+
resolver itself.
|
|
183
|
+
|
|
184
|
+
`autoApplyAfterParentSubscribePlan` is no more - instead if an argument has
|
|
185
|
+
`applySubscribePlan` it will be called automatically unless it was called
|
|
186
|
+
during the field plan resolver itself.
|
|
187
|
+
|
|
188
|
+
Field arguments no longer support `inputPlan` - use `bakedInput()` if you need
|
|
189
|
+
that.
|
|
190
|
+
|
|
191
|
+
Input fields no longer support `inputPlan`, `applyPlan`,
|
|
192
|
+
`autoApplyAfterParentInputPlan` nor `autoApplyAfterParentApplyPlan`. Instead,
|
|
193
|
+
`apply()` (which is called by `applyStep()` at runtime) has been added.
|
|
194
|
+
|
|
195
|
+
`sqlValueWithCodec(value, codec)` can be used at runtime in places where
|
|
196
|
+
`$step.placeholder($value, codec)` would have been used previously.
|
|
197
|
+
`placeholder` has been removed from all places that are now runtime - namely
|
|
198
|
+
the list of modifiers below...
|
|
199
|
+
|
|
200
|
+
The following `ModifierStep` classes have all dropped their `Step` suffix,
|
|
201
|
+
these `Modifier` classes now all run at runtime, and are thus no longer steps;
|
|
202
|
+
they're invoked as part of the new `applyInput()` (TODO: document) step:
|
|
203
|
+
|
|
204
|
+
- `ModifierStep` ⇒ `Modifier`
|
|
205
|
+
- `PgBooleanFilterStep` ⇒ `PgBooleanFilter`
|
|
206
|
+
- `PgClassFilterStep` ⇒ `PgClassFilter`
|
|
207
|
+
- `PgConditionCapableParentStep` ⇒ `PgConditionCapableParent`
|
|
208
|
+
- `PgConditionLikeStep` ⇒ `PgConditionLike`
|
|
209
|
+
- `PgConditionStepMode` ⇒ `PgConditionMode`
|
|
210
|
+
- `PgConditionStep` ⇒ `PgCondition`
|
|
211
|
+
- `PgManyFilterStep` ⇒ `PgManyFilter`
|
|
212
|
+
- `PgOrFilterStep` ⇒ `PgOrFilter`
|
|
213
|
+
- `PgTempTableStep` ⇒ `PgTempTable`
|
|
214
|
+
- `SetterCapableStep` ⇒ `SetterCapable`
|
|
215
|
+
- `SetterStep` ⇒ `Setter`
|
|
216
|
+
|
|
217
|
+
(Interestingly, other than the removal of `placeholder` and the fact they deal
|
|
218
|
+
with runtime values rather than steps now, they're very similar to what they
|
|
219
|
+
were before.)
|
|
220
|
+
|
|
221
|
+
The deprecated forms of the above have been removed.
|
|
222
|
+
|
|
223
|
+
Methods that rely on these modifier plans have been removed:
|
|
224
|
+
|
|
225
|
+
- `PgUnionAllStep.wherePlan` - use
|
|
226
|
+
`fieldArg.apply($unionAll, qb => qb.whereBuilder())` instead
|
|
227
|
+
- `PgUnionAllStep.havingPlan` - use
|
|
228
|
+
`fieldArg.apply($unionAll, qb => qb.havingBuilder())` instead
|
|
229
|
+
- Same for PgSelectStep
|
|
230
|
+
|
|
231
|
+
The following gain query builders:
|
|
232
|
+
|
|
233
|
+
- `PgInsertSingle`
|
|
234
|
+
- `PgUpdateSingle`
|
|
235
|
+
- `PgDeleteSingle`
|
|
236
|
+
|
|
237
|
+
Query builders gain `meta`, an object that can be augmented with metadata
|
|
238
|
+
about the operation (typically this relates to cursors and similar
|
|
239
|
+
functionality). This is now used to implement `clientMutationId`.
|
|
240
|
+
|
|
241
|
+
Extends query builders with additional functionality.
|
|
242
|
+
|
|
243
|
+
Many of the types have had their generics changed, TypeScript should guide you
|
|
244
|
+
if you have issues here.
|
|
245
|
+
|
|
246
|
+
`NodeIdHandler` now requires a `getIdentifiers` method that runs at runtime
|
|
247
|
+
and returns the identifiers from a decoded NodeId string.
|
|
248
|
+
|
|
249
|
+
Types around GraphQL Global Object Identification (i.e. `Node` / `id`) have
|
|
250
|
+
changed.
|
|
251
|
+
|
|
252
|
+
- Updated dependencies
|
|
253
|
+
[[`d34014a9a3c469154cc796086ba13719954731e5`](https://github.com/graphile/crystal/commit/d34014a9a3c469154cc796086ba13719954731e5),
|
|
254
|
+
[`d3ae3415c230784fdfefc9d192ad93aca462bceb`](https://github.com/graphile/crystal/commit/d3ae3415c230784fdfefc9d192ad93aca462bceb),
|
|
255
|
+
[`98516379ac355a0833a64e002f3717cc3a1d6473`](https://github.com/graphile/crystal/commit/98516379ac355a0833a64e002f3717cc3a1d6473),
|
|
256
|
+
[`f8602d05eed3247c90b87c55d7af580d1698effc`](https://github.com/graphile/crystal/commit/f8602d05eed3247c90b87c55d7af580d1698effc),
|
|
257
|
+
[`65df25534fa3f787ba2ab7fd9547d295ff2b1288`](https://github.com/graphile/crystal/commit/65df25534fa3f787ba2ab7fd9547d295ff2b1288),
|
|
258
|
+
[`1b3c76efd27df73eab3a5a1d221ce13de4cd6b1a`](https://github.com/graphile/crystal/commit/1b3c76efd27df73eab3a5a1d221ce13de4cd6b1a),
|
|
259
|
+
[`f6e22692b628703b8ea48e580dc0b6f0bcbc9c5a`](https://github.com/graphile/crystal/commit/f6e22692b628703b8ea48e580dc0b6f0bcbc9c5a),
|
|
260
|
+
[`c3538050abbb485cf1d43f7c870b89f1ad7c2218`](https://github.com/graphile/crystal/commit/c3538050abbb485cf1d43f7c870b89f1ad7c2218),
|
|
261
|
+
[`3c0a925f26f10cae627a23c49c75ccd8d76b60c8`](https://github.com/graphile/crystal/commit/3c0a925f26f10cae627a23c49c75ccd8d76b60c8),
|
|
262
|
+
[`fcaeb48844156e258a037f420ea1505edb50c52a`](https://github.com/graphile/crystal/commit/fcaeb48844156e258a037f420ea1505edb50c52a),
|
|
263
|
+
[`68926abc31c32ce527327ffbb1ede4b0b7be446b`](https://github.com/graphile/crystal/commit/68926abc31c32ce527327ffbb1ede4b0b7be446b),
|
|
264
|
+
[`98c5009e21e423b0da22c2cb70cdb62909578f50`](https://github.com/graphile/crystal/commit/98c5009e21e423b0da22c2cb70cdb62909578f50),
|
|
265
|
+
[`4b49dbd2df3b339a2ba3f1e9ff400fa1a125298b`](https://github.com/graphile/crystal/commit/4b49dbd2df3b339a2ba3f1e9ff400fa1a125298b),
|
|
266
|
+
[`d7950e8e28ec6106a4ce2f7fe5e35d88b10eac48`](https://github.com/graphile/crystal/commit/d7950e8e28ec6106a4ce2f7fe5e35d88b10eac48),
|
|
267
|
+
[`c8f1971ea4198633ec97f72f82abf65089f71a88`](https://github.com/graphile/crystal/commit/c8f1971ea4198633ec97f72f82abf65089f71a88),
|
|
268
|
+
[`182ed0564104f59b012e0f9ffd452556b0927750`](https://github.com/graphile/crystal/commit/182ed0564104f59b012e0f9ffd452556b0927750),
|
|
269
|
+
[`dd3d22eab73a8554715bf1111e30586251f69a88`](https://github.com/graphile/crystal/commit/dd3d22eab73a8554715bf1111e30586251f69a88),
|
|
270
|
+
[`a120a8e43b24dfc174950cdbb69e481272a0b45e`](https://github.com/graphile/crystal/commit/a120a8e43b24dfc174950cdbb69e481272a0b45e),
|
|
271
|
+
[`be1e558d6a1a8cae3bf4b5724c340469d8837504`](https://github.com/graphile/crystal/commit/be1e558d6a1a8cae3bf4b5724c340469d8837504),
|
|
272
|
+
[`84f06eafa051e907a3050237ac6ee5aefb184652`](https://github.com/graphile/crystal/commit/84f06eafa051e907a3050237ac6ee5aefb184652),
|
|
273
|
+
[`4a3aeaa77c8b8d2e39c1a9d05581d0c613b812cf`](https://github.com/graphile/crystal/commit/4a3aeaa77c8b8d2e39c1a9d05581d0c613b812cf),
|
|
274
|
+
[`12d3a7174949794a1679132635e196f5dadce8a2`](https://github.com/graphile/crystal/commit/12d3a7174949794a1679132635e196f5dadce8a2),
|
|
275
|
+
[`ab7658ac44e1a5a0a98c6bb688a26d94b1175cc1`](https://github.com/graphile/crystal/commit/ab7658ac44e1a5a0a98c6bb688a26d94b1175cc1),
|
|
276
|
+
[`bc2a00d35f0a1954dba22e857adc3f4e2f5118e5`](https://github.com/graphile/crystal/commit/bc2a00d35f0a1954dba22e857adc3f4e2f5118e5),
|
|
277
|
+
[`ceeb9a6b63e566b09298e0440a385943302ad0f9`](https://github.com/graphile/crystal/commit/ceeb9a6b63e566b09298e0440a385943302ad0f9),
|
|
278
|
+
[`3e8c64bef928295494119e15e1e55cbdadb696fa`](https://github.com/graphile/crystal/commit/3e8c64bef928295494119e15e1e55cbdadb696fa),
|
|
279
|
+
[`0fc2db95d90df918cf5c59ef85f22ac78d8000d3`](https://github.com/graphile/crystal/commit/0fc2db95d90df918cf5c59ef85f22ac78d8000d3),
|
|
280
|
+
[`90e81a5deeae554a8be2dd55dcd01489860e96e6`](https://github.com/graphile/crystal/commit/90e81a5deeae554a8be2dd55dcd01489860e96e6),
|
|
281
|
+
[`836c8327a5ca1bd3c69f72055e71d00694de363e`](https://github.com/graphile/crystal/commit/836c8327a5ca1bd3c69f72055e71d00694de363e),
|
|
282
|
+
[`2f31836cb89a7ab27a8919803fe12b53a46d77e4`](https://github.com/graphile/crystal/commit/2f31836cb89a7ab27a8919803fe12b53a46d77e4),
|
|
283
|
+
[`c59132eb7a93bc82493d2f1ca050db8aaea9f4d1`](https://github.com/graphile/crystal/commit/c59132eb7a93bc82493d2f1ca050db8aaea9f4d1),
|
|
284
|
+
[`7c38cdeffe034c9b4f5cdd03a8f7f446bd52dcb7`](https://github.com/graphile/crystal/commit/7c38cdeffe034c9b4f5cdd03a8f7f446bd52dcb7),
|
|
285
|
+
[`728888b28fcd2a6fc481e0ccdfe20d41181a091f`](https://github.com/graphile/crystal/commit/728888b28fcd2a6fc481e0ccdfe20d41181a091f),
|
|
286
|
+
[`f4f39092d7a51517668384945895d3b450237cce`](https://github.com/graphile/crystal/commit/f4f39092d7a51517668384945895d3b450237cce),
|
|
287
|
+
[`5cf3dc9d158891eaf324b2cd4f485d1d4bbb6b5e`](https://github.com/graphile/crystal/commit/5cf3dc9d158891eaf324b2cd4f485d1d4bbb6b5e),
|
|
288
|
+
[`925689578ee9def403382df70f0e003bb299c166`](https://github.com/graphile/crystal/commit/925689578ee9def403382df70f0e003bb299c166),
|
|
289
|
+
[`83d3b533e702cc875b46ba2ca02bf3642b421be8`](https://github.com/graphile/crystal/commit/83d3b533e702cc875b46ba2ca02bf3642b421be8),
|
|
290
|
+
[`7001138c38e09822ad13db1018c62d2cac37941e`](https://github.com/graphile/crystal/commit/7001138c38e09822ad13db1018c62d2cac37941e),
|
|
291
|
+
[`e9e7e33665e22ec397e9ead054d2e4aad3eadc8c`](https://github.com/graphile/crystal/commit/e9e7e33665e22ec397e9ead054d2e4aad3eadc8c),
|
|
292
|
+
[`bb6ec8d834e3e630e28316196246f514114a2296`](https://github.com/graphile/crystal/commit/bb6ec8d834e3e630e28316196246f514114a2296),
|
|
293
|
+
[`3e188c2e981193d228ba3b7433f5e326336f629b`](https://github.com/graphile/crystal/commit/3e188c2e981193d228ba3b7433f5e326336f629b),
|
|
294
|
+
[`07a5469e5d3d050a7bcab928bb751c9e150d2e49`](https://github.com/graphile/crystal/commit/07a5469e5d3d050a7bcab928bb751c9e150d2e49),
|
|
295
|
+
[`e6da5d956ab696932410e7172cedfacba71dbf5e`](https://github.com/graphile/crystal/commit/e6da5d956ab696932410e7172cedfacba71dbf5e),
|
|
296
|
+
[`2b1918d053f590cdc534c8cb81f7e74e96c1bbe6`](https://github.com/graphile/crystal/commit/2b1918d053f590cdc534c8cb81f7e74e96c1bbe6),
|
|
297
|
+
[`037a1bcdc8ed8493d4748e08c18f258e4382a815`](https://github.com/graphile/crystal/commit/037a1bcdc8ed8493d4748e08c18f258e4382a815),
|
|
298
|
+
[`72b300b436a7acedaa7d0e3a7a5458d15a0e5396`](https://github.com/graphile/crystal/commit/72b300b436a7acedaa7d0e3a7a5458d15a0e5396),
|
|
299
|
+
[`770363214ee630746cddc9080dec22bbf38a3bb5`](https://github.com/graphile/crystal/commit/770363214ee630746cddc9080dec22bbf38a3bb5),
|
|
300
|
+
[`d1ecb39693a341f85762b27012ec4ea013857b0c`](https://github.com/graphile/crystal/commit/d1ecb39693a341f85762b27012ec4ea013857b0c),
|
|
301
|
+
[`042ebafe11fcf7e2ecac9b131265a55dddd42a6d`](https://github.com/graphile/crystal/commit/042ebafe11fcf7e2ecac9b131265a55dddd42a6d),
|
|
302
|
+
[`fa005eb0783c58a2476add984fbdd462e0e91dbe`](https://github.com/graphile/crystal/commit/fa005eb0783c58a2476add984fbdd462e0e91dbe),
|
|
303
|
+
[`df0e5a0f968cf6f9ae97b68745a9a2f391324bf5`](https://github.com/graphile/crystal/commit/df0e5a0f968cf6f9ae97b68745a9a2f391324bf5),
|
|
304
|
+
[`ef4cf75acd80e6b9c700c2b5a7ace899e565ef7f`](https://github.com/graphile/crystal/commit/ef4cf75acd80e6b9c700c2b5a7ace899e565ef7f),
|
|
305
|
+
[`ba2bfa15deaaddd92757a56c2b761624afe940bd`](https://github.com/graphile/crystal/commit/ba2bfa15deaaddd92757a56c2b761624afe940bd),
|
|
306
|
+
[`c041fd250372c57601188b65a6411c8f440afab6`](https://github.com/graphile/crystal/commit/c041fd250372c57601188b65a6411c8f440afab6),
|
|
307
|
+
[`629b45aab49151810f6efc18ac18f7d735626433`](https://github.com/graphile/crystal/commit/629b45aab49151810f6efc18ac18f7d735626433),
|
|
308
|
+
[`6d19724330d50d076aab9442660fa8abddd095cb`](https://github.com/graphile/crystal/commit/6d19724330d50d076aab9442660fa8abddd095cb),
|
|
309
|
+
[`ca5bc1a834df7b894088fb8602a12f9fcff55b38`](https://github.com/graphile/crystal/commit/ca5bc1a834df7b894088fb8602a12f9fcff55b38),
|
|
310
|
+
[`da6f3c04efe3d8634c0bc3fcf93ac2518de85322`](https://github.com/graphile/crystal/commit/da6f3c04efe3d8634c0bc3fcf93ac2518de85322),
|
|
311
|
+
[`8026b982a81776fb3d1d808392970c2d678c4023`](https://github.com/graphile/crystal/commit/8026b982a81776fb3d1d808392970c2d678c4023),
|
|
312
|
+
[`d257a1a1e59a7d4da0bf67345c07b04c04a2f7da`](https://github.com/graphile/crystal/commit/d257a1a1e59a7d4da0bf67345c07b04c04a2f7da),
|
|
313
|
+
[`00d79e6f5608affc3f36bb0ce4ca2547230174e7`](https://github.com/graphile/crystal/commit/00d79e6f5608affc3f36bb0ce4ca2547230174e7),
|
|
314
|
+
[`15854c5109114919b3d38fa675c539cda1f634a1`](https://github.com/graphile/crystal/commit/15854c5109114919b3d38fa675c539cda1f634a1),
|
|
315
|
+
[`f0bc64b71914dfdd3612f4b65370401fd85b97bc`](https://github.com/graphile/crystal/commit/f0bc64b71914dfdd3612f4b65370401fd85b97bc)]:
|
|
316
|
+
- grafast@0.1.1-beta.21
|
|
317
|
+
- @dataplan/pg@0.0.1-beta.32
|
|
318
|
+
- graphile-build-pg@5.0.0-beta.38
|
|
319
|
+
- graphile-build@5.0.0-beta.33
|
|
320
|
+
- graphile-config@0.0.1-beta.15
|
|
321
|
+
|
|
3
322
|
## 5.0.0-beta.37
|
|
4
323
|
|
|
5
324
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -31,11 +31,7 @@ And please give some love to our featured sponsors 🤩:
|
|
|
31
31
|
|
|
32
32
|
<table><tr>
|
|
33
33
|
<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>
|
|
34
|
-
<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>
|
|
35
|
-
<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>
|
|
36
34
|
<td align="center"><a href="https://gosteelhead.com/"><img src="https://graphile.org/images/sponsors/steelhead.svg" width="90" height="90" alt="Steelhead" /><br />Steelhead</a> *</td>
|
|
37
|
-
</tr><tr>
|
|
38
|
-
<td align="center"><a href=""><img src="https://graphile.org/images/sponsors/latchbio.jpg" width="90" height="90" alt="LatchBio" /><br />LatchBio</a> *</td>
|
|
39
35
|
</tr></table>
|
|
40
36
|
|
|
41
37
|
<em>\* Sponsors the entire Graphile suite</em>
|
|
@@ -72,7 +68,9 @@ const MySchemaExtensionPlugin =
|
|
|
72
68
|
makeExtendSchemaPlugin(
|
|
73
69
|
build => ({
|
|
74
70
|
typeDefs: gql`...`,
|
|
75
|
-
|
|
71
|
+
objects: {...},
|
|
72
|
+
interfaces: {...},
|
|
73
|
+
unions: {...},
|
|
76
74
|
})
|
|
77
75
|
);
|
|
78
76
|
|
|
@@ -82,32 +80,44 @@ module.exports = MySchemaExtensionPlugin;
|
|
|
82
80
|
e.g.:
|
|
83
81
|
|
|
84
82
|
```js
|
|
85
|
-
makeExtendSchemaPlugin((build) =>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
83
|
+
makeExtendSchemaPlugin((build) => {
|
|
84
|
+
const {
|
|
85
|
+
grafast: { constant },
|
|
86
|
+
} = build;
|
|
87
|
+
return {
|
|
88
|
+
typeDefs: gql`
|
|
89
|
+
type Random {
|
|
90
|
+
float: Float!
|
|
91
|
+
number(min: Int!, max: Int!): Int!
|
|
92
|
+
}
|
|
93
|
+
extend type Query {
|
|
94
|
+
random: Random
|
|
95
|
+
}
|
|
96
|
+
`,
|
|
97
|
+
objects: {
|
|
98
|
+
Query: {
|
|
99
|
+
plans: {
|
|
100
|
+
random() {
|
|
101
|
+
return constant({});
|
|
102
|
+
},
|
|
103
|
+
},
|
|
99
104
|
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
Random: {
|
|
106
|
+
plans: {
|
|
107
|
+
float() {
|
|
108
|
+
return lambda(null, () => Math.random());
|
|
109
|
+
},
|
|
110
|
+
number(_parent, { $min, $max }) {
|
|
111
|
+
return lambda(
|
|
112
|
+
[$min, $max],
|
|
113
|
+
([min, max]) => min + Math.floor(Math.random() * (max - min + 1)),
|
|
114
|
+
);
|
|
115
|
+
},
|
|
116
|
+
},
|
|
107
117
|
},
|
|
108
118
|
},
|
|
109
|
-
}
|
|
110
|
-
})
|
|
119
|
+
};
|
|
120
|
+
});
|
|
111
121
|
```
|
|
112
122
|
|
|
113
123
|
### `makeAddInflectorsPlugin`
|
package/dist/exportable.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EXPORTABLE =
|
|
3
|
+
exports.EXPORTABLE = EXPORTABLE;
|
|
4
4
|
function EXPORTABLE(factory, args, nameHint) {
|
|
5
5
|
const fn = factory(...args);
|
|
6
6
|
if ((typeof fn === "function" || (typeof fn === "object" && fn !== null)) &&
|
|
@@ -13,5 +13,4 @@ function EXPORTABLE(factory, args, nameHint) {
|
|
|
13
13
|
}
|
|
14
14
|
return fn;
|
|
15
15
|
}
|
|
16
|
-
exports.EXPORTABLE = EXPORTABLE;
|
|
17
16
|
//# sourceMappingURL=exportable.js.map
|
package/dist/exportable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exportable.js","sourceRoot":"","sources":["../src/exportable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exportable.js","sourceRoot":"","sources":["../src/exportable.ts"],"names":[],"mappings":";;AAAA,gCAiBC;AAjBD,SAAgB,UAAU,CACxB,OAA+B,EAC/B,IAAiB,EACjB,QAAiB;IAEjB,MAAM,EAAE,GAAM,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;IAC/B,IACE,CAAC,OAAO,EAAE,KAAK,UAAU,IAAI,CAAC,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,KAAK,IAAI,CAAC,CAAC;QACrE,CAAC,CAAC,mBAAmB,IAAI,EAAE,CAAC,EAC5B,CAAC;QACD,MAAM,CAAC,gBAAgB,CAAC,EAAE,EAAE;YAC1B,cAAc,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;YAC/B,iBAAiB,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE;YACrC,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE;SACpD,CAAC,CAAC;IACL,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
package/dist/gql.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.gql =
|
|
3
|
+
exports.gql = gql;
|
|
4
4
|
// eslint-disable-next-line no-restricted-syntax
|
|
5
5
|
const graphql_1 = require("grafast/graphql");
|
|
6
6
|
function isGraphQLDocument(input) {
|
|
@@ -56,5 +56,4 @@ function gql(strings, ...interpolatedValues) {
|
|
|
56
56
|
const astWithPlaceholdersReplaced = (0, graphql_1.visit)(ast, visitor);
|
|
57
57
|
return astWithPlaceholdersReplaced;
|
|
58
58
|
}
|
|
59
|
-
exports.gql = gql;
|
|
60
59
|
//# sourceMappingURL=gql.js.map
|
package/dist/gql.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gql.js","sourceRoot":"","sources":["../src/gql.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gql.js","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ACH,GAAG,CACL,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IACD,MAAM,GAAG,GAAG,IAAA,eAAK,EAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACvC,MAAM,OAAO,GAAG;QACd,KAAK,EAAE,CAAC,IAAa,EAAE,EAAE;YACvB,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;gBAC7B,OAAO;oBACL,GAAG,IAAI;oBACP,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,GAAG,qBAAqB,CAAC;iBAC7D,CAAC;YACJ,CAAC;iBAAM,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;gBACpC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;oBACtC,IAAI,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;wBACnC,OAAO;4BACL,GAAG,IAAI;4BACP,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;yBACtC,CAAC;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;KACF,CAAC;IACF,MAAM,2BAA2B,GAAG,IAAA,eAAK,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACxD,OAAO,2BAA2B,CAAC;AACrC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
+
import type { BaseGraphQLArguments, Step } from "grafast";
|
|
1
2
|
export { EXPORTABLE } from "./exportable.js";
|
|
2
3
|
export { gql } from "./gql.js";
|
|
3
4
|
export { makeAddInflectorsPlugin } from "./makeAddInflectorsPlugin.js";
|
|
4
5
|
export { makeAddPgTableConditionPlugin } from "./makeAddPgTableConditionPlugin.js";
|
|
5
6
|
export { makeAddPgTableOrderByPlugin, MakeAddPgTableOrderByPluginOrders, NullsSortMethod, orderByAscDesc, OrderByAscDescOptions, } from "./makeAddPgTableOrderByPlugin.js";
|
|
6
7
|
export { ChangeNullabilityRules, ChangeNullabilityTypeRules, makeChangeNullabilityPlugin, NullabilitySpec, NullabilitySpecString, } from "./makeChangeNullabilityPlugin.js";
|
|
7
|
-
export { EnumResolver, ExtensionDefinition, makeExtendSchemaPlugin,
|
|
8
|
+
export { EnumResolver, ExtensionDefinition, makeExtendSchemaPlugin, ObjectPlan, ObjectResolver, Plans, Resolvers, } from "./makeExtendSchemaPlugin.js";
|
|
8
9
|
export { makeJSONPgSmartTagsPlugin, makePgSmartTagsFromFilePlugin, makePgSmartTagsPlugin, TagsFilePlugin, } from "./makePgSmartTagsPlugin.js";
|
|
9
10
|
export { makeProcessSchemaPlugin } from "./makeProcessSchemaPlugin.js";
|
|
10
11
|
export { makeWrapPlansPlugin, PlanWrapperFilter, PlanWrapperFilterRule, PlanWrapperFn, PlanWrapperRule, PlanWrapperRules, PlanWrapperRulesGenerator, } from "./makeWrapPlansPlugin.js";
|
|
12
|
+
declare module "grafast" {
|
|
13
|
+
interface ObjectFieldConfig<TSource extends Step = Step, TArgs extends BaseGraphQLArguments = any, TResultStep extends Step = Step> {
|
|
14
|
+
scope?: Omit<GraphileBuild.ScopeObjectFieldsField, "fieldName">;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
11
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EACL,2BAA2B,EAC3B,iCA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IACvB,UAAU,iBAAiB,CACzB,OAAO,SAAS,IAAI,GAAG,IAAI,EAC3B,KAAK,SAAS,oBAAoB,GAAG,GAAG,EACxC,WAAW,SAAS,IAAI,GAAG,IAAI;QAE/B,KAAK,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,sBAAsB,EAAE,WAAW,CAAC,CAAC;KACjE;CACF"}
|
package/dist/index.js
CHANGED
|
@@ -25,4 +25,5 @@ var makeProcessSchemaPlugin_js_1 = require("./makeProcessSchemaPlugin.js");
|
|
|
25
25
|
Object.defineProperty(exports, "makeProcessSchemaPlugin", { enumerable: true, get: function () { return makeProcessSchemaPlugin_js_1.makeProcessSchemaPlugin; } });
|
|
26
26
|
var makeWrapPlansPlugin_js_1 = require("./makeWrapPlansPlugin.js");
|
|
27
27
|
Object.defineProperty(exports, "makeWrapPlansPlugin", { enumerable: true, get: function () { return makeWrapPlansPlugin_js_1.makeWrapPlansPlugin; } });
|
|
28
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
28
29
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,iDAA6C;AAApC,2GAAA,UAAU,OAAA;AACnB,mCAA+B;AAAtB,6FAAA,GAAG,OAAA;AACZ,2EAAuE;AAA9D,qIAAA,uBAAuB,OAAA;AAChC,uFAAmF;AAA1E,iJAAA,6BAA6B,OAAA;AACtC,mFAM0C;AALxC,6IAAA,2BAA2B,OAAA;AAG3B,gIAAA,cAAc,OAAA;AAGhB,mFAM0C;AAHxC,6IAAA,2BAA2B,OAAA;AAI7B,yEAQqC;AALnC,mIAAA,sBAAsB,OAAA;AAMxB,uEAKoC;AAJlC,qIAAA,yBAAyB,OAAA;AACzB,yIAAA,6BAA6B,OAAA;AAC7B,iIAAA,qBAAqB,OAAA;AACrB,0HAAA,cAAc,OAAA;AAEhB,2EAAuE;AAA9D,qIAAA,uBAAuB,OAAA;AAChC,mEAQkC;AAPhC,6HAAA,mBAAmB,OAAA;AAmBrB,qDAAqD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeAddInflectorsPlugin =
|
|
3
|
+
exports.makeAddInflectorsPlugin = makeAddInflectorsPlugin;
|
|
4
4
|
/** @deprecated Build a plugin directly */
|
|
5
5
|
function makeAddInflectorsPlugin() {
|
|
6
6
|
throw new Error(`makeAddInflectorsPlugin is no longer supported; the new plugin system makes it a little easier to write it yourself:
|
|
@@ -38,5 +38,4 @@ export const MyInflectorPlugin: GraphileConfig.Plugin = {
|
|
|
38
38
|
|
|
39
39
|
`);
|
|
40
40
|
}
|
|
41
|
-
exports.makeAddInflectorsPlugin = makeAddInflectorsPlugin;
|
|
42
41
|
//# sourceMappingURL=makeAddInflectorsPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeAddInflectorsPlugin.js","sourceRoot":"","sources":["../src/makeAddInflectorsPlugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"makeAddInflectorsPlugin.js","sourceRoot":"","sources":["../src/makeAddInflectorsPlugin.ts"],"names":[],"mappings":";;AACA,0DAmCC;AApCD,0CAA0C;AAC1C,SAAgB,uBAAuB;IACrC,MAAM,IAAI,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCjB,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
1
|
+
import { sqlValueWithCodec } from "@dataplan/pg";
|
|
2
|
+
import type { GrafastInputFieldConfig } from "grafast";
|
|
3
3
|
import type { SQL, sql } from "pg-sql2";
|
|
4
4
|
export declare function makeAddPgTableConditionPlugin(match: {
|
|
5
5
|
serviceName?: string;
|
|
6
6
|
schemaName: string;
|
|
7
7
|
tableName: string;
|
|
8
|
-
}, conditionFieldName: string, conditionFieldSpecGenerator: (build: GraphileBuild.Build) => GrafastInputFieldConfig
|
|
9
|
-
$condition: PgConditionStep<PgSelectStep>;
|
|
8
|
+
}, conditionFieldName: string, conditionFieldSpecGenerator: (build: GraphileBuild.Build) => GrafastInputFieldConfig, conditionGenerator?: (value: unknown, helpers: {
|
|
10
9
|
sql: typeof sql;
|
|
11
10
|
sqlTableAlias: SQL;
|
|
11
|
+
sqlValueWithCodec: typeof sqlValueWithCodec;
|
|
12
12
|
build: GraphileBuild.Build;
|
|
13
13
|
}) => SQL | null | undefined): GraphileConfig.Plugin;
|
|
14
14
|
//# sourceMappingURL=makeAddPgTableConditionPlugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeAddPgTableConditionPlugin.d.ts","sourceRoot":"","sources":["../src/makeAddPgTableConditionPlugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"makeAddPgTableConditionPlugin.d.ts","sourceRoot":"","sources":["../src/makeAddPgTableConditionPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAIxC,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,EACtE,kBAAkB,EAAE,MAAM,EAC1B,2BAA2B,EAAE,CAC3B,KAAK,EAAE,aAAa,CAAC,KAAK,KACvB,uBAAuB,EAC5B,kBAAkB,CAAC,EAAE,CACnB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE;IACP,GAAG,EAAE,OAAO,GAAG,CAAC;IAChB,aAAa,EAAE,GAAG,CAAC;IACnB,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;IAC5C,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC;CAG5B,KACE,GAAG,GAAG,IAAI,GAAG,SAAS,GAC1B,cAAc,CAAC,MAAM,CAmGvB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeAddPgTableConditionPlugin =
|
|
3
|
+
exports.makeAddPgTableConditionPlugin = makeAddPgTableConditionPlugin;
|
|
4
|
+
const pg_1 = require("@dataplan/pg");
|
|
4
5
|
const exportable_js_1 = require("./exportable.js");
|
|
5
6
|
function makeAddPgTableConditionPlugin(match, conditionFieldName, conditionFieldSpecGenerator, conditionGenerator) {
|
|
6
7
|
const { serviceName = "main", schemaName, tableName } = match;
|
|
@@ -39,10 +40,10 @@ function makeAddPgTableConditionPlugin(match, conditionFieldName, conditionField
|
|
|
39
40
|
return fields;
|
|
40
41
|
}
|
|
41
42
|
const conditionFieldSpec = conditionFieldSpecGenerator(build);
|
|
42
|
-
if (conditionFieldSpec.
|
|
43
|
-
conditionFieldSpec.extensions?.grafast?.
|
|
43
|
+
if (conditionFieldSpec.apply ||
|
|
44
|
+
conditionFieldSpec.extensions?.grafast?.apply) {
|
|
44
45
|
if (conditionGenerator) {
|
|
45
|
-
throw new Error(`${displayName}: You supplied '
|
|
46
|
+
throw new Error(`${displayName}: You supplied 'apply' for your field spec, so you cannot also supply a 'conditionGenerator'`);
|
|
46
47
|
}
|
|
47
48
|
// Done.
|
|
48
49
|
}
|
|
@@ -51,17 +52,18 @@ function makeAddPgTableConditionPlugin(match, conditionFieldName, conditionField
|
|
|
51
52
|
throw new Error(`${displayName}: You have not supplied 'applyPlan' for your field spec, nor a 'conditionGenerator', so we don't know what to do with this condition`);
|
|
52
53
|
}
|
|
53
54
|
// build applyPlan
|
|
54
|
-
conditionFieldSpec.
|
|
55
|
+
conditionFieldSpec.apply = (0, exportable_js_1.EXPORTABLE)((build, conditionGenerator, sql, sqlValueWithCodec) => function apply(condition, val) {
|
|
55
56
|
const expression = conditionGenerator(val, {
|
|
56
|
-
$condition,
|
|
57
57
|
sql,
|
|
58
|
-
sqlTableAlias:
|
|
58
|
+
sqlTableAlias: condition.alias,
|
|
59
|
+
sqlValueWithCodec,
|
|
59
60
|
build,
|
|
61
|
+
condition,
|
|
60
62
|
});
|
|
61
63
|
if (expression) {
|
|
62
|
-
|
|
64
|
+
condition.where(expression);
|
|
63
65
|
}
|
|
64
|
-
}, [build, conditionGenerator, sql]);
|
|
66
|
+
}, [build, conditionGenerator, sql, pg_1.sqlValueWithCodec]);
|
|
65
67
|
}
|
|
66
68
|
const meta = build._pluginMeta[displayName];
|
|
67
69
|
meta.seen = true;
|
|
@@ -76,5 +78,4 @@ function makeAddPgTableConditionPlugin(match, conditionFieldName, conditionField
|
|
|
76
78
|
};
|
|
77
79
|
return plugin;
|
|
78
80
|
}
|
|
79
|
-
exports.makeAddPgTableConditionPlugin = makeAddPgTableConditionPlugin;
|
|
80
81
|
//# sourceMappingURL=makeAddPgTableConditionPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeAddPgTableConditionPlugin.js","sourceRoot":"","sources":["../src/makeAddPgTableConditionPlugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"makeAddPgTableConditionPlugin.js","sourceRoot":"","sources":["../src/makeAddPgTableConditionPlugin.ts"],"names":[],"mappings":";;AAOA,sEAoHC;AA1HD,qCAAiD;AAIjD,mDAA6C;AAE7C,SAAgB,6BAA6B,CAC3C,KAAsE,EACtE,kBAA0B,EAC1B,2BAE4B,EAC5B,kBAU2B;IAE3B,MAAM,EAAE,WAAW,GAAG,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,KAAK,CA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