graphql-server-test 3.3.2 → 3.4.0
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 +6 -6
- package/esm/get-connections.js +3 -3
- package/get-connections.js +3 -3
- package/package.json +9 -9
- package/types.d.ts +2 -2
package/README.md
CHANGED
|
@@ -181,7 +181,7 @@ The `server.api` option provides full control over the GraphQL server configurat
|
|
|
181
181
|
|
|
182
182
|
| Property | Type | Default | Description |
|
|
183
183
|
|----------|------|---------|-------------|
|
|
184
|
-
| `
|
|
184
|
+
| `routingSchema` | `string` | `routing_public` | Schema that owns `resolve_route()` and the routing tables |
|
|
185
185
|
| `exposedSchemas` | `string[]` | from `schemas` | Database schemas to expose (overridden by `schemas`) |
|
|
186
186
|
| `anonRole` | `string` | from `authRole` | Anonymous role name (overridden by `authRole`) |
|
|
187
187
|
| `roleName` | `string` | from `authRole` | Default role name (overridden by `authRole`) |
|
|
@@ -190,12 +190,12 @@ The `server.api` option provides full control over the GraphQL server configurat
|
|
|
190
190
|
|
|
191
191
|
The convenience properties (`schemas`, `authRole`) take precedence over corresponding values in `server.api`.
|
|
192
192
|
|
|
193
|
-
### Choosing the server (`server.
|
|
193
|
+
### Choosing the server (`server.useRouting`)
|
|
194
194
|
|
|
195
195
|
The harness runs suites against one of two servers:
|
|
196
196
|
|
|
197
|
-
- `server.
|
|
198
|
-
- `server.
|
|
197
|
+
- `server.useRouting: true` (default) — the production `@constructive-io/graphql-server`. Every request resolves through the scoped-routing plane, so the suite must seed real routing/database records and use a real database id.
|
|
198
|
+
- `server.useRouting: false` — the single-tenant `@constructive-io/graphql-dev-server` (pure PostGraphile, no routing, no database id). It exposes the configured schemas directly and is for local/static suites only.
|
|
199
199
|
|
|
200
200
|
```typescript
|
|
201
201
|
// Basic usage with convenience properties
|
|
@@ -208,7 +208,7 @@ const { query } = await getConnections({
|
|
|
208
208
|
const { query } = await getConnections({
|
|
209
209
|
schemas: ['app_public'],
|
|
210
210
|
server: {
|
|
211
|
-
|
|
211
|
+
useRouting: false
|
|
212
212
|
}
|
|
213
213
|
});
|
|
214
214
|
|
|
@@ -219,7 +219,7 @@ const { query } = await getConnections({
|
|
|
219
219
|
server: {
|
|
220
220
|
port: 5555,
|
|
221
221
|
host: 'localhost',
|
|
222
|
-
|
|
222
|
+
useRouting: true,
|
|
223
223
|
api: {
|
|
224
224
|
isPublic: false,
|
|
225
225
|
metaSchemas: ['constructive_routing_public', 'metaschema_public']
|
package/esm/get-connections.js
CHANGED
|
@@ -50,9 +50,9 @@ export const getConnections = async (input, seedAdapters) => {
|
|
|
50
50
|
});
|
|
51
51
|
// Start the HTTP server. Suites default to the production scoped-routing
|
|
52
52
|
// server; static/single-tenant suites opt into the dev server with
|
|
53
|
-
// `server.
|
|
54
|
-
const
|
|
55
|
-
const server =
|
|
53
|
+
// `server.useRouting: false`.
|
|
54
|
+
const useRouting = input.server?.useRouting ?? true;
|
|
55
|
+
const server = useRouting
|
|
56
56
|
? await createTestServer(serverOpts, input.server)
|
|
57
57
|
: await createDevTestServer(serverOpts, input.server);
|
|
58
58
|
// Create SuperTest agent
|
package/get-connections.js
CHANGED
|
@@ -53,9 +53,9 @@ const getConnections = async (input, seedAdapters) => {
|
|
|
53
53
|
});
|
|
54
54
|
// Start the HTTP server. Suites default to the production scoped-routing
|
|
55
55
|
// server; static/single-tenant suites opt into the dev server with
|
|
56
|
-
// `server.
|
|
57
|
-
const
|
|
58
|
-
const server =
|
|
56
|
+
// `server.useRouting: false`.
|
|
57
|
+
const useRouting = input.server?.useRouting ?? true;
|
|
58
|
+
const server = useRouting
|
|
59
59
|
? await (0, server_1.createTestServer)(serverOpts, input.server)
|
|
60
60
|
: await (0, server_1.createDevTestServer)(serverOpts, input.server);
|
|
61
61
|
// Create SuperTest agent
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphql-server-test",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "Constructive GraphQL Server Testing with SuperTest HTTP requests",
|
|
6
6
|
"main": "index.js",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@0no-co/graphql.web": "^1.2.0",
|
|
33
33
|
"@agentic-kit/ollama": "2.4.2",
|
|
34
|
-
"@constructive-io/graphql-codegen": "^5.
|
|
35
|
-
"@constructive-io/graphql-query": "^4.
|
|
34
|
+
"@constructive-io/graphql-codegen": "^5.3.0",
|
|
35
|
+
"@constructive-io/graphql-query": "^4.2.0",
|
|
36
36
|
"@types/express": "^5.0.6",
|
|
37
37
|
"@types/pg": "^8.20.0",
|
|
38
38
|
"@types/supertest": "^7.2.0",
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
"nested-obj": "^0.2.2"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@constructive-io/graphql-dev-server": "^3.
|
|
47
|
-
"@constructive-io/graphql-env": "^3.
|
|
48
|
-
"@constructive-io/graphql-server": "^5.
|
|
49
|
-
"@constructive-io/graphql-types": "^3.
|
|
46
|
+
"@constructive-io/graphql-dev-server": "^3.4.0",
|
|
47
|
+
"@constructive-io/graphql-env": "^3.20.0",
|
|
48
|
+
"@constructive-io/graphql-server": "^5.4.0",
|
|
49
|
+
"@constructive-io/graphql-types": "^3.19.0",
|
|
50
50
|
"@constructive-io/upload-client": "0.17.2",
|
|
51
51
|
"@pgpmjs/types": "^2.37.2",
|
|
52
52
|
"express": "^5.2.1",
|
|
53
|
-
"graphile-schema": "^2.
|
|
53
|
+
"graphile-schema": "^2.2.0",
|
|
54
54
|
"graphql": "16.13.0",
|
|
55
55
|
"pg": "^8.21.0",
|
|
56
56
|
"pg-cache": "^3.16.2",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"e2e",
|
|
69
69
|
"server"
|
|
70
70
|
],
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "518e7ab2270661c64875258436d90fdf76b4b336"
|
|
72
72
|
}
|
package/types.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export interface ServerOptions {
|
|
|
21
21
|
* (pure PostGraphile, no routing, no database id) exposing the configured
|
|
22
22
|
* schemas directly. For local/static suites only.
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
useRouting?: boolean;
|
|
25
25
|
/**
|
|
26
26
|
* API configuration options for the GraphQL server.
|
|
27
27
|
* These options control how the server handles requests and which features are enabled.
|
|
@@ -32,7 +32,7 @@ export interface ServerOptions {
|
|
|
32
32
|
* schemas: ['app_public'],
|
|
33
33
|
* server: {
|
|
34
34
|
* port: 5555,
|
|
35
|
-
*
|
|
35
|
+
* useRouting: false
|
|
36
36
|
* }
|
|
37
37
|
* });
|
|
38
38
|
* ```
|