fix(codegen): add GeoJSONFilter for PostGIS geometry/geography fields#793
Closed
pyramation wants to merge 2 commits intomainfrom
Closed
fix(codegen): add GeoJSONFilter for PostGIS geometry/geography fields#793pyramation wants to merge 2 commits intomainfrom
pyramation wants to merge 2 commits intomainfrom
Conversation
Adds GeoJSON/Geometry/GeometryPoint/Point → GeoJSONFilter mapping to SCALAR_FILTER_MAP so PostGIS geometry columns appear in generated filter types instead of being silently omitted. Changes: - Add GeoJSON, Geometry, GeometryPoint, Point to SCALAR_FILTER_MAP - Add GeoJSONFilter config with equality/distinct operators - Add GeoJSONFilter unit test - Add PostGIS schema fixture (example-postgis.schema.graphql) - Add 13 PostGIS integration tests (Place/Route with GeoJSON columns) - Update 14 snapshots to include GeoJSONFilter
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(codegen): add GeoJSONFilter for PostGIS geometry/geography fields
Summary
Previously, PostGIS geometry columns (GeoJSON, Geometry, GeometryPoint, Point) were present in
SCALAR_TS_MAP(mapped tounknown) but had no entry inSCALAR_FILTER_MAP. This caused geometry columns to be silently omitted from generated filter types — so you couldn't even doisNullchecks on geometry fields through the generated TypeScript SDK.This PR adds:
SCALAR_FILTER_MAP:GeoJSON,Geometry,GeometryPoint,Point→GeoJSONFilterSCALAR_FILTER_CONFIGS:GeoJSONFilterwithequality+distinctoperators (isNull,equalTo,notEqualTo,distinctFrom,notDistinctFrom), typed asunknownGeoJSONFiltergenerationexample-postgis.schema.graphql) withPlace/Routeentities containingGeoJSONcolumnsScope note: This does NOT add PostGIS spatial operators (
contains,intersects,within, etc.) — those are provided at runtime bypostgraphile-plugin-connection-filter-postgisand would require a more complex codegen approach. This PR only ensures geometry columns aren't dropped from filter types entirely.Review & Testing Checklist for Human
unknownis the right TS type for GeoJSON filter values.equalTo?: unknownprovides no type safety. Consider whether this should beRecord<string, unknown>or a GeoJSON-specific type. The precedent is thatSCALAR_TS_MAPalready maps GeoJSON→unknown, so this is consistent — but it's a design choice worth affirming.example-postgis.schema.graphqlis hand-crafted. Compare the shape (especiallyPlaceFilter.location: GeoJSONFilter) against what PostGraphile actually generates for a table with ageometrycolumn whengraphile-postgisandconnection-filter-postgisplugins are loaded.GeoJSONFilterinterface block afterVectorFilter. No other snapshot content should have changed.Notes