From b05e5cf86b6ca12e0c870dd851d582f0f4460ac8 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Thu, 17 Sep 2026 11:39:29 +0100 Subject: [PATCH 1/6] Use json_each_text instead of json_array_elements --- grafast/dataplan-pg/src/adaptors/pg.ts | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/grafast/dataplan-pg/src/adaptors/pg.ts b/grafast/dataplan-pg/src/adaptors/pg.ts index e8ef171798..426c88d00c 100644 --- a/grafast/dataplan-pg/src/adaptors/pg.ts +++ b/grafast/dataplan-pg/src/adaptors/pg.ts @@ -268,13 +268,6 @@ async function makeNodePostgresWithPgClient_inner( alreadyInTransaction: boolean, ) { /** Transaction level; 0 = no transaction; 1 = begin; 2,... = savepoint */ - const pgSettingsEntries: Array<[string, string]> = []; - if (pgSettings != null) { - for (const [key, value] of Object.entries(pgSettings)) { - if (value == null) continue; - pgSettingsEntries.push([key, "" + value]); - } - } // PERF: under what situations is this actually required? We added it to // force test queries that were sharing the same client to run in series @@ -288,14 +281,17 @@ async function makeNodePostgresWithPgClient_inner( return (pgClient[$$queue] = (async () => { try { // If there's pgSettings; create a transaction and set them, otherwise no transaction needed - if (pgSettingsEntries.length > 0) { + const stringifiedSettings = pgSettings + ? JSON.stringify(pgSettings) + : null; + if (stringifiedSettings != null && stringifiedSettings != "{}") { await pgClient.query({ text: alreadyInTransaction ? "savepoint tx" : "begin", }); try { await pgClient.query({ - text: "select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el", - values: [JSON.stringify(pgSettingsEntries)], + text: "select set_config(key, value, true) from json_each_text($1::json) el(key, value)", + values: [stringifiedSettings], }); const client = newNodePostgresPgClient( pgClient, From f20a40de99d09b1ab484f12f148b358822abbcfd Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Thu, 17 Sep 2026 11:39:43 +0100 Subject: [PATCH 2/6] Use unnest instead of json_each_text --- grafast/dataplan-pg/src/adaptors/pg.ts | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/grafast/dataplan-pg/src/adaptors/pg.ts b/grafast/dataplan-pg/src/adaptors/pg.ts index 426c88d00c..1a292dc6f5 100644 --- a/grafast/dataplan-pg/src/adaptors/pg.ts +++ b/grafast/dataplan-pg/src/adaptors/pg.ts @@ -281,17 +281,29 @@ async function makeNodePostgresWithPgClient_inner( return (pgClient[$$queue] = (async () => { try { // If there's pgSettings; create a transaction and set them, otherwise no transaction needed - const stringifiedSettings = pgSettings - ? JSON.stringify(pgSettings) - : null; - if (stringifiedSettings != null && stringifiedSettings != "{}") { + let keys: [string, ...string[]] | null = null; + let values: [string, ...string[]] | null = null; + if (pgSettings != null) { + for (const [key, value] of Object.entries(pgSettings)) { + if (value != null) { + if (keys == null) { + keys = [key]; + values = [value]; + } else { + keys.push(key); + values!.push("" + value); + } + } + } + } + if (keys != null) { await pgClient.query({ text: alreadyInTransaction ? "savepoint tx" : "begin", }); try { await pgClient.query({ - text: "select set_config(key, value, true) from json_each_text($1::json) el(key, value)", - values: [stringifiedSettings], + text: "select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value)", + values: [keys, values], }); const client = newNodePostgresPgClient( pgClient, From 02e020750600883ed96d060d256a1020d4dc3447 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Fri, 18 Sep 2026 09:34:55 +0100 Subject: [PATCH 3/6] docs(changeset): Use `unnest()` rather than `json_array_elements()` to feed pgSettings to Postgres. --- .changeset/plenty-badgers-bake.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/plenty-badgers-bake.md diff --git a/.changeset/plenty-badgers-bake.md b/.changeset/plenty-badgers-bake.md new file mode 100644 index 0000000000..31136d24d7 --- /dev/null +++ b/.changeset/plenty-badgers-bake.md @@ -0,0 +1,7 @@ +--- +"postgraphile": minor +"@dataplan/pg": minor +--- + +Use `unnest()` rather than `json_array_elements()` to feed pgSettings to +Postgres. From a96bf5ac555f71c6836e7cb60f2176f2d159702c Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Fri, 18 Sep 2026 09:39:18 +0100 Subject: [PATCH 4/6] Update SQL snapshots --- .../mutations/v4/partitions.unqualified.sql | 8 +++---- .../mutations/v4/rbac.createLeftArm.sql | 2 +- .../mutations/v4/rbac.createPerson.sql | 4 ++-- .../mutations/v4/rbac.deletePerson.sql | 2 +- .../mutations/v4/rbac.leftArmIdentity.sql | 2 +- .../mutations/v4/rbac.updateLeftArm.sql | 2 +- .../mutations/v4/rbac.updatePerson.sql | 4 ++-- .../__tests__/queries/v4/rbac.basic.sql | 22 +++++++++---------- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/postgraphile/postgraphile/__tests__/mutations/v4/partitions.unqualified.sql b/postgraphile/postgraphile/__tests__/mutations/v4/partitions.unqualified.sql index 02787a1ab2..d80477b25e 100644 --- a/postgraphile/postgraphile/__tests__/mutations/v4/partitions.unqualified.sql +++ b/postgraphile/postgraphile/__tests__/mutations/v4/partitions.unqualified.sql @@ -1,6 +1,6 @@ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) insert into "measurements" as __measurements__ ("timestamp", "key", "value", "user_id") values ($1::"timestamptz", $2::"text", $3::"float8", $4::"int4") returning to_char(__measurements__."timestamp", 'YYYY-MM-DD"T"HH24:MI:SS.USTZH:TZM'::text) as "0", @@ -12,7 +12,7 @@ commit; /*fake*/ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) select __users__."id"::text as "0", @@ -26,7 +26,7 @@ commit; /*fake*/ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) update "measurements" as __measurements__ set "value" = $1::"float8" where ((__measurements__."timestamp" = $2::"timestamptz") and (__measurements__."key" = $3::"text")) returning to_char(__measurements__."timestamp", 'YYYY-MM-DD"T"HH24:MI:SS.USTZH:TZM'::text) as "0", @@ -38,7 +38,7 @@ commit; /*fake*/ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) select __users__."id"::text as "0", diff --git a/postgraphile/postgraphile/__tests__/mutations/v4/rbac.createLeftArm.sql b/postgraphile/postgraphile/__tests__/mutations/v4/rbac.createLeftArm.sql index f47c59a84c..f2dc3c4e9d 100644 --- a/postgraphile/postgraphile/__tests__/mutations/v4/rbac.createLeftArm.sql +++ b/postgraphile/postgraphile/__tests__/mutations/v4/rbac.createLeftArm.sql @@ -1,6 +1,6 @@ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) insert into "c"."left_arm" as __left_arm__ ("length_in_metres") values ($1::"float8") returning __left_arm__."id"::text as "0", diff --git a/postgraphile/postgraphile/__tests__/mutations/v4/rbac.createPerson.sql b/postgraphile/postgraphile/__tests__/mutations/v4/rbac.createPerson.sql index 37ff4c2451..e5190bdb82 100644 --- a/postgraphile/postgraphile/__tests__/mutations/v4/rbac.createPerson.sql +++ b/postgraphile/postgraphile/__tests__/mutations/v4/rbac.createPerson.sql @@ -1,6 +1,6 @@ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) insert into "c"."person" as __person__ ("person_full_name", "aliases", "about", "email", "site") values ($1::"varchar", $2::"text"[], $3::"text", $4::"b"."email", $5::"b"."wrapped_url") returning __person__."id"::text as "0", @@ -16,7 +16,7 @@ commit; /*fake*/ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) select __frmcdc_wrapped_url__."url" as "0" diff --git a/postgraphile/postgraphile/__tests__/mutations/v4/rbac.deletePerson.sql b/postgraphile/postgraphile/__tests__/mutations/v4/rbac.deletePerson.sql index d07437acca..c4b2884ffb 100644 --- a/postgraphile/postgraphile/__tests__/mutations/v4/rbac.deletePerson.sql +++ b/postgraphile/postgraphile/__tests__/mutations/v4/rbac.deletePerson.sql @@ -1,6 +1,6 @@ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) delete from "c"."person" as __person__ where (__person__."id" = $1::"int4") returning __person__."id"::text as "0"; diff --git a/postgraphile/postgraphile/__tests__/mutations/v4/rbac.leftArmIdentity.sql b/postgraphile/postgraphile/__tests__/mutations/v4/rbac.leftArmIdentity.sql index 7e78e05676..1d2934818d 100644 --- a/postgraphile/postgraphile/__tests__/mutations/v4/rbac.leftArmIdentity.sql +++ b/postgraphile/postgraphile/__tests__/mutations/v4/rbac.leftArmIdentity.sql @@ -1,6 +1,6 @@ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) select __left_arm_identity__."id"::text as "0", diff --git a/postgraphile/postgraphile/__tests__/mutations/v4/rbac.updateLeftArm.sql b/postgraphile/postgraphile/__tests__/mutations/v4/rbac.updateLeftArm.sql index 4ce0e9a7ca..7a26a31951 100644 --- a/postgraphile/postgraphile/__tests__/mutations/v4/rbac.updateLeftArm.sql +++ b/postgraphile/postgraphile/__tests__/mutations/v4/rbac.updateLeftArm.sql @@ -1,6 +1,6 @@ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) update "c"."left_arm" as __left_arm__ set "mood" = $1::"text" where (__left_arm__."id" = $2::"int4") returning __left_arm__."id"::text as "0", diff --git a/postgraphile/postgraphile/__tests__/mutations/v4/rbac.updatePerson.sql b/postgraphile/postgraphile/__tests__/mutations/v4/rbac.updatePerson.sql index 2c75b08ca1..15dbf45d94 100644 --- a/postgraphile/postgraphile/__tests__/mutations/v4/rbac.updatePerson.sql +++ b/postgraphile/postgraphile/__tests__/mutations/v4/rbac.updatePerson.sql @@ -1,6 +1,6 @@ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) update "c"."person" as __person__ set "person_full_name" = $1::"varchar", "aliases" = $2::"text"[], "about" = $3::"text", "email" = $4::"b"."email", "site" = $5::"b"."wrapped_url" where (__person__."id" = $6::"int4") returning __person__."id"::text as "0", @@ -16,7 +16,7 @@ commit; /*fake*/ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) select __frmcdc_wrapped_url__."url" as "0" diff --git a/postgraphile/postgraphile/__tests__/queries/v4/rbac.basic.sql b/postgraphile/postgraphile/__tests__/queries/v4/rbac.basic.sql index b6c353e8f9..4542d352e1 100644 --- a/postgraphile/postgraphile/__tests__/queries/v4/rbac.basic.sql +++ b/postgraphile/postgraphile/__tests__/queries/v4/rbac.basic.sql @@ -1,6 +1,6 @@ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) select __person_secret__."person_id"::text as "0", @@ -14,7 +14,7 @@ commit; /*fake*/ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) select __person_secret__."person_id"::text as "0", @@ -26,7 +26,7 @@ commit; /*fake*/ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) select __person__."id"::text as "0", @@ -46,7 +46,7 @@ commit; /*fake*/ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) select __person__."id"::text as "0", @@ -66,7 +66,7 @@ commit; /*fake*/ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) select __left_arm__."id"::text as "0", @@ -82,7 +82,7 @@ commit; /*fake*/ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) select __left_arm__."id"::text as "0", @@ -96,7 +96,7 @@ commit; /*fake*/ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) select __person__."id"::text as "0", @@ -118,7 +118,7 @@ commit; /*fake*/ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) select __post__."id"::text as "0", @@ -134,7 +134,7 @@ commit; /*fake*/ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) select __post__."id"::text as "0", @@ -148,7 +148,7 @@ commit; /*fake*/ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) select __person__."id"::text as "0", @@ -174,7 +174,7 @@ commit; /*fake*/ begin; /*fake*/ -select set_config(el->>0, el->>1, true) from json_array_elements($1::json) el +select set_config(key, value, true) from unnest($1::text[], $2::text[]) as settings(key, value) select __return_table_without_grants__."person_id_1"::text as "0", From 2bb90b2be46f2ca21adaeb5c3c3abd1fc10f4125 Mon Sep 17 00:00:00 2001 From: BenjAIe Date: Fri, 18 Sep 2026 10:03:53 +0100 Subject: [PATCH 5/6] Add explicit pgSettings test --- .../postgraphile/__tests__/helpers.ts | 7 ++- .../__tests__/kitchen-sink-permissions.sql | 1 + .../__tests__/kitchen-sink-schema.sql | 17 +++++++ .../postgraphile/__tests__/pgSettings.test.ts | 46 +++++++++++++++++++ 4 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 postgraphile/postgraphile/__tests__/pgSettings.test.ts diff --git a/postgraphile/postgraphile/__tests__/helpers.ts b/postgraphile/postgraphile/__tests__/helpers.ts index 15f45a58ea..f23cd11d02 100644 --- a/postgraphile/postgraphile/__tests__/helpers.ts +++ b/postgraphile/postgraphile/__tests__/helpers.ts @@ -264,6 +264,7 @@ export async function runTestQuery( cleanupSql?: string; extends?: string | string[]; pgIdentifiers?: "qualified" | "unqualified"; + pgSettings?: Record; search_path?: string; muteWarnings?: boolean; dontLogErrors?: boolean; @@ -293,6 +294,7 @@ export async function runTestQuery( setupSql, cleanupSql, pgIdentifiers, + pgSettings, search_path, muteWarnings = true, dontLogErrors = false, @@ -347,8 +349,9 @@ export async function runTestQuery( role: "postgraphile_test_authenticator", } : null, - pgSettings: - config.ignoreRBAC === false + pgSettings: pgSettings + ? () => pgSettings + : config.ignoreRBAC === false ? () => ({ role: "postgraphile_test_visitor", "jwt.claims.user_id": "3", diff --git a/postgraphile/postgraphile/__tests__/kitchen-sink-permissions.sql b/postgraphile/postgraphile/__tests__/kitchen-sink-permissions.sql index f03db3c4ad..18f89d4194 100644 --- a/postgraphile/postgraphile/__tests__/kitchen-sink-permissions.sql +++ b/postgraphile/postgraphile/__tests__/kitchen-sink-permissions.sql @@ -5,6 +5,7 @@ grant usage on schema a,b,c to postgraphile_test_visitor; grant usage, select on all sequences in schema a,b,c to postgraphile_test_visitor; grant execute on function c.current_user_id() to postgraphile_test_visitor; +grant execute on function c.read_pg_settings() to postgraphile_test_visitor; grant execute on function c.left_arm_identity(left_arm c.left_arm) to postgraphile_test_visitor; grant select on c.person to postgraphile_test_visitor; diff --git a/postgraphile/postgraphile/__tests__/kitchen-sink-schema.sql b/postgraphile/postgraphile/__tests__/kitchen-sink-schema.sql index 7798c41125..c799be27da 100644 --- a/postgraphile/postgraphile/__tests__/kitchen-sink-schema.sql +++ b/postgraphile/postgraphile/__tests__/kitchen-sink-schema.sql @@ -103,6 +103,23 @@ end if; end; $_$ language plpgsql; +create function c.read_pg_settings() returns json as $$ + select json_build_object( + 'statement_timeout', current_setting('statement_timeout', true), + 'role', current_setting('role', true), + 'jwt.claims.string', current_setting('jwt.claims.string', true), + 'jwt.claims.number', current_setting('jwt.claims.number', true), + 'jwt.claims.boolean_true', current_setting('jwt.claims.boolean_true', true), + 'jwt.claims.other_string', current_setting('jwt.claims.other_string', true), + 'jwt.claims.other_number', current_setting('jwt.claims.other_number', true), + 'jwt.claims.boolean_false', current_setting('jwt.claims.boolean_false', true), + 'jwt.claims.empty_string', current_setting('jwt.claims.empty_string', true), + 'jwt.claims.escaped_string', current_setting('jwt.claims.escaped_string', true), + 'jwt.claims.null', current_setting('jwt.claims.null', true), + 'jwt.claims.undefined', current_setting('jwt.claims.undefined', true) + ); +$$ language sql stable; + -- This is to test that "one-to-one" relationships work on primary keys create table c.person_secret ( person_id int not null primary key references c.person on delete cascade, diff --git a/postgraphile/postgraphile/__tests__/pgSettings.test.ts b/postgraphile/postgraphile/__tests__/pgSettings.test.ts new file mode 100644 index 0000000000..d08ccb1abf --- /dev/null +++ b/postgraphile/postgraphile/__tests__/pgSettings.test.ts @@ -0,0 +1,46 @@ +import { runTestQuery } from "./helpers.ts"; + +test("applies pgSettings to PostgreSQL", async () => { + const { data, errors } = await runTestQuery( + /* GraphQL */ ` + query { + cReadPgSettings + } + `, + { + pgSettings: { + statement_timeout: 12345, + role: "postgraphile_test_visitor", + "jwt.claims.string": "a string value", + "jwt.claims.number": 42, + "jwt.claims.boolean_true": true, + "jwt.claims.other_string": "another string value", + "jwt.claims.other_number": -7, + "jwt.claims.boolean_false": false, + "jwt.claims.empty_string": "", + "jwt.claims.escaped_string": 'a "quoted" value', + "jwt.claims.null": null, + "jwt.claims.undefined": undefined, + }, + }, + { path: __filename }, + ); + + expect(errors).toBeFalsy(); + expect(data).toEqual({ + cReadPgSettings: { + statement_timeout: "12345ms", + role: "postgraphile_test_visitor", + "jwt.claims.string": "a string value", + "jwt.claims.number": "42", + "jwt.claims.boolean_true": "true", + "jwt.claims.other_string": "another string value", + "jwt.claims.other_number": "-7", + "jwt.claims.boolean_false": "false", + "jwt.claims.empty_string": "", + "jwt.claims.escaped_string": 'a "quoted" value', + "jwt.claims.null": null, + "jwt.claims.undefined": null, + }, + }); +}); From 6c05a7aca19ecaaf4e3c12c4c82250e4d55207c9 Mon Sep 17 00:00:00 2001 From: BenjAIe Date: Sat, 19 Sep 2026 11:32:42 +0100 Subject: [PATCH 6/6] Update snapshots for new method --- .../v4/defaultOptions-minified.1.export.mjs | 20 ++++++++ .../v4/defaultOptions-minified.1.graphql | 1 + .../schema/v4/defaultOptions.1.export.mjs | 26 ++++++++++ .../schema/v4/defaultOptions.1.graphql | 1 + .../defaultOptions.subscriptions.1.export.mjs | 26 ++++++++++ .../v4/defaultOptions.subscriptions.1.graphql | 1 + .../foreignKey-smart-tag-autofix.1.export.mjs | 26 ++++++++++ .../v4/foreignKey-smart-tag-autofix.1.graphql | 1 + .../v4/foreignKey-smart-tag-good.1.export.mjs | 26 ++++++++++ .../v4/foreignKey-smart-tag-good.1.graphql | 1 + ...ash-with-tags-file-workaround.1.export.mjs | 26 ++++++++++ ...-clash-with-tags-file-workaround.1.graphql | 1 + .../schema/v4/function-clash.1.export.mjs | 26 ++++++++++ .../schema/v4/function-clash.1.graphql | 1 + .../__tests__/schema/v4/indexes.1.export.mjs | 26 ++++++++++ .../__tests__/schema/v4/indexes.1.graphql | 1 + .../v4/inflect-builtin-lowercase.1.export.mjs | 26 ++++++++++ .../v4/inflect-builtin-lowercase.1.graphql | 1 + .../schema/v4/inflect-core.1.export.mjs | 26 ++++++++++ .../schema/v4/inflect-core.1.graphql | 1 + .../schema/v4/noDefaultMutations.1.export.mjs | 26 ++++++++++ .../schema/v4/noDefaultMutations.1.graphql | 1 + .../schema/v4/pgStrictFunctions.1.export.mjs | 26 ++++++++++ .../schema/v4/pgStrictFunctions.1.graphql | 1 + .../__tests__/schema/v4/rbac.1.export.mjs | 47 +++++++++++++++++++ .../__tests__/schema/v4/rbac.1.graphql | 6 +++ .../schema/v4/rbac.ignore.1.export.mjs | 26 ++++++++++ .../__tests__/schema/v4/rbac.ignore.1.graphql | 1 + .../__tests__/schema/v4/relay1.1.export.mjs | 26 ++++++++++ .../__tests__/schema/v4/relay1.1.graphql | 1 + .../schema/v4/simple-collections.1.export.mjs | 26 ++++++++++ .../schema/v4/simple-collections.1.graphql | 1 + .../v4/simple-collections.only.1.export.mjs | 26 ++++++++++ .../v4/simple-collections.only.1.graphql | 1 + .../schema/v4/simplePrint.export.mjs | 26 ++++++++++ .../__tests__/schema/v4/simplePrint.graphql | 1 + .../schema/v4/skipNodePlugin.1.export.mjs | 26 ++++++++++ .../schema/v4/skipNodePlugin.1.graphql | 1 + .../schema/v5/skipNodePlugin.1.export.mjs | 26 ++++++++++ .../schema/v5/skipNodePlugin.1.graphql | 1 + 40 files changed, 560 insertions(+) diff --git a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions-minified.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions-minified.1.export.mjs index 346a7a0a4a..023b641389 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions-minified.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions-minified.1.export.mjs @@ -1739,6 +1739,7 @@ const person_type_functionFunctionIdentifer = sql.identifier("c", "person_type_f const person_type_function_connectionFunctionIdentifer = sql.identifier("c", "person_type_function_connection"); const person_type_function_listFunctionIdentifer = sql.identifier("c", "person_type_function_list"); const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); +const read_pg_settingsFunctionIdentifer = sql.identifier("c", "read_pg_settings"); const return_table_without_grantsFunctionIdentifer = sql.identifier("c", "return_table_without_grants"); const search_test_summariesFunctionIdentifer = sql.identifier("c", "search_test_summaries"); const table_mutationFunctionIdentifer = sql.identifier("c", "table_mutation"); @@ -4578,6 +4579,19 @@ const registry = makeRegistry({ extensions: {}, isUnique: true }, + read_pg_settings: { + executor: executor, + name: "read_pg_settings", + identifier: "main.c.read_pg_settings()", + from(...args) { + return sql`${read_pg_settingsFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [], + codec: TYPES.json, + hasImplicitOrder: false, + extensions: {}, + isUnique: true + }, return_table_without_grants: PgResource.functionResourceOptions(compound_key_resourceOptionsConfig, { name: "return_table_without_grants", identifier: "main.c.return_table_without_grants()", @@ -5314,6 +5328,7 @@ const argDetailsSimple_query_output_two_rows = [{ }]; const makeArgs_query_output_two_rows = (args, path = []) => argDetailsSimple_query_output_two_rows.map(details => makeArg(path, args, details)); const resource_query_output_two_rowsPgResource = registry.pgResources["query_output_two_rows"]; +const resource_read_pg_settingsPgResource = registry.pgResources["read_pg_settings"]; const resource_return_table_without_grantsPgResource = registry.pgResources["return_table_without_grants"]; const resource_search_test_summariesPgResource = registry.pgResources["search_test_summaries"]; const argDetailsSimple_table_query = [{ @@ -7062,6 +7077,7 @@ export const typeDefs = /* GraphQL */`type Query implements Node { jsonbIdentity(json: JSON): JSON noArgsQuery: Int queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList(first: Int, offset: Int): [SearchTestSummariesRecord] tableQuery(id: Int): Post @@ -11744,6 +11760,10 @@ export const objects = { const selectArgs = makeArgs_compound_type_computed_field(args); return resource_query_text_arrayPgResource.execute(selectArgs); }, + readPgSettings($root, args, _info) { + const selectArgs = makeArgs_compound_type_computed_field(args); + return resource_read_pg_settingsPgResource.execute(selectArgs); + }, reserved(_$parent, args) { const $nodeId = args.getRaw("nodeId"); return nodeFetcher_Reserved($nodeId); diff --git a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions-minified.1.graphql b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions-minified.1.graphql index f92013fc28..9c4a7313a7 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions-minified.1.graphql +++ b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions-minified.1.graphql @@ -2780,6 +2780,7 @@ type Query implements Node { queryIntervalSet(after: Cursor, before: Cursor, first: Int, last: Int, offset: Int): QueryIntervalSetConnection queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord queryTextArray: [String] + readPgSettings: JSON reserved(nodeId: ID!): Reserved reservedById(id: Int!): Reserved reservedInputRecord(nodeId: ID!): ReservedInputRecord diff --git a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.1.export.mjs index 0df5b32723..9838c86efe 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.1.export.mjs @@ -2466,6 +2466,7 @@ const person_type_functionFunctionIdentifer = sql.identifier("c", "person_type_f const person_type_function_connectionFunctionIdentifer = sql.identifier("c", "person_type_function_connection"); const person_type_function_listFunctionIdentifer = sql.identifier("c", "person_type_function_list"); const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); +const read_pg_settingsFunctionIdentifer = sql.identifier("c", "read_pg_settings"); const return_table_without_grantsFunctionIdentifer = sql.identifier("c", "return_table_without_grants"); const search_test_summariesFunctionIdentifer = sql.identifier("c", "search_test_summaries"); const table_mutationFunctionIdentifer = sql.identifier("c", "table_mutation"); @@ -6436,6 +6437,25 @@ const registry = makeRegistry({ }, isUnique: true }, + read_pg_settings: { + executor: executor, + name: "read_pg_settings", + identifier: "main.c.read_pg_settings()", + from(...args) { + return sql`${read_pg_settingsFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [], + codec: TYPES.json, + hasImplicitOrder: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "read_pg_settings" + } + }, + isUnique: true + }, return_table_without_grants: PgResource.functionResourceOptions(compound_key_resourceOptionsConfig, { name: "return_table_without_grants", identifier: "main.c.return_table_without_grants()", @@ -7260,6 +7280,7 @@ const argDetailsSimple_query_output_two_rows = [{ }]; const makeArgs_query_output_two_rows = (args, path = []) => argDetailsSimple_query_output_two_rows.map(details => makeArg(path, args, details)); const resource_query_output_two_rowsPgResource = registry.pgResources["query_output_two_rows"]; +const resource_read_pg_settingsPgResource = registry.pgResources["read_pg_settings"]; const resource_return_table_without_grantsPgResource = registry.pgResources["return_table_without_grants"]; const resource_search_test_summariesPgResource = registry.pgResources["search_test_summaries"]; const argDetailsSimple_table_query = [{ @@ -9366,6 +9387,7 @@ type Query implements Node { jsonbIdentity(json: JSON): JSON noArgsQuery: Int queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first \`n\` values of the set.""" @@ -20327,6 +20349,10 @@ export const objects = { const selectArgs = makeArgs_compound_type_computed_field(args); return resource_query_text_arrayPgResource.execute(selectArgs); }, + readPgSettings($root, args, _info) { + const selectArgs = makeArgs_compound_type_computed_field(args); + return resource_read_pg_settingsPgResource.execute(selectArgs); + }, reserved(_$parent, args) { const $nodeId = args.getRaw("nodeId"); return nodeFetcher_Reserved($nodeId); diff --git a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.1.graphql b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.1.graphql index 3b3ed5c7f9..3f75a4abe0 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.1.graphql +++ b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.1.graphql @@ -7879,6 +7879,7 @@ type Query implements Node { ): QueryIntervalSetConnection queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord queryTextArray: [String] + readPgSettings: JSON """Reads a single `Reserved` using its globally unique `ID`.""" reserved( diff --git a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.subscriptions.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.subscriptions.1.export.mjs index 0df5b32723..9838c86efe 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.subscriptions.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.subscriptions.1.export.mjs @@ -2466,6 +2466,7 @@ const person_type_functionFunctionIdentifer = sql.identifier("c", "person_type_f const person_type_function_connectionFunctionIdentifer = sql.identifier("c", "person_type_function_connection"); const person_type_function_listFunctionIdentifer = sql.identifier("c", "person_type_function_list"); const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); +const read_pg_settingsFunctionIdentifer = sql.identifier("c", "read_pg_settings"); const return_table_without_grantsFunctionIdentifer = sql.identifier("c", "return_table_without_grants"); const search_test_summariesFunctionIdentifer = sql.identifier("c", "search_test_summaries"); const table_mutationFunctionIdentifer = sql.identifier("c", "table_mutation"); @@ -6436,6 +6437,25 @@ const registry = makeRegistry({ }, isUnique: true }, + read_pg_settings: { + executor: executor, + name: "read_pg_settings", + identifier: "main.c.read_pg_settings()", + from(...args) { + return sql`${read_pg_settingsFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [], + codec: TYPES.json, + hasImplicitOrder: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "read_pg_settings" + } + }, + isUnique: true + }, return_table_without_grants: PgResource.functionResourceOptions(compound_key_resourceOptionsConfig, { name: "return_table_without_grants", identifier: "main.c.return_table_without_grants()", @@ -7260,6 +7280,7 @@ const argDetailsSimple_query_output_two_rows = [{ }]; const makeArgs_query_output_two_rows = (args, path = []) => argDetailsSimple_query_output_two_rows.map(details => makeArg(path, args, details)); const resource_query_output_two_rowsPgResource = registry.pgResources["query_output_two_rows"]; +const resource_read_pg_settingsPgResource = registry.pgResources["read_pg_settings"]; const resource_return_table_without_grantsPgResource = registry.pgResources["return_table_without_grants"]; const resource_search_test_summariesPgResource = registry.pgResources["search_test_summaries"]; const argDetailsSimple_table_query = [{ @@ -9366,6 +9387,7 @@ type Query implements Node { jsonbIdentity(json: JSON): JSON noArgsQuery: Int queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first \`n\` values of the set.""" @@ -20327,6 +20349,10 @@ export const objects = { const selectArgs = makeArgs_compound_type_computed_field(args); return resource_query_text_arrayPgResource.execute(selectArgs); }, + readPgSettings($root, args, _info) { + const selectArgs = makeArgs_compound_type_computed_field(args); + return resource_read_pg_settingsPgResource.execute(selectArgs); + }, reserved(_$parent, args) { const $nodeId = args.getRaw("nodeId"); return nodeFetcher_Reserved($nodeId); diff --git a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.subscriptions.1.graphql b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.subscriptions.1.graphql index 3b3ed5c7f9..3f75a4abe0 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.subscriptions.1.graphql +++ b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.subscriptions.1.graphql @@ -7879,6 +7879,7 @@ type Query implements Node { ): QueryIntervalSetConnection queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord queryTextArray: [String] + readPgSettings: JSON """Reads a single `Reserved` using its globally unique `ID`.""" reserved( diff --git a/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-autofix.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-autofix.1.export.mjs index 10a2a85e0d..9fb98a1a17 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-autofix.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-autofix.1.export.mjs @@ -1716,6 +1716,7 @@ const person_type_functionFunctionIdentifer = sql.identifier("c", "person_type_f const person_type_function_connectionFunctionIdentifer = sql.identifier("c", "person_type_function_connection"); const person_type_function_listFunctionIdentifer = sql.identifier("c", "person_type_function_list"); const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); +const read_pg_settingsFunctionIdentifer = sql.identifier("c", "read_pg_settings"); const return_table_without_grantsFunctionIdentifer = sql.identifier("c", "return_table_without_grants"); const search_test_summariesFunctionIdentifer = sql.identifier("c", "search_test_summaries"); const table_mutationFunctionIdentifer = sql.identifier("c", "table_mutation"); @@ -3915,6 +3916,25 @@ const registry = makeRegistry({ }, isUnique: true }, + read_pg_settings: { + executor: executor, + name: "read_pg_settings", + identifier: "main.c.read_pg_settings()", + from(...args) { + return sql`${read_pg_settingsFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [], + codec: TYPES.json, + hasImplicitOrder: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "read_pg_settings" + } + }, + isUnique: true + }, return_table_without_grants: PgResource.functionResourceOptions(compound_key_resourceOptionsConfig, { name: "return_table_without_grants", identifier: "main.c.return_table_without_grants()", @@ -4470,6 +4490,7 @@ const argDetailsSimple_query_output_two_rows = [{ }]; const makeArgs_query_output_two_rows = (args, path = []) => argDetailsSimple_query_output_two_rows.map(details => makeArg(path, args, details)); const resource_query_output_two_rowsPgResource = registry.pgResources["query_output_two_rows"]; +const resource_read_pg_settingsPgResource = registry.pgResources["read_pg_settings"]; const resource_return_table_without_grantsPgResource = registry.pgResources["return_table_without_grants"]; const resource_search_test_summariesPgResource = registry.pgResources["search_test_summaries"]; const argDetailsSimple_table_query = [{ @@ -5673,6 +5694,7 @@ type Query implements Node { jsonbIdentity(json: JSON): JSON noArgsQuery: Int queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first \`n\` values of the set.""" @@ -10460,6 +10482,10 @@ export const objects = { const selectArgs = makeArgs_query_output_two_rows(args); return resource_query_output_two_rowsPgResource.execute(selectArgs); }, + readPgSettings($root, args, _info) { + const selectArgs = makeArgs_compound_type_computed_field(args); + return resource_read_pg_settingsPgResource.execute(selectArgs); + }, returnTableWithoutGrants($root, args, _info) { const selectArgs = makeArgs_compound_type_computed_field(args); return resource_return_table_without_grantsPgResource.execute(selectArgs); diff --git a/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-autofix.1.graphql b/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-autofix.1.graphql index fbf5c8a742..18f9f457b8 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-autofix.1.graphql +++ b/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-autofix.1.graphql @@ -3903,6 +3903,7 @@ type Query implements Node { """ query: Query! queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first `n` values of the set.""" diff --git a/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-good.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-good.1.export.mjs index 736a1638f4..e8ca829af2 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-good.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-good.1.export.mjs @@ -1710,6 +1710,7 @@ const person_type_functionFunctionIdentifer = sql.identifier("c", "person_type_f const person_type_function_connectionFunctionIdentifer = sql.identifier("c", "person_type_function_connection"); const person_type_function_listFunctionIdentifer = sql.identifier("c", "person_type_function_list"); const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); +const read_pg_settingsFunctionIdentifer = sql.identifier("c", "read_pg_settings"); const return_table_without_grantsFunctionIdentifer = sql.identifier("c", "return_table_without_grants"); const search_test_summariesFunctionIdentifer = sql.identifier("c", "search_test_summaries"); const table_mutationFunctionIdentifer = sql.identifier("c", "table_mutation"); @@ -3909,6 +3910,25 @@ const registry = makeRegistry({ }, isUnique: true }, + read_pg_settings: { + executor: executor, + name: "read_pg_settings", + identifier: "main.c.read_pg_settings()", + from(...args) { + return sql`${read_pg_settingsFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [], + codec: TYPES.json, + hasImplicitOrder: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "read_pg_settings" + } + }, + isUnique: true + }, return_table_without_grants: PgResource.functionResourceOptions(compound_key_resourceOptionsConfig, { name: "return_table_without_grants", identifier: "main.c.return_table_without_grants()", @@ -4464,6 +4484,7 @@ const argDetailsSimple_query_output_two_rows = [{ }]; const makeArgs_query_output_two_rows = (args, path = []) => argDetailsSimple_query_output_two_rows.map(details => makeArg(path, args, details)); const resource_query_output_two_rowsPgResource = registry.pgResources["query_output_two_rows"]; +const resource_read_pg_settingsPgResource = registry.pgResources["read_pg_settings"]; const resource_return_table_without_grantsPgResource = registry.pgResources["return_table_without_grants"]; const resource_search_test_summariesPgResource = registry.pgResources["search_test_summaries"]; const argDetailsSimple_table_query = [{ @@ -5670,6 +5691,7 @@ type Query implements Node { jsonbIdentity(json: JSON): JSON noArgsQuery: Int queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first \`n\` values of the set.""" @@ -10505,6 +10527,10 @@ export const objects = { const selectArgs = makeArgs_query_output_two_rows(args); return resource_query_output_two_rowsPgResource.execute(selectArgs); }, + readPgSettings($root, args, _info) { + const selectArgs = makeArgs_compound_type_computed_field(args); + return resource_read_pg_settingsPgResource.execute(selectArgs); + }, returnTableWithoutGrants($root, args, _info) { const selectArgs = makeArgs_compound_type_computed_field(args); return resource_return_table_without_grantsPgResource.execute(selectArgs); diff --git a/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-good.1.graphql b/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-good.1.graphql index 45eba796d9..4e0b72c09e 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-good.1.graphql +++ b/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-good.1.graphql @@ -3933,6 +3933,7 @@ type Query implements Node { """ query: Query! queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first `n` values of the set.""" diff --git a/postgraphile/postgraphile/__tests__/schema/v4/function-clash-with-tags-file-workaround.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/function-clash-with-tags-file-workaround.1.export.mjs index e334f09dec..172d0c58d8 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/function-clash-with-tags-file-workaround.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/function-clash-with-tags-file-workaround.1.export.mjs @@ -2476,6 +2476,7 @@ const person_type_functionFunctionIdentifer = sql.identifier("c", "person_type_f const person_type_function_connectionFunctionIdentifer = sql.identifier("c", "person_type_function_connection"); const person_type_function_listFunctionIdentifer = sql.identifier("c", "person_type_function_list"); const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); +const read_pg_settingsFunctionIdentifer = sql.identifier("c", "read_pg_settings"); const return_table_without_grantsFunctionIdentifer = sql.identifier("c", "return_table_without_grants"); const search_test_summariesFunctionIdentifer = sql.identifier("c", "search_test_summaries"); const table_mutationFunctionIdentifer = sql.identifier("c", "table_mutation"); @@ -6466,6 +6467,25 @@ const registry = makeRegistry({ }, isUnique: true }, + read_pg_settings: { + executor: executor, + name: "read_pg_settings", + identifier: "main.c.read_pg_settings()", + from(...args) { + return sql`${read_pg_settingsFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [], + codec: TYPES.json, + hasImplicitOrder: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "read_pg_settings" + } + }, + isUnique: true + }, return_table_without_grants: PgResource.functionResourceOptions(compound_key_resourceOptionsConfig, { name: "return_table_without_grants", identifier: "main.c.return_table_without_grants()", @@ -7290,6 +7310,7 @@ const argDetailsSimple_query_output_two_rows = [{ }]; const makeArgs_query_output_two_rows = (args, path = []) => argDetailsSimple_query_output_two_rows.map(details => makeArg(path, args, details)); const resource_query_output_two_rowsPgResource = registry.pgResources["query_output_two_rows"]; +const resource_read_pg_settingsPgResource = registry.pgResources["read_pg_settings"]; const resource_return_table_without_grantsPgResource = registry.pgResources["return_table_without_grants"]; const resource_search_test_summariesPgResource = registry.pgResources["search_test_summaries"]; const argDetailsSimple_table_query = [{ @@ -9404,6 +9425,7 @@ type Query implements Node { jsonbIdentity(json: JSON): JSON noArgsQuery: Int queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first \`n\` values of the set.""" @@ -20359,6 +20381,10 @@ export const objects = { const selectArgs = makeArgs_compound_type_computed_field(args); return resource_query_text_arrayPgResource.execute(selectArgs); }, + readPgSettings($root, args, _info) { + const selectArgs = makeArgs_compound_type_computed_field(args); + return resource_read_pg_settingsPgResource.execute(selectArgs); + }, reserved(_$parent, args) { const $nodeId = args.getRaw("nodeId"); return nodeFetcher_Reserved($nodeId); diff --git a/postgraphile/postgraphile/__tests__/schema/v4/function-clash-with-tags-file-workaround.1.graphql b/postgraphile/postgraphile/__tests__/schema/v4/function-clash-with-tags-file-workaround.1.graphql index 6dc9f24df8..2c4a1348dc 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/function-clash-with-tags-file-workaround.1.graphql +++ b/postgraphile/postgraphile/__tests__/schema/v4/function-clash-with-tags-file-workaround.1.graphql @@ -7873,6 +7873,7 @@ type Query implements Node { ): QueryIntervalSetConnection queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord queryTextArray: [String] + readPgSettings: JSON """Reads a single `Reserved` using its globally unique `ID`.""" reserved( diff --git a/postgraphile/postgraphile/__tests__/schema/v4/function-clash.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/function-clash.1.export.mjs index 29f7c08cde..37437016b0 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/function-clash.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/function-clash.1.export.mjs @@ -2467,6 +2467,7 @@ const person_type_functionFunctionIdentifer = sql.identifier("c", "person_type_f const person_type_function_connectionFunctionIdentifer = sql.identifier("c", "person_type_function_connection"); const person_type_function_listFunctionIdentifer = sql.identifier("c", "person_type_function_list"); const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); +const read_pg_settingsFunctionIdentifer = sql.identifier("c", "read_pg_settings"); const return_table_without_grantsFunctionIdentifer = sql.identifier("c", "return_table_without_grants"); const search_test_summariesFunctionIdentifer = sql.identifier("c", "search_test_summaries"); const table_mutationFunctionIdentifer = sql.identifier("c", "table_mutation"); @@ -6457,6 +6458,25 @@ const registry = makeRegistry({ }, isUnique: true }, + read_pg_settings: { + executor: executor, + name: "read_pg_settings", + identifier: "main.c.read_pg_settings()", + from(...args) { + return sql`${read_pg_settingsFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [], + codec: TYPES.json, + hasImplicitOrder: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "read_pg_settings" + } + }, + isUnique: true + }, return_table_without_grants: PgResource.functionResourceOptions(compound_key_resourceOptionsConfig, { name: "return_table_without_grants", identifier: "main.c.return_table_without_grants()", @@ -7281,6 +7301,7 @@ const argDetailsSimple_query_output_two_rows = [{ }]; const makeArgs_query_output_two_rows = (args, path = []) => argDetailsSimple_query_output_two_rows.map(details => makeArg(path, args, details)); const resource_query_output_two_rowsPgResource = registry.pgResources["query_output_two_rows"]; +const resource_read_pg_settingsPgResource = registry.pgResources["read_pg_settings"]; const resource_return_table_without_grantsPgResource = registry.pgResources["return_table_without_grants"]; const resource_search_test_summariesPgResource = registry.pgResources["search_test_summaries"]; const argDetailsSimple_table_query = [{ @@ -9388,6 +9409,7 @@ type Query implements Node { jsonbIdentity(json: JSON): JSON noArgsQuery: Int queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first \`n\` values of the set.""" @@ -20349,6 +20371,10 @@ export const objects = { const selectArgs = makeArgs_compound_type_computed_field(args); return resource_query_text_arrayPgResource.execute(selectArgs); }, + readPgSettings($root, args, _info) { + const selectArgs = makeArgs_compound_type_computed_field(args); + return resource_read_pg_settingsPgResource.execute(selectArgs); + }, reserved(_$parent, args) { const $nodeId = args.getRaw("nodeId"); return nodeFetcher_Reserved($nodeId); diff --git a/postgraphile/postgraphile/__tests__/schema/v4/function-clash.1.graphql b/postgraphile/postgraphile/__tests__/schema/v4/function-clash.1.graphql index 3b3ed5c7f9..3f75a4abe0 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/function-clash.1.graphql +++ b/postgraphile/postgraphile/__tests__/schema/v4/function-clash.1.graphql @@ -7879,6 +7879,7 @@ type Query implements Node { ): QueryIntervalSetConnection queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord queryTextArray: [String] + readPgSettings: JSON """Reads a single `Reserved` using its globally unique `ID`.""" reserved( diff --git a/postgraphile/postgraphile/__tests__/schema/v4/indexes.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/indexes.1.export.mjs index 0e94d237d6..26b424b241 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/indexes.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/indexes.1.export.mjs @@ -2893,6 +2893,7 @@ const person_type_functionFunctionIdentifer = sql.identifier("c", "person_type_f const person_type_function_connectionFunctionIdentifer = sql.identifier("c", "person_type_function_connection"); const person_type_function_listFunctionIdentifer = sql.identifier("c", "person_type_function_list"); const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); +const read_pg_settingsFunctionIdentifer = sql.identifier("c", "read_pg_settings"); const return_table_without_grantsFunctionIdentifer = sql.identifier("c", "return_table_without_grants"); const search_test_summariesFunctionIdentifer = sql.identifier("c", "search_test_summaries"); const table_mutationFunctionIdentifer = sql.identifier("c", "table_mutation"); @@ -6863,6 +6864,25 @@ const registry = makeRegistry({ }, isUnique: true }, + read_pg_settings: { + executor: executor, + name: "read_pg_settings", + identifier: "main.c.read_pg_settings()", + from(...args) { + return sql`${read_pg_settingsFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [], + codec: TYPES.json, + hasImplicitOrder: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "read_pg_settings" + } + }, + isUnique: true + }, return_table_without_grants: PgResource.functionResourceOptions(compound_key_resourceOptionsConfig, { name: "return_table_without_grants", identifier: "main.c.return_table_without_grants()", @@ -7695,6 +7715,7 @@ const argDetailsSimple_query_output_two_rows = [{ }]; const makeArgs_query_output_two_rows = (args, path = []) => argDetailsSimple_query_output_two_rows.map(details => makeArg(path, args, details)); const resource_query_output_two_rowsPgResource = registry.pgResources["query_output_two_rows"]; +const resource_read_pg_settingsPgResource = registry.pgResources["read_pg_settings"]; const resource_return_table_without_grantsPgResource = registry.pgResources["return_table_without_grants"]; const resource_search_test_summariesPgResource = registry.pgResources["search_test_summaries"]; const argDetailsSimple_table_query = [{ @@ -9761,6 +9782,7 @@ type Query implements Node { jsonbIdentity(json: JSON): JSON noArgsQuery: Int queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first \`n\` values of the set.""" @@ -20204,6 +20226,10 @@ export const objects = { const selectArgs = makeArgs_compound_type_computed_field(args); return resource_query_text_arrayPgResource.execute(selectArgs); }, + readPgSettings($root, args, _info) { + const selectArgs = makeArgs_compound_type_computed_field(args); + return resource_read_pg_settingsPgResource.execute(selectArgs); + }, reserved(_$parent, args) { const $nodeId = args.getRaw("nodeId"); return nodeFetcher_Reserved($nodeId); diff --git a/postgraphile/postgraphile/__tests__/schema/v4/indexes.1.graphql b/postgraphile/postgraphile/__tests__/schema/v4/indexes.1.graphql index 44b6d4fcf4..df02d89857 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/indexes.1.graphql +++ b/postgraphile/postgraphile/__tests__/schema/v4/indexes.1.graphql @@ -7625,6 +7625,7 @@ type Query implements Node { ): QueryIntervalSetConnection queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord queryTextArray: [String] + readPgSettings: JSON """Reads a single `Reserved` using its globally unique `ID`.""" reserved( diff --git a/postgraphile/postgraphile/__tests__/schema/v4/inflect-builtin-lowercase.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/inflect-builtin-lowercase.1.export.mjs index 480691d839..4b4f777296 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/inflect-builtin-lowercase.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/inflect-builtin-lowercase.1.export.mjs @@ -2466,6 +2466,7 @@ const person_type_functionFunctionIdentifer = sql.identifier("c", "person_type_f const person_type_function_connectionFunctionIdentifer = sql.identifier("c", "person_type_function_connection"); const person_type_function_listFunctionIdentifer = sql.identifier("c", "person_type_function_list"); const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); +const read_pg_settingsFunctionIdentifer = sql.identifier("c", "read_pg_settings"); const return_table_without_grantsFunctionIdentifer = sql.identifier("c", "return_table_without_grants"); const search_test_summariesFunctionIdentifer = sql.identifier("c", "search_test_summaries"); const table_mutationFunctionIdentifer = sql.identifier("c", "table_mutation"); @@ -6436,6 +6437,25 @@ const registry = makeRegistry({ }, isUnique: true }, + read_pg_settings: { + executor: executor, + name: "read_pg_settings", + identifier: "main.c.read_pg_settings()", + from(...args) { + return sql`${read_pg_settingsFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [], + codec: TYPES.json, + hasImplicitOrder: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "read_pg_settings" + } + }, + isUnique: true + }, return_table_without_grants: PgResource.functionResourceOptions(compound_key_resourceOptionsConfig, { name: "return_table_without_grants", identifier: "main.c.return_table_without_grants()", @@ -7260,6 +7280,7 @@ const argDetailsSimple_query_output_two_rows = [{ }]; const makeArgs_query_output_two_rows = (args, path = []) => argDetailsSimple_query_output_two_rows.map(details => makeArg(path, args, details)); const resource_query_output_two_rowsPgResource = registry.pgResources["query_output_two_rows"]; +const resource_read_pg_settingsPgResource = registry.pgResources["read_pg_settings"]; const resource_return_table_without_grantsPgResource = registry.pgResources["return_table_without_grants"]; const resource_search_test_summariesPgResource = registry.pgResources["search_test_summaries"]; const argDetailsSimple_table_query = [{ @@ -9371,6 +9392,7 @@ type query implements node { jsonbIdentity(json: json): json noArgsQuery: Int queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: json returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first \`n\` values of the set.""" @@ -20332,6 +20354,10 @@ export const objects = { const selectArgs = makeArgs_compound_type_computed_field(args); return resource_query_text_arrayPgResource.execute(selectArgs); }, + readPgSettings($root, args, _info) { + const selectArgs = makeArgs_compound_type_computed_field(args); + return resource_read_pg_settingsPgResource.execute(selectArgs); + }, reserved(_$parent, args) { const $nodeId = args.getRaw("nodeId"); return nodeFetcher_Reserved($nodeId); diff --git a/postgraphile/postgraphile/__tests__/schema/v4/inflect-builtin-lowercase.1.graphql b/postgraphile/postgraphile/__tests__/schema/v4/inflect-builtin-lowercase.1.graphql index 32fb4c9516..c2d2739d4c 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/inflect-builtin-lowercase.1.graphql +++ b/postgraphile/postgraphile/__tests__/schema/v4/inflect-builtin-lowercase.1.graphql @@ -10377,6 +10377,7 @@ type query implements node { ): QueryIntervalSetConnection queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord queryTextArray: [String] + readPgSettings: json """Reads a single `Reserved` using its globally unique `ID`.""" reserved( diff --git a/postgraphile/postgraphile/__tests__/schema/v4/inflect-core.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/inflect-core.1.export.mjs index 1b7953ef30..aec7757627 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/inflect-core.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/inflect-core.1.export.mjs @@ -2466,6 +2466,7 @@ const person_type_functionFunctionIdentifer = sql.identifier("c", "person_type_f const person_type_function_connectionFunctionIdentifer = sql.identifier("c", "person_type_function_connection"); const person_type_function_listFunctionIdentifer = sql.identifier("c", "person_type_function_list"); const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); +const read_pg_settingsFunctionIdentifer = sql.identifier("c", "read_pg_settings"); const return_table_without_grantsFunctionIdentifer = sql.identifier("c", "return_table_without_grants"); const search_test_summariesFunctionIdentifer = sql.identifier("c", "search_test_summaries"); const table_mutationFunctionIdentifer = sql.identifier("c", "table_mutation"); @@ -6436,6 +6437,25 @@ const registry = makeRegistry({ }, isUnique: true }, + read_pg_settings: { + executor: executor, + name: "read_pg_settings", + identifier: "main.c.read_pg_settings()", + from(...args) { + return sql`${read_pg_settingsFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [], + codec: TYPES.json, + hasImplicitOrder: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "read_pg_settings" + } + }, + isUnique: true + }, return_table_without_grants: PgResource.functionResourceOptions(compound_key_resourceOptionsConfig, { name: "return_table_without_grants", identifier: "main.c.return_table_without_grants()", @@ -7260,6 +7280,7 @@ const argDetailsSimple_query_output_two_rows = [{ }]; const makeArgs_query_output_two_rows = (args, path = []) => argDetailsSimple_query_output_two_rows.map(details => makeArg(path, args, details)); const resource_query_output_two_rowsPgResource = registry.pgResources["query_output_two_rows"]; +const resource_read_pg_settingsPgResource = registry.pgResources["read_pg_settings"]; const resource_return_table_without_grantsPgResource = registry.pgResources["return_table_without_grants"]; const resource_search_test_summariesPgResource = registry.pgResources["search_test_summaries"]; const argDetailsSimple_table_query = [{ @@ -9371,6 +9392,7 @@ type Q implements N { jsonbIdentity(json: JSON): JSON noArgsQuery: Int queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first \`n\` values of the set.""" @@ -20332,6 +20354,10 @@ export const objects = { const selectArgs = makeArgs_compound_type_computed_field(args); return resource_query_text_arrayPgResource.execute(selectArgs); }, + readPgSettings($root, args, _info) { + const selectArgs = makeArgs_compound_type_computed_field(args); + return resource_read_pg_settingsPgResource.execute(selectArgs); + }, reserved(_$parent, args) { const $nodeId = args.getRaw("nodeId"); return nodeFetcher_Reserved($nodeId); diff --git a/postgraphile/postgraphile/__tests__/schema/v4/inflect-core.1.graphql b/postgraphile/postgraphile/__tests__/schema/v4/inflect-core.1.graphql index 4acb2ddb6a..21051fff08 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/inflect-core.1.graphql +++ b/postgraphile/postgraphile/__tests__/schema/v4/inflect-core.1.graphql @@ -7884,6 +7884,7 @@ type Q implements N { ): QueryIntervalSetConnection queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord queryTextArray: [String] + readPgSettings: JSON """Reads a single `Reserved` using its globally unique `ID`.""" reserved( diff --git a/postgraphile/postgraphile/__tests__/schema/v4/noDefaultMutations.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/noDefaultMutations.1.export.mjs index 769d178111..fd247ca113 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/noDefaultMutations.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/noDefaultMutations.1.export.mjs @@ -1706,6 +1706,7 @@ const person_type_functionFunctionIdentifer = sql.identifier("c", "person_type_f const person_type_function_connectionFunctionIdentifer = sql.identifier("c", "person_type_function_connection"); const person_type_function_listFunctionIdentifer = sql.identifier("c", "person_type_function_list"); const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); +const read_pg_settingsFunctionIdentifer = sql.identifier("c", "read_pg_settings"); const return_table_without_grantsFunctionIdentifer = sql.identifier("c", "return_table_without_grants"); const search_test_summariesFunctionIdentifer = sql.identifier("c", "search_test_summaries"); const table_mutationFunctionIdentifer = sql.identifier("c", "table_mutation"); @@ -3905,6 +3906,25 @@ const registry = makeRegistry({ }, isUnique: true }, + read_pg_settings: { + executor: executor, + name: "read_pg_settings", + identifier: "main.c.read_pg_settings()", + from(...args) { + return sql`${read_pg_settingsFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [], + codec: TYPES.json, + hasImplicitOrder: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "read_pg_settings" + } + }, + isUnique: true + }, return_table_without_grants: PgResource.functionResourceOptions(compound_key_resourceOptionsConfig, { name: "return_table_without_grants", identifier: "main.c.return_table_without_grants()", @@ -4446,6 +4466,7 @@ const argDetailsSimple_query_output_two_rows = [{ }]; const makeArgs_query_output_two_rows = (args, path = []) => argDetailsSimple_query_output_two_rows.map(details => makeArg(path, args, details)); const resource_query_output_two_rowsPgResource = registry.pgResources["query_output_two_rows"]; +const resource_read_pg_settingsPgResource = registry.pgResources["read_pg_settings"]; const resource_return_table_without_grantsPgResource = registry.pgResources["return_table_without_grants"]; const resource_search_test_summariesPgResource = registry.pgResources["search_test_summaries"]; const argDetailsSimple_table_query = [{ @@ -5511,6 +5532,7 @@ type Query implements Node { jsonbIdentity(json: JSON): JSON noArgsQuery: Int queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first \`n\` values of the set.""" @@ -8687,6 +8709,10 @@ export const objects = { const selectArgs = makeArgs_query_output_two_rows(args); return resource_query_output_two_rowsPgResource.execute(selectArgs); }, + readPgSettings($root, args, _info) { + const selectArgs = makeArgs_compound_type_computed_field(args); + return resource_read_pg_settingsPgResource.execute(selectArgs); + }, returnTableWithoutGrants($root, args, _info) { const selectArgs = makeArgs_compound_type_computed_field(args); return resource_return_table_without_grantsPgResource.execute(selectArgs); diff --git a/postgraphile/postgraphile/__tests__/schema/v4/noDefaultMutations.1.graphql b/postgraphile/postgraphile/__tests__/schema/v4/noDefaultMutations.1.graphql index 5b939b2489..1366cda616 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/noDefaultMutations.1.graphql +++ b/postgraphile/postgraphile/__tests__/schema/v4/noDefaultMutations.1.graphql @@ -2738,6 +2738,7 @@ type Query implements Node { """ query: Query! queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first `n` values of the set.""" diff --git a/postgraphile/postgraphile/__tests__/schema/v4/pgStrictFunctions.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/pgStrictFunctions.1.export.mjs index 8e789c7f4d..abdbd39f83 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/pgStrictFunctions.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/pgStrictFunctions.1.export.mjs @@ -2466,6 +2466,7 @@ const person_type_functionFunctionIdentifer = sql.identifier("c", "person_type_f const person_type_function_connectionFunctionIdentifer = sql.identifier("c", "person_type_function_connection"); const person_type_function_listFunctionIdentifer = sql.identifier("c", "person_type_function_list"); const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); +const read_pg_settingsFunctionIdentifer = sql.identifier("c", "read_pg_settings"); const return_table_without_grantsFunctionIdentifer = sql.identifier("c", "return_table_without_grants"); const search_test_summariesFunctionIdentifer = sql.identifier("c", "search_test_summaries"); const table_mutationFunctionIdentifer = sql.identifier("c", "table_mutation"); @@ -6540,6 +6541,25 @@ const registry = makeRegistry({ }, isUnique: true }, + read_pg_settings: { + executor: executor, + name: "read_pg_settings", + identifier: "main.c.read_pg_settings()", + from(...args) { + return sql`${read_pg_settingsFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [], + codec: TYPES.json, + hasImplicitOrder: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "read_pg_settings" + } + }, + isUnique: true + }, return_table_without_grants: PgResource.functionResourceOptions(compound_key_resourceOptionsConfig, { name: "return_table_without_grants", identifier: "main.c.return_table_without_grants()", @@ -7366,6 +7386,7 @@ const argDetailsSimple_query_output_two_rows = [{ }]; const makeArgs_query_output_two_rows = (args, path = []) => argDetailsSimple_query_output_two_rows.map(details => makeArg(path, args, details)); const resource_query_output_two_rowsPgResource = registry.pgResources["query_output_two_rows"]; +const resource_read_pg_settingsPgResource = registry.pgResources["read_pg_settings"]; const resource_return_table_without_grantsPgResource = registry.pgResources["return_table_without_grants"]; const resource_search_test_summariesPgResource = registry.pgResources["search_test_summaries"]; const argDetailsSimple_table_query = [{ @@ -9472,6 +9493,7 @@ type Query implements Node { jsonbIdentity(json: JSON!): JSON noArgsQuery: Int queryOutputTwoRows(leftArmId: Int!, postId: Int!, txt: String!): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first \`n\` values of the set.""" @@ -20433,6 +20455,10 @@ export const objects = { const selectArgs = makeArgs_compound_type_computed_field(args); return resource_query_text_arrayPgResource.execute(selectArgs); }, + readPgSettings($root, args, _info) { + const selectArgs = makeArgs_compound_type_computed_field(args); + return resource_read_pg_settingsPgResource.execute(selectArgs); + }, reserved(_$parent, args) { const $nodeId = args.getRaw("nodeId"); return nodeFetcher_Reserved($nodeId); diff --git a/postgraphile/postgraphile/__tests__/schema/v4/pgStrictFunctions.1.graphql b/postgraphile/postgraphile/__tests__/schema/v4/pgStrictFunctions.1.graphql index cc22b5930a..433fc3adc9 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/pgStrictFunctions.1.graphql +++ b/postgraphile/postgraphile/__tests__/schema/v4/pgStrictFunctions.1.graphql @@ -7879,6 +7879,7 @@ type Query implements Node { ): QueryIntervalSetConnection queryOutputTwoRows(leftArmId: Int!, postId: Int!, txt: String!): QueryOutputTwoRowsRecord queryTextArray: [String] + readPgSettings: JSON """Reads a single `Reserved` using its globally unique `ID`.""" reserved( diff --git a/postgraphile/postgraphile/__tests__/schema/v4/rbac.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/rbac.1.export.mjs index ac56e70813..1938f316b0 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/rbac.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/rbac.1.export.mjs @@ -3294,6 +3294,7 @@ const person_type_functionFunctionIdentifer = sql.identifier("c", "person_type_f const person_type_function_connectionFunctionIdentifer = sql.identifier("c", "person_type_function_connection"); const person_type_function_listFunctionIdentifer = sql.identifier("c", "person_type_function_list"); const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); +const read_pg_settingsFunctionIdentifer = sql.identifier("c", "read_pg_settings"); const return_table_without_grantsFunctionIdentifer = sql.identifier("c", "return_table_without_grants"); const search_test_summariesFunctionIdentifer = sql.identifier("c", "search_test_summaries"); const table_mutationFunctionIdentifer = sql.identifier("c", "table_mutation"); @@ -7511,6 +7512,26 @@ const registry = makeRegistry({ }, isUnique: true }, + read_pg_settings: { + executor: executor, + name: "read_pg_settings", + identifier: "main.c.read_pg_settings()", + from(...args) { + return sql`${read_pg_settingsFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [], + codec: TYPES.json, + hasImplicitOrder: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "read_pg_settings" + }, + canExecute: true + }, + isUnique: true + }, return_table_without_grants: PgResource.functionResourceOptions(compound_key_resourceOptionsConfig, { name: "return_table_without_grants", identifier: "main.c.return_table_without_grants()", @@ -7966,6 +7987,7 @@ const resource_personPgResource = registry.pgResources["person"]; const resource_person_secretPgResource = registry.pgResources["person_secret"]; const makeArgs_current_user_id = () => []; const resource_current_user_idPgResource = registry.pgResources["current_user_id"]; +const resource_read_pg_settingsPgResource = registry.pgResources["read_pg_settings"]; const resource_return_table_without_grantsPgResource = registry.pgResources["return_table_without_grants"]; const resource_table_set_query_volatilePgResource = registry.pgResources["table_set_query_volatile"]; const table_set_query_volatile_getSelectPlanFromParentAndArgs = ($root, args, _info) => { @@ -8395,6 +8417,7 @@ type Query implements Node { """Get a single \`PersonSecret\`.""" personSecretByPersonId(personId: Int!): PersonSecret @deprecated(reason: "This is deprecated (comment on table c.person_secret).") currentUserId: Int + readPgSettings: JSON returnTableWithoutGrants: CompoundKey """Reads and enables pagination through a set of \`Person\`.""" @@ -8794,6 +8817,11 @@ type LeftArm implements Node { personByPersonId: Person } +""" +A JavaScript object encoded in the JSON format as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). +""" +scalar JSON + type CompoundKey { personId2: Int! personId1: Int! @@ -9811,6 +9839,10 @@ export const objects = { query() { return constant(EMPTY_OBJECT); }, + readPgSettings($root, args, _info) { + const selectArgs = makeArgs_current_user_id(args); + return resource_read_pg_settingsPgResource.execute(selectArgs); + }, returnTableWithoutGrants($root, args, _info) { const selectArgs = makeArgs_current_user_id(args); return resource_return_table_without_grantsPgResource.execute(selectArgs); @@ -10682,6 +10714,21 @@ export const scalars = { throw new GraphQLError(`InternetAddress can only parse string values (kind='${ast.kind}')`); } }, + JSON: { + serialize(value) { + return JSON.stringify(value); + }, + parseValue(value) { + return JSON.parse(value); + }, + parseLiteral(ast, _variables) { + if (ast.kind === Kind.STRING) { + return JSON.parse(ast.value); + } else { + return undefined; + } + } + }, KeyValueHash: { serialize(value) { return value; diff --git a/postgraphile/postgraphile/__tests__/schema/v4/rbac.1.graphql b/postgraphile/postgraphile/__tests__/schema/v4/rbac.1.graphql index e384a5633a..29675b73c1 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/rbac.1.graphql +++ b/postgraphile/postgraphile/__tests__/schema/v4/rbac.1.graphql @@ -310,6 +310,11 @@ scalar Email """An IPv4 or IPv6 host address, and optionally its subnet.""" scalar InternetAddress +""" +A JavaScript object encoded in the JSON format as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). +""" +scalar JSON + """ A set of key/value pairs, keys are strings, values may be a string or null. Exposed as a JSON object. """ @@ -1123,6 +1128,7 @@ type Query implements Node { which can only query top level fields if they are in a particular form. """ query: Query! + readPgSettings: JSON returnTableWithoutGrants: CompoundKey """Reads and enables pagination through a set of `Person`.""" diff --git a/postgraphile/postgraphile/__tests__/schema/v4/rbac.ignore.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/rbac.ignore.1.export.mjs index 0df5b32723..9838c86efe 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/rbac.ignore.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/rbac.ignore.1.export.mjs @@ -2466,6 +2466,7 @@ const person_type_functionFunctionIdentifer = sql.identifier("c", "person_type_f const person_type_function_connectionFunctionIdentifer = sql.identifier("c", "person_type_function_connection"); const person_type_function_listFunctionIdentifer = sql.identifier("c", "person_type_function_list"); const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); +const read_pg_settingsFunctionIdentifer = sql.identifier("c", "read_pg_settings"); const return_table_without_grantsFunctionIdentifer = sql.identifier("c", "return_table_without_grants"); const search_test_summariesFunctionIdentifer = sql.identifier("c", "search_test_summaries"); const table_mutationFunctionIdentifer = sql.identifier("c", "table_mutation"); @@ -6436,6 +6437,25 @@ const registry = makeRegistry({ }, isUnique: true }, + read_pg_settings: { + executor: executor, + name: "read_pg_settings", + identifier: "main.c.read_pg_settings()", + from(...args) { + return sql`${read_pg_settingsFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [], + codec: TYPES.json, + hasImplicitOrder: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "read_pg_settings" + } + }, + isUnique: true + }, return_table_without_grants: PgResource.functionResourceOptions(compound_key_resourceOptionsConfig, { name: "return_table_without_grants", identifier: "main.c.return_table_without_grants()", @@ -7260,6 +7280,7 @@ const argDetailsSimple_query_output_two_rows = [{ }]; const makeArgs_query_output_two_rows = (args, path = []) => argDetailsSimple_query_output_two_rows.map(details => makeArg(path, args, details)); const resource_query_output_two_rowsPgResource = registry.pgResources["query_output_two_rows"]; +const resource_read_pg_settingsPgResource = registry.pgResources["read_pg_settings"]; const resource_return_table_without_grantsPgResource = registry.pgResources["return_table_without_grants"]; const resource_search_test_summariesPgResource = registry.pgResources["search_test_summaries"]; const argDetailsSimple_table_query = [{ @@ -9366,6 +9387,7 @@ type Query implements Node { jsonbIdentity(json: JSON): JSON noArgsQuery: Int queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first \`n\` values of the set.""" @@ -20327,6 +20349,10 @@ export const objects = { const selectArgs = makeArgs_compound_type_computed_field(args); return resource_query_text_arrayPgResource.execute(selectArgs); }, + readPgSettings($root, args, _info) { + const selectArgs = makeArgs_compound_type_computed_field(args); + return resource_read_pg_settingsPgResource.execute(selectArgs); + }, reserved(_$parent, args) { const $nodeId = args.getRaw("nodeId"); return nodeFetcher_Reserved($nodeId); diff --git a/postgraphile/postgraphile/__tests__/schema/v4/rbac.ignore.1.graphql b/postgraphile/postgraphile/__tests__/schema/v4/rbac.ignore.1.graphql index 3b3ed5c7f9..3f75a4abe0 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/rbac.ignore.1.graphql +++ b/postgraphile/postgraphile/__tests__/schema/v4/rbac.ignore.1.graphql @@ -7879,6 +7879,7 @@ type Query implements Node { ): QueryIntervalSetConnection queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord queryTextArray: [String] + readPgSettings: JSON """Reads a single `Reserved` using its globally unique `ID`.""" reserved( diff --git a/postgraphile/postgraphile/__tests__/schema/v4/relay1.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/relay1.1.export.mjs index 67c8af582f..b7c1ab4d35 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/relay1.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/relay1.1.export.mjs @@ -1706,6 +1706,7 @@ const person_type_functionFunctionIdentifer = sql.identifier("c", "person_type_f const person_type_function_connectionFunctionIdentifer = sql.identifier("c", "person_type_function_connection"); const person_type_function_listFunctionIdentifer = sql.identifier("c", "person_type_function_list"); const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); +const read_pg_settingsFunctionIdentifer = sql.identifier("c", "read_pg_settings"); const return_table_without_grantsFunctionIdentifer = sql.identifier("c", "return_table_without_grants"); const search_test_summariesFunctionIdentifer = sql.identifier("c", "search_test_summaries"); const table_mutationFunctionIdentifer = sql.identifier("c", "table_mutation"); @@ -3905,6 +3906,25 @@ const registry = makeRegistry({ }, isUnique: true }, + read_pg_settings: { + executor: executor, + name: "read_pg_settings", + identifier: "main.c.read_pg_settings()", + from(...args) { + return sql`${read_pg_settingsFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [], + codec: TYPES.json, + hasImplicitOrder: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "read_pg_settings" + } + }, + isUnique: true + }, return_table_without_grants: PgResource.functionResourceOptions(compound_key_resourceOptionsConfig, { name: "return_table_without_grants", identifier: "main.c.return_table_without_grants()", @@ -4446,6 +4466,7 @@ const argDetailsSimple_query_output_two_rows = [{ }]; const makeArgs_query_output_two_rows = (args, path = []) => argDetailsSimple_query_output_two_rows.map(details => makeArg(path, args, details)); const resource_query_output_two_rowsPgResource = registry.pgResources["query_output_two_rows"]; +const resource_read_pg_settingsPgResource = registry.pgResources["read_pg_settings"]; const resource_return_table_without_grantsPgResource = registry.pgResources["return_table_without_grants"]; const resource_search_test_summariesPgResource = registry.pgResources["search_test_summaries"]; const argDetailsSimple_table_query = [{ @@ -5649,6 +5670,7 @@ type Query implements Node { jsonbIdentity(json: JSON): JSON noArgsQuery: Int queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first \`n\` values of the set.""" @@ -10395,6 +10417,10 @@ export const objects = { const selectArgs = makeArgs_query_output_two_rows(args); return resource_query_output_two_rowsPgResource.execute(selectArgs); }, + readPgSettings($root, args, _info) { + const selectArgs = makeArgs_compound_type_computed_field(args); + return resource_read_pg_settingsPgResource.execute(selectArgs); + }, returnTableWithoutGrants($root, args, _info) { const selectArgs = makeArgs_compound_type_computed_field(args); return resource_return_table_without_grantsPgResource.execute(selectArgs); diff --git a/postgraphile/postgraphile/__tests__/schema/v4/relay1.1.graphql b/postgraphile/postgraphile/__tests__/schema/v4/relay1.1.graphql index 3cfdfd06cd..9b9e8bb4a5 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/relay1.1.graphql +++ b/postgraphile/postgraphile/__tests__/schema/v4/relay1.1.graphql @@ -3861,6 +3861,7 @@ type Query implements Node { """ query: Query! queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first `n` values of the set.""" diff --git a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.1.export.mjs index 3670106df7..84b209e27b 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.1.export.mjs @@ -1706,6 +1706,7 @@ const person_type_functionFunctionIdentifer = sql.identifier("c", "person_type_f const person_type_function_connectionFunctionIdentifer = sql.identifier("c", "person_type_function_connection"); const person_type_function_listFunctionIdentifer = sql.identifier("c", "person_type_function_list"); const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); +const read_pg_settingsFunctionIdentifer = sql.identifier("c", "read_pg_settings"); const return_table_without_grantsFunctionIdentifer = sql.identifier("c", "return_table_without_grants"); const search_test_summariesFunctionIdentifer = sql.identifier("c", "search_test_summaries"); const table_mutationFunctionIdentifer = sql.identifier("c", "table_mutation"); @@ -3905,6 +3906,25 @@ const registry = makeRegistry({ }, isUnique: true }, + read_pg_settings: { + executor: executor, + name: "read_pg_settings", + identifier: "main.c.read_pg_settings()", + from(...args) { + return sql`${read_pg_settingsFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [], + codec: TYPES.json, + hasImplicitOrder: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "read_pg_settings" + } + }, + isUnique: true + }, return_table_without_grants: PgResource.functionResourceOptions(compound_key_resourceOptionsConfig, { name: "return_table_without_grants", identifier: "main.c.return_table_without_grants()", @@ -4446,6 +4466,7 @@ const argDetailsSimple_query_output_two_rows = [{ }]; const makeArgs_query_output_two_rows = (args, path = []) => argDetailsSimple_query_output_two_rows.map(details => makeArg(path, args, details)); const resource_query_output_two_rowsPgResource = registry.pgResources["query_output_two_rows"]; +const resource_read_pg_settingsPgResource = registry.pgResources["read_pg_settings"]; const resource_return_table_without_grantsPgResource = registry.pgResources["return_table_without_grants"]; const resource_search_test_summariesPgResource = registry.pgResources["search_test_summaries"]; const argDetailsSimple_table_query = [{ @@ -5728,6 +5749,7 @@ type Query implements Node { jsonbIdentity(json: JSON): JSON noArgsQuery: Int queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first \`n\` values of the set.""" @@ -10834,6 +10856,10 @@ export const objects = { const selectArgs = makeArgs_query_output_two_rows(args); return resource_query_output_two_rowsPgResource.execute(selectArgs); }, + readPgSettings($root, args, _info) { + const selectArgs = makeArgs_compound_type_computed_field(args); + return resource_read_pg_settingsPgResource.execute(selectArgs); + }, returnTableWithoutGrants($root, args, _info) { const selectArgs = makeArgs_compound_type_computed_field(args); return resource_return_table_without_grantsPgResource.execute(selectArgs); diff --git a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.1.graphql b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.1.graphql index 0b8fcde072..60f93d4df4 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.1.graphql +++ b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.1.graphql @@ -4126,6 +4126,7 @@ type Query implements Node { """ query: Query! queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first `n` values of the set.""" diff --git a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.only.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.only.1.export.mjs index a68ec15b82..ae5ed746e3 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.only.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.only.1.export.mjs @@ -1706,6 +1706,7 @@ const person_type_functionFunctionIdentifer = sql.identifier("c", "person_type_f const person_type_function_connectionFunctionIdentifer = sql.identifier("c", "person_type_function_connection"); const person_type_function_listFunctionIdentifer = sql.identifier("c", "person_type_function_list"); const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); +const read_pg_settingsFunctionIdentifer = sql.identifier("c", "read_pg_settings"); const return_table_without_grantsFunctionIdentifer = sql.identifier("c", "return_table_without_grants"); const search_test_summariesFunctionIdentifer = sql.identifier("c", "search_test_summaries"); const table_mutationFunctionIdentifer = sql.identifier("c", "table_mutation"); @@ -3905,6 +3906,25 @@ const registry = makeRegistry({ }, isUnique: true }, + read_pg_settings: { + executor: executor, + name: "read_pg_settings", + identifier: "main.c.read_pg_settings()", + from(...args) { + return sql`${read_pg_settingsFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [], + codec: TYPES.json, + hasImplicitOrder: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "read_pg_settings" + } + }, + isUnique: true + }, return_table_without_grants: PgResource.functionResourceOptions(compound_key_resourceOptionsConfig, { name: "return_table_without_grants", identifier: "main.c.return_table_without_grants()", @@ -4401,6 +4421,7 @@ const argDetailsSimple_query_output_two_rows = [{ }]; const makeArgs_query_output_two_rows = (args, path = []) => argDetailsSimple_query_output_two_rows.map(details => makeArg(path, args, details)); const resource_query_output_two_rowsPgResource = registry.pgResources["query_output_two_rows"]; +const resource_read_pg_settingsPgResource = registry.pgResources["read_pg_settings"]; const resource_return_table_without_grantsPgResource = registry.pgResources["return_table_without_grants"]; const resource_search_test_summariesPgResource = registry.pgResources["search_test_summaries"]; const argDetailsSimple_table_query = [{ @@ -5425,6 +5446,7 @@ type Query implements Node { jsonbIdentity(json: JSON): JSON noArgsQuery: Int queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first \`n\` values of the set.""" @@ -9404,6 +9426,10 @@ export const objects = { const selectArgs = makeArgs_query_output_two_rows(args); return resource_query_output_two_rowsPgResource.execute(selectArgs); }, + readPgSettings($root, args, _info) { + const selectArgs = makeArgs_compound_type_computed_field(args); + return resource_read_pg_settingsPgResource.execute(selectArgs); + }, returnTableWithoutGrants($root, args, _info) { const selectArgs = makeArgs_compound_type_computed_field(args); return resource_return_table_without_grantsPgResource.execute(selectArgs); diff --git a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.only.1.graphql b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.only.1.graphql index b687862c39..185c2d69ad 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.only.1.graphql +++ b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.only.1.graphql @@ -3115,6 +3115,7 @@ type Query implements Node { """ query: Query! queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first `n` values of the set.""" diff --git a/postgraphile/postgraphile/__tests__/schema/v4/simplePrint.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/simplePrint.export.mjs index 0df5b32723..9838c86efe 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/simplePrint.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/simplePrint.export.mjs @@ -2466,6 +2466,7 @@ const person_type_functionFunctionIdentifer = sql.identifier("c", "person_type_f const person_type_function_connectionFunctionIdentifer = sql.identifier("c", "person_type_function_connection"); const person_type_function_listFunctionIdentifer = sql.identifier("c", "person_type_function_list"); const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); +const read_pg_settingsFunctionIdentifer = sql.identifier("c", "read_pg_settings"); const return_table_without_grantsFunctionIdentifer = sql.identifier("c", "return_table_without_grants"); const search_test_summariesFunctionIdentifer = sql.identifier("c", "search_test_summaries"); const table_mutationFunctionIdentifer = sql.identifier("c", "table_mutation"); @@ -6436,6 +6437,25 @@ const registry = makeRegistry({ }, isUnique: true }, + read_pg_settings: { + executor: executor, + name: "read_pg_settings", + identifier: "main.c.read_pg_settings()", + from(...args) { + return sql`${read_pg_settingsFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [], + codec: TYPES.json, + hasImplicitOrder: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "read_pg_settings" + } + }, + isUnique: true + }, return_table_without_grants: PgResource.functionResourceOptions(compound_key_resourceOptionsConfig, { name: "return_table_without_grants", identifier: "main.c.return_table_without_grants()", @@ -7260,6 +7280,7 @@ const argDetailsSimple_query_output_two_rows = [{ }]; const makeArgs_query_output_two_rows = (args, path = []) => argDetailsSimple_query_output_two_rows.map(details => makeArg(path, args, details)); const resource_query_output_two_rowsPgResource = registry.pgResources["query_output_two_rows"]; +const resource_read_pg_settingsPgResource = registry.pgResources["read_pg_settings"]; const resource_return_table_without_grantsPgResource = registry.pgResources["return_table_without_grants"]; const resource_search_test_summariesPgResource = registry.pgResources["search_test_summaries"]; const argDetailsSimple_table_query = [{ @@ -9366,6 +9387,7 @@ type Query implements Node { jsonbIdentity(json: JSON): JSON noArgsQuery: Int queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first \`n\` values of the set.""" @@ -20327,6 +20349,10 @@ export const objects = { const selectArgs = makeArgs_compound_type_computed_field(args); return resource_query_text_arrayPgResource.execute(selectArgs); }, + readPgSettings($root, args, _info) { + const selectArgs = makeArgs_compound_type_computed_field(args); + return resource_read_pg_settingsPgResource.execute(selectArgs); + }, reserved(_$parent, args) { const $nodeId = args.getRaw("nodeId"); return nodeFetcher_Reserved($nodeId); diff --git a/postgraphile/postgraphile/__tests__/schema/v4/simplePrint.graphql b/postgraphile/postgraphile/__tests__/schema/v4/simplePrint.graphql index 941550a9d0..aa17f64971 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/simplePrint.graphql +++ b/postgraphile/postgraphile/__tests__/schema/v4/simplePrint.graphql @@ -393,6 +393,7 @@ type Query implements Node { jsonbIdentity(json: JSON): JSON noArgsQuery: Int queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first `n` values of the set.""" diff --git a/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.1.export.mjs index 6778efa34d..17e6d17c7e 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.1.export.mjs @@ -2414,6 +2414,7 @@ const person_type_functionFunctionIdentifer = sql.identifier("c", "person_type_f const person_type_function_connectionFunctionIdentifer = sql.identifier("c", "person_type_function_connection"); const person_type_function_listFunctionIdentifer = sql.identifier("c", "person_type_function_list"); const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); +const read_pg_settingsFunctionIdentifer = sql.identifier("c", "read_pg_settings"); const return_table_without_grantsFunctionIdentifer = sql.identifier("c", "return_table_without_grants"); const search_test_summariesFunctionIdentifer = sql.identifier("c", "search_test_summaries"); const table_mutationFunctionIdentifer = sql.identifier("c", "table_mutation"); @@ -6384,6 +6385,25 @@ const registry = makeRegistry({ }, isUnique: true }, + read_pg_settings: { + executor: executor, + name: "read_pg_settings", + identifier: "main.c.read_pg_settings()", + from(...args) { + return sql`${read_pg_settingsFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [], + codec: TYPES.json, + hasImplicitOrder: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "read_pg_settings" + } + }, + isUnique: true + }, return_table_without_grants: PgResource.functionResourceOptions(compound_key_resourceOptionsConfig, { name: "return_table_without_grants", identifier: "main.c.return_table_without_grants()", @@ -7208,6 +7228,7 @@ const argDetailsSimple_query_output_two_rows = [{ }]; const makeArgs_query_output_two_rows = (args, path = []) => argDetailsSimple_query_output_two_rows.map(details => makeArg(path, args, details)); const resource_query_output_two_rowsPgResource = registry.pgResources["query_output_two_rows"]; +const resource_read_pg_settingsPgResource = registry.pgResources["read_pg_settings"]; const resource_return_table_without_grantsPgResource = registry.pgResources["return_table_without_grants"]; const resource_search_test_summariesPgResource = registry.pgResources["search_test_summaries"]; const argDetailsSimple_table_query = [{ @@ -8927,6 +8948,7 @@ type Query { jsonbIdentity(json: JSON): JSON noArgsQuery: Int queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord + readPgSettings: JSON returnTableWithoutGrants: CompoundKey searchTestSummariesList( """Only read the first \`n\` values of the set.""" @@ -18653,6 +18675,10 @@ export const objects = { const selectArgs = makeArgs_compound_type_computed_field(args); return resource_query_text_arrayPgResource.execute(selectArgs); }, + readPgSettings($root, args, _info) { + const selectArgs = makeArgs_compound_type_computed_field(args); + return resource_read_pg_settingsPgResource.execute(selectArgs); + }, reservedById(_$root, { $id }) { diff --git a/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.1.graphql b/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.1.graphql index 1706d25c03..919c6175d4 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.1.graphql +++ b/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.1.graphql @@ -7115,6 +7115,7 @@ type Query { ): QueryIntervalSetConnection queryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): QueryOutputTwoRowsRecord queryTextArray: [String] + readPgSettings: JSON """Get a single `Reserved`.""" reservedById(id: Int!): Reserved diff --git a/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.1.export.mjs index dcf301b689..5e1e02e35a 100644 --- a/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.1.export.mjs @@ -2402,6 +2402,7 @@ const person_type_functionFunctionIdentifer = sql.identifier("c", "person_type_f const person_type_function_connectionFunctionIdentifer = sql.identifier("c", "person_type_function_connection"); const person_type_function_listFunctionIdentifer = sql.identifier("c", "person_type_function_list"); const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); +const read_pg_settingsFunctionIdentifer = sql.identifier("c", "read_pg_settings"); const return_table_without_grantsFunctionIdentifer = sql.identifier("c", "return_table_without_grants"); const search_test_summariesFunctionIdentifer = sql.identifier("c", "search_test_summaries"); const table_mutationFunctionIdentifer = sql.identifier("c", "table_mutation"); @@ -6363,6 +6364,25 @@ const registry = makeRegistry({ }, isUnique: true }, + c_read_pg_settings: { + executor: executor, + name: "c_read_pg_settings", + identifier: "main.c.read_pg_settings()", + from(...args) { + return sql`${read_pg_settingsFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [], + codec: TYPES.json, + hasImplicitOrder: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "read_pg_settings" + } + }, + isUnique: true + }, c_return_table_without_grants: PgResource.functionResourceOptions(c_compound_key_resourceOptionsConfig, { name: "c_return_table_without_grants", identifier: "main.c.return_table_without_grants()", @@ -7186,6 +7206,7 @@ const argDetailsSimple_c_query_output_two_rows = [{ }]; const makeArgs_c_query_output_two_rows = (args, path = []) => argDetailsSimple_c_query_output_two_rows.map(details => makeArg(path, args, details)); const resource_c_query_output_two_rowsPgResource = registry.pgResources["c_query_output_two_rows"]; +const resource_c_read_pg_settingsPgResource = registry.pgResources["c_read_pg_settings"]; const resource_c_return_table_without_grantsPgResource = registry.pgResources["c_return_table_without_grants"]; const resource_c_search_test_summariesPgResource = registry.pgResources["c_search_test_summaries"]; const c_search_test_summaries_getSelectPlanFromParentAndArgs = ($root, args, _info) => { @@ -8828,6 +8849,7 @@ type Query { cJsonbIdentity(json: JSON): JSON cNoArgsQuery: Int cQueryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): CQueryOutputTwoRowsRecord + cReadPgSettings: JSON cReturnTableWithoutGrants: CCompoundKey """ @@ -18475,6 +18497,10 @@ export const objects = { const selectArgs = makeArgs_c_query_output_two_rows(args); return resource_c_query_output_two_rowsPgResource.execute(selectArgs); }, + cReadPgSettings($root, args, _info) { + const selectArgs = makeArgs_query_compound_type_array2(args); + return resource_c_read_pg_settingsPgResource.execute(selectArgs); + }, cReturnTableWithoutGrants($root, args, _info) { const selectArgs = makeArgs_query_compound_type_array2(args); return resource_c_return_table_without_grantsPgResource.execute(selectArgs); diff --git a/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.1.graphql b/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.1.graphql index 705fd92988..ed7fd56b5c 100644 --- a/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.1.graphql +++ b/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.1.graphql @@ -7649,6 +7649,7 @@ type Query { """Get a single `CPersonSecret`.""" cPersonSecretByPersonId(personId: Int!): CPersonSecret @deprecated(reason: "This is deprecated (comment on table c.person_secret).") cQueryOutputTwoRows(leftArmId: Int, postId: Int, txt: String): CQueryOutputTwoRowsRecord + cReadPgSettings: JSON cReturnTableWithoutGrants: CCompoundKey """