@spacefill/postgraphile-plugin-unaccented-text-search-filter
v0.0.1
Published
Unaccuated search filtering on PostGraphile connections
Downloads
7
Readme
postgraphile-plugin-unaccented-text-search-filter
Adds unaccent string filtering capabilities to a PostGraphile schema.
This plugin extends the postgraphile-plugin-connection-filter plugin with unaccentuated text filter operators.
This plugin supports filtering on all PostgreSQL string types: char
, varchar
,
text
.
Plugin Options
When using PostGraphile as a library, many options can be passed via
graphileBuildOptions
. See here
for more information.
Examples
query {
allPosts(filter: {
body: { includesUnaccentInsensitive: "Solidarité" }
}) {
...
}
}
For an extensive set of examples, see docs/examples.md.
Development
To establish a test environment, create an empty PostgreSQL database with C
collation (required for consistent ordering of strings) and set a
TEST_DATABASE_URL
environment variable with your database connection string.
createdb graphile_test_c --template template0 --lc-collate C
export TEST_DATABASE_URL=postgres://localhost:5432/graphile_test_c
yarn
yarn test
You can also use a language specific ICU collation by changing C
to the
wanted collation, e.g. "fr-x-icu"
for French collation.