Skip to content

docs(graphile-postgis): deep spatial-relations docs; lead with client-side GeoJSON problem#995

Merged
pyramation merged 2 commits intomainfrom
feat/postgis-spatial-relations-deep-docs
Apr 18, 2026
Merged

docs(graphile-postgis): deep spatial-relations docs; lead with client-side GeoJSON problem#995
pyramation merged 2 commits intomainfrom
feat/postgis-spatial-relations-deep-docs

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

@pyramation pyramation commented Apr 17, 2026

Summary

Documentation-only rewrite of graphile/graphile-postgis/README.md to go deep on the @spatialRelation smart-tag feature and lead with why it exists.

  • New "The problem" section at the top, in plain English: client-side GeoJSON juggling → auto-generated ORMs don't know about spatial joins → we added the spatial-relation primitive so the join runs server-side.
  • Rewrote the ## Spatial relations via smart tags section with:
    • At a glance: before vs after snippet contrasting client-side point-in-polygon against a single where: { county: { some: … } } query.
    • Declaring a relation — tag grammar, target ref resolution, multiple tags on one column.
    • Operator reference table covering all 8 operators with parametric / symmetric / directional guidance.
    • Using the generated where shape — ORM and GraphQL examples, some / every / none semantics, st_dwithin + distance, composition with and / or / not.
    • Self-relations, Generated SQL shape, Indexing (with @spatialRelationSkipIndexCheck opt-out), geometry vs geography, and FAQ.
  • Terminology pass: user-facing verb is where; the word "filter" only appears where it literally names the PostGraphile-generated connection argument.
  • All code examples are sourced from the integration test (graphql/orm-test/__tests__/postgis-spatial-relations.test.ts) and its seed SQL.

No code changes to the plugin, tests, or any other package.

Review & Testing Checklist for Human

  • Spot-check the technical claims against graphile/graphile-postgis/src/plugins/spatial-relations.ts — especially the relationName regex, the existence / exact spelling of the @spatialRelationSkipIndexCheck opt-out tag, and the distance: Float! field shape.
  • Confirm the "Multiple relations on one column" SQL snippet is a valid way to stack smart tags in a COMMENT ON COLUMN body (i.e. the plugin actually parses newline-separated @spatialRelation lines the way shown).
  • Sanity-check the Operator reference symmetry / directionality column and the st_bbox_intersects&& note against the plugin's code generator.
  • Re-read "The problem" section to make sure the voice matches how you'd describe this to a user.

Notes

  • Docs-only diff; no build / lint / test changes were needed and none were run. CI will cover the usual static checks.
  • Branch renamed mid-flight from the default devin/<ts>-… to feat/postgis-spatial-relations-deep-docs per the repo's branch-naming convention.

Link to Devin session: https://app.devin.ai/sessions/059b0c2e4594474aa107e3f83f83fe0f
Requested by: @pyramation


Open with Devin

@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@pyramation pyramation merged commit 875fb9c into main Apr 18, 2026
51 checks passed
@pyramation pyramation deleted the feat/postgis-spatial-relations-deep-docs branch April 18, 2026 01:48
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant