graphile-test 2.1.2 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -87,17 +87,17 @@ Once set, these will be automatically picked up by `graphile-test` when establis
87
87
 
88
88
  * [launchql/pgsql-test](https://github.com/launchql/launchql/tree/main/packages/pgsql-test): **📊 Isolated testing environments** with per-test transaction rollbacks—ideal for integration tests, complex migrations, and RLS simulation.
89
89
  * [launchql/graphile-test](https://github.com/launchql/launchql/tree/main/packages/graphile-test): **🔐 Authentication mocking** for Graphile-focused test helpers and emulating row-level security contexts.
90
+ * [launchql/pg-query-context](https://github.com/launchql/launchql/tree/main/packages/pg-query-context): **🔒 Session context injection** to add session-local context (e.g., `SET LOCAL`) into queries—ideal for setting `role`, `jwt.claims`, and other session settings.
90
91
 
91
92
  ### 🧠 Parsing & AST
92
93
 
93
94
  * [launchql/pgsql-parser](https://github.com/launchql/pgsql-parser): **🔄 SQL conversion engine** that interprets and converts PostgreSQL syntax.
94
95
  * [launchql/libpg-query-node](https://github.com/launchql/libpg-query-node): **🌉 Node.js bindings** for `libpg_query`, converting SQL into parse trees.
96
+ * [launchql/pg-proto-parser](https://github.com/launchql/pg-proto-parser): **📦 Protobuf parser** for parsing PostgreSQL Protocol Buffers definitions to generate TypeScript interfaces, utility functions, and JSON mappings for enums.
95
97
  * [@pgsql/enums](https://github.com/launchql/pgsql-parser/tree/main/packages/enums): **🏷️ TypeScript enums** for PostgreSQL AST for safe and ergonomic parsing logic.
96
98
  * [@pgsql/types](https://github.com/launchql/pgsql-parser/tree/main/packages/types): **📝 Type definitions** for PostgreSQL AST nodes in TypeScript.
97
99
  * [@pgsql/utils](https://github.com/launchql/pgsql-parser/tree/main/packages/utils): **🛠️ AST utilities** for constructing and transforming PostgreSQL syntax trees.
98
100
  * [launchql/pg-ast](https://github.com/launchql/launchql/tree/main/packages/pg-ast): **🔍 Low-level AST tools** and transformations for Postgres query structures.
99
- * [launchql/pg-proto-parser](https://github.com/launchql/pg-proto-parser): **📦 Protobuf parser** for parsing PostgreSQL Protocol Buffers definitions to generate TypeScript interfaces, utility functions, and JSON mappings for enums.
100
- * [launchql/pg-query-context](https://github.com/launchql/launchql/tree/main/packages/pg-query-context): **🔒 Session context injection** to add session-local context (e.g., `SET LOCAL`) into queries—ideal for setting `role`, `jwt.claims`, and other session settings.
101
101
 
102
102
  ### 🚀 API & Dev Tools
103
103
 
@@ -89,7 +89,7 @@ export const GraphQLTest = ({ dbname, schemas, authRole = 'authenticated' }) =>
89
89
  }
90
90
  });
91
91
  };
92
- const graphQLQuery = async (...args) => {
92
+ async function graphQLQuery(...args) {
93
93
  if (!ctx)
94
94
  throw new Error('Context is not initialized. Did you run setup()?');
95
95
  let reqOptions = {};
@@ -160,7 +160,8 @@ export const GraphQLTest = ({ dbname, schemas, authRole = 'authenticated' }) =>
160
160
  replacementPgClient.release();
161
161
  }
162
162
  });
163
- };
163
+ }
164
+ ;
164
165
  return {
165
166
  setup,
166
167
  teardown,
@@ -1,3 +1,4 @@
1
+ import { DocumentNode } from 'graphql';
1
2
  export interface GraphQLTestOptions {
2
3
  dbname: string;
3
4
  schemas: string[];
@@ -7,6 +8,13 @@ export declare const GraphQLTest: ({ dbname, schemas, authRole }: GraphQLTestOpt
7
8
  setup: () => Promise<void>;
8
9
  teardown: () => Promise<void>;
9
10
  graphQL: (...args: any[]) => Promise<any>;
10
- graphQLQuery: (...args: any[]) => Promise<any>;
11
+ graphQLQuery: {
12
+ (Query: string | DocumentNode): Promise<any>;
13
+ (Query: string | DocumentNode, commit: boolean): Promise<any>;
14
+ (Query: string | DocumentNode, vars: Record<string, any>): Promise<any>;
15
+ (Query: string | DocumentNode, vars: Record<string, any>, commit: boolean): Promise<any>;
16
+ (reqOptions: Record<string, any>, Query: string | DocumentNode, vars: Record<string, any>): Promise<any>;
17
+ (reqOptions: Record<string, any>, Query: string | DocumentNode, vars: Record<string, any>, commit: boolean): Promise<any>;
18
+ };
11
19
  withContext: <T>(cb: (ctx: typeof ctx) => T) => T;
12
20
  };
package/graphile-test.js CHANGED
@@ -95,7 +95,7 @@ const GraphQLTest = ({ dbname, schemas, authRole = 'authenticated' }) => {
95
95
  }
96
96
  });
97
97
  };
98
- const graphQLQuery = async (...args) => {
98
+ async function graphQLQuery(...args) {
99
99
  if (!ctx)
100
100
  throw new Error('Context is not initialized. Did you run setup()?');
101
101
  let reqOptions = {};
@@ -166,7 +166,8 @@ const GraphQLTest = ({ dbname, schemas, authRole = 'authenticated' }) => {
166
166
  replacementPgClient.release();
167
167
  }
168
168
  });
169
- };
169
+ }
170
+ ;
170
171
  return {
171
172
  setup,
172
173
  teardown,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphile-test",
3
- "version": "2.1.2",
3
+ "version": "2.1.4",
4
4
  "author": "Dan Lynch <pyramation@gmail.com>",
5
5
  "description": "PostGraphile Testing",
6
6
  "main": "index.js",
@@ -34,12 +34,12 @@
34
34
  "graphql-tag": "2.12.6"
35
35
  },
36
36
  "dependencies": {
37
- "@launchql/graphile-settings": "^2.1.2",
38
- "@launchql/types": "^2.1.2",
37
+ "@launchql/graphile-settings": "^2.1.4",
38
+ "@launchql/types": "^2.1.4",
39
39
  "graphql": "^15.5.2",
40
40
  "mock-req": "^0.2.0",
41
41
  "pg": "^8.16.0",
42
42
  "postgraphile": "^4.14.1"
43
43
  },
44
- "gitHead": "213912ee7e39ca3d755029b8cd5e3b548324c13f"
44
+ "gitHead": "4dbc5c03940d1a6645bb9e5c0f5423dcda47a068"
45
45
  }