Skip to content

feat: add graphile-authz and postgraphile-plugin-pgvector packages#683

Merged
pyramation merged 5 commits intodevelop-v5from
devin/1770256347-graphile-plugins
Feb 5, 2026
Merged

feat: add graphile-authz and postgraphile-plugin-pgvector packages#683
pyramation merged 5 commits intodevelop-v5from
devin/1770256347-graphile-plugins

Conversation

@pyramation
Copy link
Contributor

@pyramation pyramation commented Feb 5, 2026

Summary

This PR adds two PostGraphile v5 plugins from the graphile repo and removes two deprecated packages:

Added:

  • graphile-authz - Authorization plugin with declarative rules and SQL WHERE clause generation for row-level security. Supports DirectOwner, Membership, OrgHierarchy, Temporal, Publishable, and Composite authorization patterns. 66 tests passing.
  • postgraphile-plugin-pgvector - Vector similarity search plugin supporting COSINE, L2, and IP distance metrics. 9 tests passing.

Removed:

  • graphile-plugin-connection-filter - Use community version postgraphile-plugin-connection-filter@^3.0.0-rc.1 if needed
  • graphile-simple-inflector - Already inlined in graphile-settings as CustomInflectorPlugin

Both new packages are enabled in the GitHub workflow test matrix.

Updates since last revision

  • Fixed pgvector plugin to use Grafast step-based API - Converted from traditional GraphQL resolver pattern to Grafast's lambda, context, and object steps. All 9 tests now pass.
  • Added jest.config.js for both packages (required for ts-jest to handle TypeScript imports)
  • Fixed pgvector test imports to use pgsql-test for PgTestClient type
  • Added pgsql-test as devDependency for pgvector package
  • Merged develop-v5 to resolve pnpm-lock.yaml conflict

Review & Testing Checklist for Human

  • Verify no other packages in the workspace import graphile-plugin-connection-filter or graphile-simple-inflector
  • Review pgvector Grafast step implementation in graphile/postgraphile-plugin-pgvector/src/plugin.ts - uses lambda step with grafastContext() to access withPgClient
  • Note: pgvector uses sql.raw for dynamic SQL which generates a warning - this is intentional for building the vector search query

Recommended test plan:

  1. Run pnpm build locally to verify no import errors from deleted packages
  2. Run cd graphile/graphile-authz && pnpm test to verify 66 authz tests pass
  3. Run cd graphile/postgraphile-plugin-pgvector && pnpm test to verify 9 pgvector tests pass

Notes

The graphile-authz package tests are unit tests that verify the SQL generation and rule matching logic without database integration.

The pgvector plugin now uses Grafast's step-based API (lambda, object, context) instead of traditional GraphQL resolvers, which is required for PostGraphile v5 compatibility.

Link to Devin run: https://app.devin.ai/sessions/ba45b64c92bb4307bf9e920123213d9e
Requested by: Dan Lynch (@pyramation)

- Add graphile-authz: authorization plugin with declarative rules and SQL generation
- Add postgraphile-plugin-pgvector: vector similarity search plugin
- Delete graphile-plugin-connection-filter (use community version if needed)
- Delete graphile-simple-inflector (inlined in graphile-settings)
- Enable both new plugins in GitHub workflow
…nflector

- graphile-plugin-connection-filter: use community version postgraphile-plugin-connection-filter@^3.0.0-rc.1 if needed
- graphile-simple-inflector: already inlined in graphile-settings as CustomInflectorPlugin
@devin-ai-integration
Copy link
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

- Add jest.config.js for graphile-authz (66 tests passing)
- Add jest.config.js for postgraphile-plugin-pgvector
- Fix pgvector test imports (use pgsql-test for PgTestClient)
- Add pgsql-test as devDependency for pgvector

Note: pgvector tests fail due to plugin using traditional resolver
instead of Grafast steps - needs conversion to v5 step-based API
- Replace traditional resolve function with Grafast plan function
- Use lambda step with grafastContext() to access withPgClient
- Use object step to combine field arguments
- All 9 pgvector tests now pass
@pyramation pyramation merged commit 16e1456 into develop-v5 Feb 5, 2026
13 checks passed
@pyramation pyramation deleted the devin/1770256347-graphile-plugins branch February 5, 2026 02:33
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