https://github.com/pyramation/graphile-search-plugin
https://github.com/pyramation/graphile-search-plugin
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pyramation/graphile-search-plugin
- Owner: pyramation
- License: mit
- Created: 2020-10-06T21:33:39.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-27T03:33:50.000Z (over 5 years ago)
- Last Synced: 2025-08-14T17:12:49.598Z (10 months ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# graphile-search-plugin [](https://travis-ci.org/pyramation/graphile-search-plugin)
```sh
npm install graphile-search-plugin
```
This [PostGraphile](http://postgraphile.org/) schema plugin was built to enable ordering via `ts_rank` of full-text search on all `tsvector` fields, providing auto-generated queries within PostGraphile.
## Usage
1. Append the new plugins!
2. Query `search` in the `conditions` field
3. Enjoy!
```js
import PgSearchPlugin from 'graphile-search-plugin';
app.use(
postgraphile(connectionStr, schemas, {
appendPlugins: [
PgSearchPlugin
]
})
);
```
## Examples
Look in the tests ;)
## Testing
```sh
createdb test_database
psql test_database < sql/roles.sql
psql test_database < sql/test.sql
yarn test
```