@constructive-io/graphql-env 2.8.11 → 2.8.13

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
@@ -102,9 +102,14 @@ Common issues and solutions for pgpm, PostgreSQL, and testing.
102
102
 
103
103
  ## Related Constructive Tooling
104
104
 
105
+ ### 📦 Package Management
106
+
107
+ * [pgpm](https://github.com/constructive-io/constructive/tree/main/pgpm/pgpm): **🖥️ PostgreSQL Package Manager** for modular Postgres development. Works with database workspaces, scaffolding, migrations, seeding, and installing database packages.
108
+
105
109
  ### 🧪 Testing
106
110
 
107
111
  * [pgsql-test](https://github.com/constructive-io/constructive/tree/main/postgres/pgsql-test): **📊 Isolated testing environments** with per-test transaction rollbacks—ideal for integration tests, complex migrations, and RLS simulation.
112
+ * [pgsql-seed](https://github.com/constructive-io/constructive/tree/main/postgres/pgsql-seed): **🌱 PostgreSQL seeding utilities** for CSV, JSON, SQL data loading, and pgpm deployment.
108
113
  * [supabase-test](https://github.com/constructive-io/constructive/tree/main/postgres/supabase-test): **🧪 Supabase-native test harness** preconfigured for the local Supabase stack—per-test rollbacks, JWT/role context helpers, and CI/GitHub Actions ready.
109
114
  * [graphile-test](https://github.com/constructive-io/constructive/tree/main/graphile/graphile-test): **🔐 Authentication mocking** for Graphile-focused test helpers and emulating row-level security contexts.
110
115
  * [pg-query-context](https://github.com/constructive-io/constructive/tree/main/postgres/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.
@@ -118,28 +123,6 @@ Common issues and solutions for pgpm, PostgreSQL, and testing.
118
123
  * [@pgsql/types](https://www.npmjs.com/package/@pgsql/types): **📝 Type definitions** for PostgreSQL AST nodes in TypeScript.
119
124
  * [@pgsql/utils](https://www.npmjs.com/package/@pgsql/utils): **🛠️ AST utilities** for constructing and transforming PostgreSQL syntax trees.
120
125
 
121
- ### 🚀 API & Dev Tools
122
-
123
- * [@constructive-io/graphql-server](https://github.com/constructive-io/constructive/tree/main/graphql/server): **⚡ Express-based API server** powered by PostGraphile to expose a secure, scalable GraphQL API over your Postgres database.
124
- * [@constructive-io/graphql-explorer](https://github.com/constructive-io/constructive/tree/main/graphql/explorer): **🔎 Visual API explorer** with GraphiQL for browsing across all databases and schemas—useful for debugging, documentation, and API prototyping.
125
-
126
- ### 🔁 Streaming & Uploads
127
-
128
- * [etag-hash](https://github.com/constructive-io/constructive/tree/main/streaming/etag-hash): **🏷️ S3-compatible ETags** created by streaming and hashing file uploads in chunks.
129
- * [etag-stream](https://github.com/constructive-io/constructive/tree/main/streaming/etag-stream): **🔄 ETag computation** via Node stream transformer during upload or transfer.
130
- * [uuid-hash](https://github.com/constructive-io/constructive/tree/main/streaming/uuid-hash): **🆔 Deterministic UUIDs** generated from hashed content, great for deduplication and asset referencing.
131
- * [uuid-stream](https://github.com/constructive-io/constructive/tree/main/streaming/uuid-stream): **🌊 Streaming UUID generation** based on piped file content—ideal for upload pipelines.
132
- * [@constructive-io/s3-streamer](https://github.com/constructive-io/constructive/tree/main/streaming/s3-streamer): **📤 Direct S3 streaming** for large files with support for metadata injection and content validation.
133
- * [@constructive-io/upload-names](https://github.com/constructive-io/constructive/tree/main/streaming/upload-names): **📂 Collision-resistant filenames** utility for structured and unique file names for uploads.
134
-
135
- ### 🧰 CLI & Codegen
136
-
137
- * [pgpm](https://github.com/constructive-io/constructive/tree/main/pgpm/pgpm): **🖥️ PostgreSQL Package Manager** for modular Postgres development. Works with database workspaces, scaffolding, migrations, seeding, and installing database packages.
138
- * [@constructive-io/cli](https://github.com/constructive-io/constructive/tree/main/packages/cli): **🖥️ Command-line toolkit** for managing Constructive projects—supports database scaffolding, migrations, seeding, code generation, and automation.
139
- * [@constructive-io/graphql-codegen](https://github.com/constructive-io/constructive/tree/main/graphql/codegen): **✨ GraphQL code generation** (types, operations, SDK) from schema/endpoint introspection.
140
- * [@constructive-io/query-builder](https://github.com/constructive-io/constructive/tree/main/packages/query-builder): **🏗️ SQL constructor** providing a robust TypeScript-based query builder for dynamic generation of `SELECT`, `INSERT`, `UPDATE`, `DELETE`, and stored procedure calls—supports advanced SQL features like `JOIN`, `GROUP BY`, and schema-qualified queries.
141
- * [@constructive-io/graphql-query](https://github.com/constructive-io/constructive/tree/main/graphql/query): **🧩 Fluent GraphQL builder** for PostGraphile schemas. ⚡ Schema-aware via introspection, 🧩 composable and ergonomic for building deeply nested queries.
142
-
143
126
  ## Credits
144
127
 
145
128
  **🛠 Built by the [Constructive](https://constructive.io) team — creators of modular Postgres tooling for secure, composable backends. If you like our work, contribute on [GitHub](https://github.com/constructive-io).**
package/env.d.ts CHANGED
@@ -1,2 +1,5 @@
1
1
  import { ConstructiveOptions } from '@constructive-io/graphql-types';
2
- export declare const getGraphQLEnvVars: () => Partial<ConstructiveOptions>;
2
+ /**
3
+ * @param env - Environment object to read from (defaults to process.env for backwards compatibility)
4
+ */
5
+ export declare const getGraphQLEnvVars: (env?: NodeJS.ProcessEnv) => Partial<ConstructiveOptions>;
package/env.js CHANGED
@@ -10,8 +10,11 @@ const parseEnvBoolean = (val) => {
10
10
  return undefined;
11
11
  return ['true', '1', 'yes'].includes(val.toLowerCase());
12
12
  };
13
- const getGraphQLEnvVars = () => {
14
- const { GRAPHILE_SCHEMA, FEATURES_SIMPLE_INFLECTION, FEATURES_OPPOSITE_BASE_NAMES, FEATURES_POSTGIS, API_ENABLE_META, API_IS_PUBLIC, API_EXPOSED_SCHEMAS, API_META_SCHEMAS, API_ANON_ROLE, API_ROLE_NAME, API_DEFAULT_DATABASE_ID, } = process.env;
13
+ /**
14
+ * @param env - Environment object to read from (defaults to process.env for backwards compatibility)
15
+ */
16
+ const getGraphQLEnvVars = (env = process.env) => {
17
+ const { GRAPHILE_SCHEMA, FEATURES_SIMPLE_INFLECTION, FEATURES_OPPOSITE_BASE_NAMES, FEATURES_POSTGIS, API_ENABLE_META, API_IS_PUBLIC, API_EXPOSED_SCHEMAS, API_META_SCHEMAS, API_ANON_ROLE, API_ROLE_NAME, API_DEFAULT_DATABASE_ID, } = env;
15
18
  return {
16
19
  graphile: {
17
20
  ...(GRAPHILE_SCHEMA && {
package/esm/env.d.ts CHANGED
@@ -1,2 +1,5 @@
1
1
  import { ConstructiveOptions } from '@constructive-io/graphql-types';
2
- export declare const getGraphQLEnvVars: () => Partial<ConstructiveOptions>;
2
+ /**
3
+ * @param env - Environment object to read from (defaults to process.env for backwards compatibility)
4
+ */
5
+ export declare const getGraphQLEnvVars: (env?: NodeJS.ProcessEnv) => Partial<ConstructiveOptions>;
package/esm/env.js CHANGED
@@ -7,8 +7,11 @@ const parseEnvBoolean = (val) => {
7
7
  return undefined;
8
8
  return ['true', '1', 'yes'].includes(val.toLowerCase());
9
9
  };
10
- export const getGraphQLEnvVars = () => {
11
- const { GRAPHILE_SCHEMA, FEATURES_SIMPLE_INFLECTION, FEATURES_OPPOSITE_BASE_NAMES, FEATURES_POSTGIS, API_ENABLE_META, API_IS_PUBLIC, API_EXPOSED_SCHEMAS, API_META_SCHEMAS, API_ANON_ROLE, API_ROLE_NAME, API_DEFAULT_DATABASE_ID, } = process.env;
10
+ /**
11
+ * @param env - Environment object to read from (defaults to process.env for backwards compatibility)
12
+ */
13
+ export const getGraphQLEnvVars = (env = process.env) => {
14
+ const { GRAPHILE_SCHEMA, FEATURES_SIMPLE_INFLECTION, FEATURES_OPPOSITE_BASE_NAMES, FEATURES_POSTGIS, API_ENABLE_META, API_IS_PUBLIC, API_EXPOSED_SCHEMAS, API_META_SCHEMAS, API_ANON_ROLE, API_ROLE_NAME, API_DEFAULT_DATABASE_ID, } = env;
12
15
  return {
13
16
  graphile: {
14
17
  ...(GRAPHILE_SCHEMA && {
package/esm/merge.d.ts CHANGED
@@ -9,9 +9,13 @@ import { ConstructiveOptions } from '@constructive-io/graphql-types';
9
9
  *
10
10
  * This is the main entry point for Constructive packages that need
11
11
  * both core PGPM options and GraphQL/Graphile options.
12
+ *
13
+ * @param overrides - Runtime overrides to apply last
14
+ * @param cwd - Working directory for config file resolution
15
+ * @param env - Environment object to read from (defaults to process.env for backwards compatibility)
12
16
  */
13
- export declare const getEnvOptions: (overrides?: Partial<ConstructiveOptions>, cwd?: string) => ConstructiveOptions;
17
+ export declare const getEnvOptions: (overrides?: Partial<ConstructiveOptions>, cwd?: string, env?: NodeJS.ProcessEnv) => ConstructiveOptions;
14
18
  /**
15
19
  * Alias - same as getEnvOptions
16
20
  */
17
- export declare const getConstructiveEnvOptions: (overrides?: Partial<ConstructiveOptions>, cwd?: string) => ConstructiveOptions;
21
+ export declare const getConstructiveEnvOptions: (overrides?: Partial<ConstructiveOptions>, cwd?: string, env?: NodeJS.ProcessEnv) => ConstructiveOptions;
package/esm/merge.js CHANGED
@@ -12,12 +12,16 @@ import { getGraphQLEnvVars } from './env';
12
12
  *
13
13
  * This is the main entry point for Constructive packages that need
14
14
  * both core PGPM options and GraphQL/Graphile options.
15
+ *
16
+ * @param overrides - Runtime overrides to apply last
17
+ * @param cwd - Working directory for config file resolution
18
+ * @param env - Environment object to read from (defaults to process.env for backwards compatibility)
15
19
  */
16
- export const getEnvOptions = (overrides = {}, cwd = process.cwd()) => {
20
+ export const getEnvOptions = (overrides = {}, cwd = process.cwd(), env = process.env) => {
17
21
  // Get core PGPM options (includes pgpmDefaults + config + core env vars)
18
- const coreOptions = getPgpmEnvOptions({}, cwd);
22
+ const coreOptions = getPgpmEnvOptions({}, cwd, env);
19
23
  // Get GraphQL-specific env vars
20
- const graphqlEnvOptions = getGraphQLEnvVars();
24
+ const graphqlEnvOptions = getGraphQLEnvVars(env);
21
25
  // Load config again to get any GraphQL-specific config
22
26
  // Config files can contain Constructive options (graphile, features, api)
23
27
  // even though loadConfigSync returns PgpmOptions type
package/merge.d.ts CHANGED
@@ -9,9 +9,13 @@ import { ConstructiveOptions } from '@constructive-io/graphql-types';
9
9
  *
10
10
  * This is the main entry point for Constructive packages that need
11
11
  * both core PGPM options and GraphQL/Graphile options.
12
+ *
13
+ * @param overrides - Runtime overrides to apply last
14
+ * @param cwd - Working directory for config file resolution
15
+ * @param env - Environment object to read from (defaults to process.env for backwards compatibility)
12
16
  */
13
- export declare const getEnvOptions: (overrides?: Partial<ConstructiveOptions>, cwd?: string) => ConstructiveOptions;
17
+ export declare const getEnvOptions: (overrides?: Partial<ConstructiveOptions>, cwd?: string, env?: NodeJS.ProcessEnv) => ConstructiveOptions;
14
18
  /**
15
19
  * Alias - same as getEnvOptions
16
20
  */
17
- export declare const getConstructiveEnvOptions: (overrides?: Partial<ConstructiveOptions>, cwd?: string) => ConstructiveOptions;
21
+ export declare const getConstructiveEnvOptions: (overrides?: Partial<ConstructiveOptions>, cwd?: string, env?: NodeJS.ProcessEnv) => ConstructiveOptions;
package/merge.js CHANGED
@@ -18,12 +18,16 @@ const env_2 = require("./env");
18
18
  *
19
19
  * This is the main entry point for Constructive packages that need
20
20
  * both core PGPM options and GraphQL/Graphile options.
21
+ *
22
+ * @param overrides - Runtime overrides to apply last
23
+ * @param cwd - Working directory for config file resolution
24
+ * @param env - Environment object to read from (defaults to process.env for backwards compatibility)
21
25
  */
22
- const getEnvOptions = (overrides = {}, cwd = process.cwd()) => {
26
+ const getEnvOptions = (overrides = {}, cwd = process.cwd(), env = process.env) => {
23
27
  // Get core PGPM options (includes pgpmDefaults + config + core env vars)
24
- const coreOptions = (0, env_1.getEnvOptions)({}, cwd);
28
+ const coreOptions = (0, env_1.getEnvOptions)({}, cwd, env);
25
29
  // Get GraphQL-specific env vars
26
- const graphqlEnvOptions = (0, env_2.getGraphQLEnvVars)();
30
+ const graphqlEnvOptions = (0, env_2.getGraphQLEnvVars)(env);
27
31
  // Load config again to get any GraphQL-specific config
28
32
  // Config files can contain Constructive options (graphile, features, api)
29
33
  // even though loadConfigSync returns PgpmOptions type
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructive-io/graphql-env",
3
- "version": "2.8.11",
3
+ "version": "2.8.13",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "Constructive environment configuration with GraphQL/Graphile support",
6
6
  "main": "index.js",
@@ -29,8 +29,8 @@
29
29
  "test:watch": "jest --watch"
30
30
  },
31
31
  "dependencies": {
32
- "@constructive-io/graphql-types": "^2.12.8",
33
- "@pgpmjs/env": "^2.8.11",
32
+ "@constructive-io/graphql-types": "^2.12.9",
33
+ "@pgpmjs/env": "^2.9.1",
34
34
  "deepmerge": "^4.3.1"
35
35
  },
36
36
  "keywords": [
@@ -44,5 +44,5 @@
44
44
  "devDependencies": {
45
45
  "makage": "^0.1.9"
46
46
  },
47
- "gitHead": "c2e68f9808a87e3231d9b9af5e706bef5dbd2af8"
47
+ "gitHead": "14ed679aeb6172e013c817b8a458e5bee68ab492"
48
48
  }