Skip to content

Commit bbcc6fd

Browse files
committed
Re-enable filtering on all attributes
1 parent 227bc6a commit bbcc6fd

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

__tests__/FilterAllPlugin.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import "postgraphile";
2+
3+
export const FilterAllPlugin: GraphileConfig.Plugin = {
4+
name: "FilterAllPlugin",
5+
version: "0.0.0",
6+
7+
schema: {
8+
entityBehavior: {
9+
pgCodecAttribute: {
10+
inferred(behavior, entity, build) {
11+
return [behavior, "filterBy"];
12+
},
13+
},
14+
},
15+
},
16+
};

__tests__/integration/queries.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { SchemaResult } from "graphile-build";
2323
import { makeWithPgClientViaPgClientAlreadyInTransaction } from "@dataplan/pg/adaptors/pg";
2424
import { exportSchemaAsString } from "graphile-export";
2525
import { importFromStringSync } from "module-from-string";
26+
import { FilterAllPlugin } from "../FilterAllPlugin";
2627

2728
// TODO: remove this once Grafast gets it's planning under control :D
2829
jest.setTimeout(300000);
@@ -48,6 +49,7 @@ const createPostGraphileSchema = async (
4849
makeV4Preset(v4Options),
4950
...(anotherPreset ? [anotherPreset] : []),
5051
],
52+
plugins: [FilterAllPlugin],
5153
pgServices: [
5254
{
5355
adaptor,

__tests__/integration/schema/core.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { postgraphilePresetAmber } from "postgraphile/presets/amber";
55
import { makeV4Preset, V4Options } from "postgraphile/presets/v4";
66
import { makeSchema } from "postgraphile";
77
import { PostGraphileConnectionFilterPreset } from "../../../src/index";
8+
import { FilterAllPlugin } from "../../FilterAllPlugin";
89

910
const createPostGraphileSchema = async (
1011
pgClient: pg.PoolClient,
@@ -19,6 +20,7 @@ const createPostGraphileSchema = async (
1920
makeV4Preset(v4Options),
2021
...(anotherPreset ? [anotherPreset] : []),
2122
],
23+
plugins: [FilterAllPlugin],
2224
pgServices: [
2325
{
2426
adaptor,

0 commit comments

Comments
 (0)