Commit 78610ae
committed
fix(graphile-postgis): camelCase @spatialRelation field + PascalCase filter type
The generated GraphQL for a @spatialRelation tag like
'@spatialRelation inside_neighborhood neighborhoods.geom st_within'
used to produce a field and type whose casing passed through the raw
tag identifier verbatim:
inside_neighborhood?: PlaceSpatialInside_neighborhoodFilter;
Normalize the relation name through the standard Graphile inflectors so
the GraphQL identifiers follow the same conventions as every other
generated field/type:
insideNeighborhood?: PlaceSpatialInsideNeighborhoodFilter;
Also camelCase the parametric arg name (e.g. 'travel_distance' →
'travelDistance') on parametric ops (st_dwithin). Added a unit test
that pins this behavior.
While here, re-export graphile-connection-filter's declaration-merge
augmentations from its package entry so that satellite plugins (like
graphile-postgis) that type-only import the package actually pick up
the Inflection.filterType/filterManyType augmentations the file
already declared — the satellite plugin was previously relying on an
augmentation chain that was never loaded via the public barrel, which
produced TS2339 errors during typecheck.1 parent 01775e1 commit 78610ae
3 files changed
Lines changed: 52 additions & 3 deletions
File tree
- graphile
- graphile-connection-filter/src
- graphile-postgis
- __tests__
- src/plugins
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
52 | 59 | | |
53 | 60 | | |
54 | 61 | | |
| |||
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
70 | 77 | | |
71 | 78 | | |
| 79 | + | |
72 | 80 | | |
73 | 81 | | |
74 | 82 | | |
| |||
289 | 297 | | |
290 | 298 | | |
291 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
292 | 321 | | |
293 | 322 | | |
294 | 323 | | |
| |||
Lines changed: 16 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
325 | 332 | | |
326 | 333 | | |
327 | 334 | | |
| |||
400 | 407 | | |
401 | 408 | | |
402 | 409 | | |
403 | | - | |
| 410 | + | |
404 | 411 | | |
405 | 412 | | |
406 | 413 | | |
| |||
431 | 438 | | |
432 | 439 | | |
433 | 440 | | |
434 | | - | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
435 | 445 | | |
436 | 446 | | |
437 | 447 | | |
| |||
638 | 648 | | |
639 | 649 | | |
640 | 650 | | |
641 | | - | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
642 | 655 | | |
643 | 656 | | |
644 | 657 | | |
| |||
0 commit comments