Skip to content

Instantly share code, notes, and snippets.

View benjie's full-sized avatar

Benjie benjie

View GitHub Profile
@benjie
benjie / postgraphile-tsv-plugin.js
Last active June 24, 2018 07:30 — forked from mlipscombe/postgraphile-tsv-plugin.js
full text search plugin for postgraphile (edited)
const TSVECTOR_TYPE_ID = 3614;
export const PostGraphileTSVPlugin = builder => {
builder.hook('infection', (inflection, build) => {
return build.extend(inflection, {
fullTextScalarTypeName() {
return `FullText`;
},
pgTsvRank(fieldName) {
return this.camelCase(`${fieldName}-rank`);