Skip to content

Commit

Permalink
Merge branch 'v5' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie authored Feb 11, 2025
2 parents 1ed2866 + ecb9e9d commit b07511d
Show file tree
Hide file tree
Showing 18 changed files with 3,712 additions and 6,567 deletions.
11 changes: 8 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
node_modules
dist
.idea
/.git
/.idea
/.yarn
/.yarnrc.yml
/dist
/node_modules
/Session.vim
yarn-error.log
19 changes: 19 additions & 0 deletions __tests__/FilterAllPlugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import "postgraphile";

export const FilterAllPlugin: GraphileConfig.Plugin = {
name: "FilterAllPlugin",
version: "0.0.0",

schema: {
entityBehavior: {
pgCodecAttribute: {
inferred: {
before: ["PgIndexBehaviorsPlugin"],
callback(behavior, entity, build) {
return [behavior, "filterBy"];
},
},
},
},
},
};
5 changes: 4 additions & 1 deletion __tests__/integration/queries.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as fs from "fs";
import * as path from "path";
import * as pg from "pg";
import * as adaptor from "postgraphile/@dataplan/pg/adaptors/pg";

import { promisify } from "util";
import {
Expand All @@ -22,6 +23,7 @@ import { SchemaResult } from "graphile-build";
import { makeWithPgClientViaPgClientAlreadyInTransaction } from "@dataplan/pg/adaptors/pg";
import { exportSchemaAsString } from "graphile-export";
import { importFromStringSync } from "module-from-string";
import { FilterAllPlugin } from "../FilterAllPlugin";

// TODO: remove this once Grafast gets it's planning under control :D
jest.setTimeout(300000);
Expand All @@ -47,9 +49,10 @@ const createPostGraphileSchema = async (
makeV4Preset(v4Options),
...(anotherPreset ? [anotherPreset] : []),
],
plugins: [FilterAllPlugin],
pgServices: [
{
adaptor: "@dataplan/pg/adaptors/pg",
adaptor,
name: "main",
withPgClientKey: "withPgClient",
pgSettingsKey: "pgSettings",
Expand Down
Loading

0 comments on commit b07511d

Please sign in to comment.