Skip to content

fix: upgrade graphile ecosystem to latest RC versions with compatibility fixes#820

Merged
pyramation merged 6 commits intomainfrom
upgrades/deps-3-14
Mar 15, 2026
Merged

fix: upgrade graphile ecosystem to latest RC versions with compatibility fixes#820
pyramation merged 6 commits intomainfrom
upgrades/deps-3-14

Conversation

@pyramation
Copy link
Contributor

@pyramation pyramation commented Mar 15, 2026

Summary

Upgrades all graphile ecosystem packages to the latest compatible pinned RC versions and fixes breaking changes introduced in graphile-build-pg@5.0.0-rc.8.

Version Alignment

All graphile deps pinned (no ^) to the versions shipped with postgraphile@5.0.0-rc.10:

Package Old New
postgraphile 5.0.0-rc.7 5.0.0-rc.10
@dataplan/pg 1.0.0-rc.5 1.0.0-rc.8
grafast 1.0.0-rc.7 1.0.0-rc.9
graphile-build-pg 5.0.0-rc.5 5.0.0-rc.8
graphile-build 5.0.0-rc.4 5.0.0-rc.6
graphile-config 1.0.0-rc.5 1.0.0-rc.6
pg-sql2 5.0.0-rc.4 5.0.0-rc.5
graphile-utils 5.0.0-rc.5 5.0.0-rc.8
grafserv 1.0.0-rc.6 1.0.0-rc.7
tamedevil 0.1.0-rc.4 0.1.0-rc.6
@graphile-contrib/pg-many-to-many 2.0.0-rc.1 2.0.0-rc.2

Breaking Change Fixes

1. Null guards in custom-inflector.ts

graphile-build-pg@5.0.0-rc.8 now calls inflectors for ref-based relations where registry.pgRelations[codec.name]?.[relationName] returns undefined. Added null guards to singleRelation, singleRelationBackwards, _manyRelation, and _manyToManyRelation that fall back to PostGraphile's default behavior when the relation is undefined. Also fixed missing optional chaining on relation.extensions?.tags?.foreignFieldName.

2. tsvector codec compatibility in graphile-search

graphile-build-pg@5.0.0-rc.8 added built-in tsvector/tsquery support (crystal#2954) which:

  • Uses TYPES.tsvector from @dataplan/pg (has extensions: { oid } but no extensions.pg)
  • Hides tsvector columns by default via PgAttributesPlugin.HIDE_BY_DEFAULT

Fixed by:

  • Updating isTsvectorCodec() to also match by codec.name === 'tsvector'
  • Adding entity behavior to re-enable tsvector columns that rc.8 hides by default, so search plugins can detect and use them

3. Updated csv-to-pg test snapshots

The pgsql-deparser dependency was updated as part of the lockfile refresh, changing SQL output formatting. Updated 7 snapshots in export.test.ts to match the new deparser output.

Review & Testing Checklist for Human

  • Verify tsvector search works end-to-end: The isTsvectorCodec() broadened check (codec.name === 'tsvector') and the entity behavior that re-enables hidden tsvector columns are the riskiest changes. Run the graphile-search and graphile-settings test suites locally to verify tsvTsv filter fields appear correctly.
  • Verify custom inflector null guards don't affect naming: The return previous!(details) fallback delegates to PostGraphile defaults for ref-based relations. Check that relation field names in the generated schema haven't changed unexpectedly.
  • Spot-check the lockfile: The pnpm-lock.yaml changes are large. Verify no duplicate graphile package versions are resolved (the original bug was caused by rc.5 and rc.8 of @dataplan/pg coexisting).
  • Review csv-to-pg snapshot diff: The snapshot changes should be purely formatting (from pgsql-deparser update). Verify the SQL semantics are unchanged.

Notes

  • CI: 42/42 checks pass (all green).
  • The TsvectorCodecPlugin gather hook is now effectively a no-op on rc.8+ (the built-in PgCodecsPlugin handles tsvector first), but is kept for backward compatibility.
  • Version compatibility confirmed via the postgraphile@5.0.0-rc.10 changelog.

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

… versions

Updated all packages to use consistent pinned versions:
- postgraphile: 5.0.0-rc.10
- @dataplan/pg: 1.0.0-rc.8
- @dataplan/json: 1.0.0-rc.6
- grafast: 1.0.0-rc.9
- grafserv: 1.0.0-rc.7
- graphile-build: 5.0.0-rc.6
- graphile-build-pg: 5.0.0-rc.8
- graphile-config: 1.0.0-rc.6
- graphile-utils: 5.0.0-rc.8
- pg-sql2: 5.0.0-rc.5
- tamedevil: 0.1.0-rc.6
- @graphile-contrib/pg-many-to-many: 2.0.0-rc.2

This resolves the type incompatibility where multiple versions of
@dataplan/pg were being resolved (rc.5 and rc.8), causing PgExecutor
private property conflicts during TypeScript compilation.
In graphile-build-pg@5.0.0-rc.8, the inflector can be called for
relations where registry.pgRelations[codec.name]?.[relationName]
returns undefined (e.g. ref-based relations). Added null guards to
singleRelation, singleRelationBackwards, _manyRelation, and
_manyToManyRelation to fall back to the default inflector when the
relation lookup fails.
…dec support

In graphile-build-pg@5.0.0-rc.8, tsvector/tsquery codecs are now handled
natively via TYPES.tsvector from @dataplan/pg, and PgAttributesPlugin
HIDE_BY_DEFAULT hides tsvector columns by default.

Changes:
- Update isTsvectorCodec() to match built-in TYPES.tsvector by codec name
  (the built-in codec has extensions: { oid } but no extensions.pg)
- Add entityBehavior to re-enable tsvector columns that rc.8 hides,
  overriding HIDE_BY_DEFAULT so search plugins can detect and use them
- Update TsvectorCodecPlugin docs to reflect rc.8 compatibility
@devin-ai-integration devin-ai-integration bot changed the title pkg fix: upgrade graphile ecosystem to latest RC versions with compatibility fixes Mar 15, 2026
@pyramation pyramation merged commit 0483dd9 into main Mar 15, 2026
44 checks passed
@pyramation pyramation deleted the upgrades/deps-3-14 branch March 15, 2026 04:55
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