Skip to content

Commit b07511d

Browse files
authored
Merge branch 'v5' into patch-1
2 parents 1ed2866 + ecb9e9d commit b07511d

18 files changed

+3712
-6567
lines changed

.gitignore

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
node_modules
2-
dist
3-
.idea
1+
/.git
2+
/.idea
3+
/.yarn
4+
/.yarnrc.yml
5+
/dist
6+
/node_modules
7+
/Session.vim
8+
yarn-error.log

__tests__/FilterAllPlugin.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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: {
11+
before: ["PgIndexBehaviorsPlugin"],
12+
callback(behavior, entity, build) {
13+
return [behavior, "filterBy"];
14+
},
15+
},
16+
},
17+
},
18+
},
19+
};

__tests__/integration/queries.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as fs from "fs";
22
import * as path from "path";
33
import * as pg from "pg";
4+
import * as adaptor from "postgraphile/@dataplan/pg/adaptors/pg";
45

56
import { promisify } from "util";
67
import {
@@ -22,6 +23,7 @@ import { SchemaResult } from "graphile-build";
2223
import { makeWithPgClientViaPgClientAlreadyInTransaction } from "@dataplan/pg/adaptors/pg";
2324
import { exportSchemaAsString } from "graphile-export";
2425
import { importFromStringSync } from "module-from-string";
26+
import { FilterAllPlugin } from "../FilterAllPlugin";
2527

2628
// TODO: remove this once Grafast gets it's planning under control :D
2729
jest.setTimeout(300000);
@@ -47,9 +49,10 @@ const createPostGraphileSchema = async (
4749
makeV4Preset(v4Options),
4850
...(anotherPreset ? [anotherPreset] : []),
4951
],
52+
plugins: [FilterAllPlugin],
5053
pgServices: [
5154
{
52-
adaptor: "@dataplan/pg/adaptors/pg",
55+
adaptor,
5356
name: "main",
5457
withPgClientKey: "withPgClient",
5558
pgSettingsKey: "pgSettings",

0 commit comments

Comments
 (0)