npm install graphile-search-plugin
This PostGraphile schema plugin was built to enable ordering via ts_rank
of full-text search on all tsvector
fields, providing auto-generated queries within PostGraphile.
- Append the new plugins!
- Query
search<YourTsvectorColumn>
in theconditions
field - Enjoy!
import PgSearchPlugin from 'graphile-search-plugin';
app.use(
postgraphile(connectionStr, schemas, {
appendPlugins: [
PgSearchPlugin
]
})
);
Look in the tests ;)
createdb test_database
psql test_database < sql/roles.sql
psql test_database < sql/test.sql
yarn test