Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
616dee9
feat: add v5-native graphile-connection-filter plugin
pyramation Mar 12, 2026
eac0208
fix: use filterFieldType instead of filterType in addConnectionFilter…
pyramation Mar 12, 2026
b1ca75d
feat: add ConnectionFilterComputedAttributesPlugin for feature parity
pyramation Mar 12, 2026
ac3d641
refactor: clean up satellite plugin dependencies on connection filter
pyramation Mar 12, 2026
5f77654
Merge origin/main into devin/1773292005-graphile-connection-filter-v5
pyramation Mar 12, 2026
b2e07e9
fix: update test imports and description quotes for graphile-connecti…
pyramation Mar 12, 2026
5744b8b
fix: add graphile-connection-filter devDep to pgvector and skip relat…
pyramation Mar 12, 2026
e8af929
feat: add optional relation filter plugins (forward + backward) with …
pyramation Mar 12, 2026
b4ff740
fix: always include relation plugins, check connectionFilterRelations…
pyramation Mar 12, 2026
28b23c4
feat: enable connectionFilterRelations in constructive preset
pyramation Mar 12, 2026
76f35f5
feat: deprecate condition argument, move search + BM25 plugins to filter
pyramation Mar 13, 2026
10ed4c4
fix: update tests and snapshots for condition deprecation
pyramation Mar 13, 2026
eb9e5b8
fix: provide correct snapshot content for CI (no condition fields)
pyramation Mar 13, 2026
5207254
fix: migrate remaining condition queries to filter, register filterBy…
pyramation Mar 13, 2026
8191c00
fix: allow empty filter objects in pgvector test, add relation filter…
pyramation Mar 13, 2026
e6bc127
fix: delete snapshot to let Jest regenerate with correct relation fil…
pyramation Mar 13, 2026
11f8873
fix: correct schema snapshot with relation filter types, smart quotes…
pyramation Mar 13, 2026
48c8332
fix: add missing blank line between UsersEdge and UserOrderBy in snap…
pyramation Mar 13, 2026
f21d0f0
fix: remove connectionFilterAllowEmptyObjectInput option, handle empt…
pyramation Mar 13, 2026
72ac8fe
feat: tighten TypeScript types in satellite filter plugins
pyramation Mar 13, 2026
58c638a
feat: add connectionFilterRelationsRequireIndex option
pyramation Mar 13, 2026
d5e48ee
feat: add dedicated test suite for graphile-connection-filter
pyramation Mar 13, 2026
5e8da67
fix: add CREATE SCHEMA to seed SQL, make logical operators check runt…
pyramation Mar 13, 2026
9a1ac81
feat: add integration test suite for ConstructivePreset
pyramation Mar 13, 2026
e14bd15
feat: add mega-query test combining BM25 + tsvector + pgvector + rela…
pyramation Mar 13, 2026
b3bdbad
refactor: consolidate CI into single job using postgres-plus:18 for a…
pyramation Mar 13, 2026
4093017
feat: add PostGIS spatial filter (geom intersects bbox) to mega query…
pyramation Mar 13, 2026
592a423
feat: add graphile-pg-trgm-plugin for pg_trgm fuzzy text matching
pyramation Mar 13, 2026
df3d6ce
fix: update schema snapshots for pg_trgm plugin additions
pyramation Mar 13, 2026
d9c8c26
docs: add multi-signal orderBy with thorough comments to mega query test
pyramation Mar 13, 2026
bc8fda5
feat: replace imperative addConnectionFilterOperator with declarative…
pyramation Mar 13, 2026
86ab1f6
fix: aggregate connectionFilterOperatorFactories in ConstructivePrese…
pyramation Mar 13, 2026
b59919a
feat: consolidate graphile-plugin-connection-filter-postgis into grap…
pyramation Mar 13, 2026
bb57932
feat: add runtime tests for array filters, declarative operator facto…
pyramation Mar 13, 2026
9691fa5
fix: correct assertion for multiple operators on same field test (49.…
pyramation Mar 13, 2026
193bf72
chore: rename plugin packages to match algorithms
pyramation Mar 13, 2026
a12ee8a
Merge origin/main into devin/1773429791-v5-filter-system-complete
pyramation Mar 13, 2026
4bf7b77
docs: fix outdated docs and rename bm25 conditionPrefix to filterPrefix
pyramation Mar 13, 2026
0f10c04
feat: rename generated fields to {column}{Algorithm}{Metric} with ded…
pyramation Mar 13, 2026
f9cd669
fix: update tsvector filter test and server-test snapshot for new nam…
pyramation Mar 13, 2026
a21fe61
fix: update schema snapshot for {column}TrgmSimilarity naming convention
pyramation Mar 13, 2026
6789edd
fix: update SIMILARITY_EMAIL orderBy enums in schema snapshot
pyramation Mar 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ jobs:
env: {}
- package: graphile/graphile-test
env: {}
- package: graphile/graphile-search-plugin
- package: graphile/graphile-tsvector
env: {}
- package: graphile/graphile-pgvector-plugin
- package: graphile/graphile-connection-filter
env: {}
- package: graphql/server-test
env: {}
Expand Down Expand Up @@ -107,6 +107,10 @@ jobs:
env: {}
- package: packages/postmaster
env: {}
- package: graphile/graphile-pgvector
env: {}
- package: graphile/graphile-settings
env: {}

env:
PGHOST: localhost
Expand Down
7 changes: 5 additions & 2 deletions GRAPHILE.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,13 @@ All Graphile RC dependencies are pinned to **exact versions** (no `^` or `~` pre
- **graphile-settings** -- Core settings/configuration for PostGraphile v5 (most deps, including the transitive peer deps `tamedevil`, `@dataplan/pg`, `@dataplan/json`, `grafserv`)
- **graphile-schema** -- Builds GraphQL SDL from PostgreSQL using PostGraphile v5
- **graphile-query** -- Executes GraphQL queries against PostGraphile v5 schemas
- **graphile-search-plugin** -- Full-text search plugin for PostGraphile v5
- **graphile-tsvector** -- Full-text search plugin for PostGraphile v5 (tsvector columns, `matches` filter, rank scoring)
- **graphile-bm25** -- BM25 ranked full-text search plugin for PostGraphile v5 (pg_textsearch auto-discovery, score fields, orderBy)
- **graphile-trgm** -- pg_trgm fuzzy text matching plugin for PostGraphile v5 (similarTo/wordSimilarTo operators, similarity scoring)
- **graphile-pgvector** -- pgvector codec + auto-discovered vector search plugin for PostGraphile v5
- **graphile-connection-filter** -- v5-native connection filter plugin (scalar, logical, array, relation, computed column filters)
- **graphile-cache** -- LRU cache with PostGraphile v5 integration
- **graphile-test** -- PostGraphile v5 testing utilities
- **graphile-pgvector-plugin** -- pgvector codec + auto-discovered vector search plugin for PostGraphile v5

### `graphql/` packages

Expand Down
6 changes: 3 additions & 3 deletions functions/send-email-link/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const app = createJobApp();

const GetUser = gql`
query GetUser($userId: UUID!) {
users(condition: { id: $userId }, first: 1) {
users(filter: { id: { equalTo: $userId } }, first: 1) {
nodes {
username
displayName
Expand All @@ -26,7 +26,7 @@ const GetUser = gql`

const GetDatabaseInfo = gql`
query GetDatabaseInfo($databaseId: UUID!) {
databases(condition: { id: $databaseId }, first: 1) {
databases(filter: { id: { equalTo: $databaseId } }, first: 1) {
nodes {
sites {
nodes {
Expand All @@ -43,7 +43,7 @@ const GetDatabaseInfo = gql`
theme
}
}
siteModules(condition: { name: "legal_terms_module" }) {
siteModules(filter: { name: { equalTo: "legal_terms_module" } }) {
nodes {
data
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# graphile-pg-textsearch-plugin
# graphile-bm25

<p align="center" width="100%">
<img height="250" src="https://raw.githubusercontent.com/constructive-io/constructive/refs/heads/main/assets/outline-logo.svg" />
Expand All @@ -11,23 +11,23 @@
<a href="https://github.com/constructive-io/constructive/blob/main/LICENSE">
<img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/>
</a>
<a href="https://www.npmjs.com/package/graphile-pg-textsearch-plugin">
<img height="20" src="https://img.shields.io/github/package-json/v/constructive-io/constructive?filename=graphile%2Fgraphile-pg-textsearch-plugin%2Fpackage.json"/>
<a href="https://www.npmjs.com/package/graphile-bm25">
<img height="20" src="https://img.shields.io/github/package-json/v/constructive-io/constructive?filename=graphile%2Fgraphile-bm25%2Fpackage.json"/>
</a>
</p>

**`graphile-pg-textsearch-plugin`** enables auto-discovered BM25 ranked full-text search for PostGraphile v5 schemas using [pg_textsearch](https://github.com/timescale/pg_textsearch).
**`graphile-bm25`** enables auto-discovered BM25 ranked full-text search for PostGraphile v5 schemas using [pg_textsearch](https://github.com/timescale/pg_textsearch).

## Installation

```sh
npm install graphile-pg-textsearch-plugin
npm install graphile-bm25
```

## Features

- **Auto-discovery**: Finds all text columns with BM25 indexes automatically — zero configuration
- **Condition fields**: `bm25<Column>` condition inputs accepting `{ query, threshold? }` for BM25 ranked search
- **Filter fields**: `bm25<Column>` filter inputs accepting `{ query, threshold? }` for BM25 ranked search
- **Score fields**: `bm25<Column>Score` computed fields returning BM25 relevance scores (negative values, more negative = more relevant)
- **OrderBy**: `BM25_<COLUMN>_SCORE_ASC/DESC` enum values for sorting by relevance
- Works with PostGraphile v5 preset/plugin pipeline
Expand All @@ -37,7 +37,7 @@ npm install graphile-pg-textsearch-plugin
### With Preset (Recommended)

```typescript
import { Bm25SearchPreset } from 'graphile-pg-textsearch-plugin';
import { Bm25SearchPreset } from 'graphile-bm25';

const preset = {
extends: [
Expand All @@ -50,7 +50,7 @@ const preset = {
### With Plugin Directly

```typescript
import { Bm25CodecPlugin, Bm25SearchPlugin } from 'graphile-pg-textsearch-plugin';
import { Bm25CodecPlugin, Bm25SearchPlugin } from 'graphile-bm25';

const preset = {
plugins: [
Expand All @@ -64,12 +64,12 @@ const preset = {

```graphql
query SearchArticles($search: Bm25SearchInput!) {
articles(condition: { bm25Body: $search }) {
articles(filter: { bm25Body: $search }) {
nodes {
id
title
body
bm25BodyScore
bodyBm25Score
}
}
}
Expand All @@ -91,13 +91,13 @@ Variables:
```graphql
query SearchArticlesSorted($search: Bm25SearchInput!) {
articles(
condition: { bm25Body: $search }
orderBy: BM25_BODY_SCORE_ASC
filter: { bm25Body: $search }
orderBy: BODY_BM25_SCORE_ASC
) {
nodes {
id
title
bm25BodyScore
bodyBm25Score
}
}
}
Expand All @@ -118,6 +118,6 @@ CREATE INDEX articles_body_idx ON articles USING bm25(body)

```sh
# requires constructiveio/postgres-plus:18 Docker image with pg_textsearch pre-installed
pnpm --filter graphile-pg-textsearch-plugin test
pnpm --filter graphile-bm25 test
```

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "graphile-pg-textsearch-plugin",
"name": "graphile-bm25",
"version": "1.5.3",
"description": "PostGraphile v5 plugin for pg_textsearch BM25 ranked full-text search — auto-discovers BM25 indexes and adds search condition, score, orderBy, and filter fields",
"author": "Constructive <developers@constructive.io>",
Expand Down Expand Up @@ -31,6 +31,7 @@
"devDependencies": {
"@types/node": "^22.19.11",
"@types/pg": "^8.18.0",
"graphile-connection-filter": "workspace:^",
"graphile-test": "workspace:^",
"makage": "^0.1.10",
"pg": "^8.19.0",
Expand All @@ -43,13 +44,7 @@
"graphile-config": "1.0.0-rc.5",
"graphql": "^16.9.0",
"pg-sql2": "5.0.0-rc.4",
"postgraphile": "5.0.0-rc.7",
"postgraphile-plugin-connection-filter": "3.0.0-rc.1"
},
"peerDependenciesMeta": {
"postgraphile-plugin-connection-filter": {
"optional": true
}
"postgraphile": "5.0.0-rc.7"
},
"keywords": [
"postgraphile",
Expand Down
Loading
Loading