From d099bf65ed5eae0fdcd4a18ee95aa5135a12263d Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Fri, 27 Sep 2024 13:25:19 +0100 Subject: [PATCH 01/10] Fix logic around @omit emulation and smart-tag inheritance --- .../src/plugins/PgBasicsPlugin.ts | 15 ++++++++----- .../src/plugins/PgTablesPlugin.ts | 21 +++++++------------ .../src/plugins/PgV4SmartTagsPlugin.ts | 10 ++++----- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts index 5c4ec4c4b..19390dc80 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts @@ -255,16 +255,21 @@ export const PgBasicsPlugin: GraphileConfig.Plugin = { const attribute = codec.attributes[attributeName]; return [ behavior, - getBehavior([codec.extensions, attribute.extensions]), + getBehavior([attribute.codec.extensions, attribute.extensions]), ]; }, }, pgResource: { override(behavior, resource) { - return [ - behavior, - getBehavior([resource.codec.extensions, resource.extensions]), - ]; + if (!resource.parameters) { + // Functions should not inherit from their codec + return [ + behavior, + getBehavior([resource.codec.extensions, resource.extensions]), + ]; + } else { + return behavior; + } }, }, pgResourceUnique: { diff --git a/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts index 46095a9b9..e7e58c197 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts @@ -689,12 +689,7 @@ export const PgTablesPlugin: GraphileConfig.Plugin = { return; } - const selectable = build.behavior.pgCodecMatches( - codec, - "resource:select", - ); - - if (selectable) { + if (isTable) { build.registerObjectType( tableTypeName, { @@ -721,8 +716,8 @@ export const PgTablesPlugin: GraphileConfig.Plugin = { { pgCodec: codec, isInputType: true, - isPgRowType: selectable, - isPgCompoundType: !selectable, + isPgRowType: isTable, + isPgCompoundType: !isTable, }, () => ({ description: `An input for mutations affecting \`${tableTypeName}\``, @@ -754,8 +749,8 @@ export const PgTablesPlugin: GraphileConfig.Plugin = { { pgCodec: codec, isPgPatch: true, - isPgRowType: selectable, - isPgCompoundType: !selectable, + isPgRowType: isTable, + isPgCompoundType: !isTable, }, () => ({ description: `Represents an update to a \`${tableTypeName}\`. Fields that are set will be updated.`, @@ -783,8 +778,8 @@ export const PgTablesPlugin: GraphileConfig.Plugin = { { pgCodec: codec, isPgBaseInput: true, - isPgRowType: selectable, - isPgCompoundType: !selectable, + isPgRowType: isTable, + isPgCompoundType: !isTable, }, () => ({ description: `An input representation of \`${tableTypeName}\` with nullable fields.`, @@ -806,7 +801,7 @@ export const PgTablesPlugin: GraphileConfig.Plugin = { } if ( - selectable && + isTable && !codec.isAnonymous // Even without the 'connection' behavior we may still need the connection type in specific circumstances // && build.behavior.pgCodecMatches(codec, "*:connection") diff --git a/postgraphile/postgraphile/src/plugins/PgV4SmartTagsPlugin.ts b/postgraphile/postgraphile/src/plugins/PgV4SmartTagsPlugin.ts index 7cf46bdf0..e1cd1a346 100644 --- a/postgraphile/postgraphile/src/plugins/PgV4SmartTagsPlugin.ts +++ b/postgraphile/postgraphile/src/plugins/PgV4SmartTagsPlugin.ts @@ -199,11 +199,11 @@ function processOmit( return; } const behavior: string[] = []; - const processOmit = (omit: true | string): void => { - if (omit === true || omit === "*") { - behavior.push("-*"); - return; - } + const processOmit = (rawOmit: true | string): void => { + const omit = + rawOmit === true || rawOmit === "*" + ? "create,read,update,delete,execute,filter,order,all,many,manyToMany" + : rawOmit; if (typeof omit !== "string") { throw new Error( `Issue in smart tags; expected omit to be true/string/string[], but found something unexpected: ${inspect( From b94387819167058730d8ada55226e155686b7b9c Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Fri, 27 Sep 2024 13:32:55 +0100 Subject: [PATCH 02/10] Fix bug in 'graphile behavior debug pgResourceUnique' command --- utils/graphile/src/commands/behavior/debug/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/graphile/src/commands/behavior/debug/main.ts b/utils/graphile/src/commands/behavior/debug/main.ts index de120eb57..582dffb3b 100644 --- a/utils/graphile/src/commands/behavior/debug/main.ts +++ b/utils/graphile/src/commands/behavior/debug/main.ts @@ -240,7 +240,7 @@ function getEntities( if (!resource.uniques) continue; for (let i = 0, l = resource.uniques.length; i < l; i++) { const unique = resource.uniques[i]; - memo[`${resourceName}.${i}`] = unique; + memo[`${resourceName}.${i}`] = [resource, unique]; } } return memo; From f3f54f46c1887131ff8babf63261a167e7aef74c Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Fri, 27 Sep 2024 13:33:21 +0100 Subject: [PATCH 03/10] docs(changeset): Fixes bug in 'graphile behavior debug pgResourceUnique' command. --- .changeset/eleven-dolphins-judge.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/eleven-dolphins-judge.md diff --git a/.changeset/eleven-dolphins-judge.md b/.changeset/eleven-dolphins-judge.md new file mode 100644 index 000000000..1d9c12fe6 --- /dev/null +++ b/.changeset/eleven-dolphins-judge.md @@ -0,0 +1,5 @@ +--- +"graphile": patch +--- + +Fixes bug in 'graphile behavior debug pgResourceUnique' command. From afcb56b7334a737dc8afec9f9ffd4767bcb0ad1f Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Fri, 27 Sep 2024 13:36:12 +0100 Subject: [PATCH 04/10] @omit read should imply more behaviors --- postgraphile/postgraphile/src/plugins/PgV4SmartTagsPlugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postgraphile/postgraphile/src/plugins/PgV4SmartTagsPlugin.ts b/postgraphile/postgraphile/src/plugins/PgV4SmartTagsPlugin.ts index e1cd1a346..d044a36f1 100644 --- a/postgraphile/postgraphile/src/plugins/PgV4SmartTagsPlugin.ts +++ b/postgraphile/postgraphile/src/plugins/PgV4SmartTagsPlugin.ts @@ -219,7 +219,7 @@ function processOmit( break; } case "read": { - behavior.push("-select -node"); + behavior.push("-select -node -connection -list -array -single"); break; } case "update": { From 90adcf4cbb57dce7d43b7aa2f04d18529b941e7c Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Fri, 27 Sep 2024 13:49:07 +0100 Subject: [PATCH 05/10] Oops, fix bug I just introduced --- .../src/plugins/PgBasicsPlugin.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts index 19390dc80..8e11654ce 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts @@ -261,15 +261,15 @@ export const PgBasicsPlugin: GraphileConfig.Plugin = { }, pgResource: { override(behavior, resource) { - if (!resource.parameters) { - // Functions should not inherit from their codec - return [ - behavior, - getBehavior([resource.codec.extensions, resource.extensions]), - ]; - } else { - return behavior; - } + return [ + behavior, + getBehavior( + resource.parameters + ? // Functions should not inherit from their codec + [resource.extensions] + : [resource.codec.extensions, resource.extensions], + ), + ]; }, }, pgResourceUnique: { From d88c879cfa5b2d75b58fb5f1abd53c7cf37056d0 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Fri, 27 Sep 2024 14:23:52 +0100 Subject: [PATCH 06/10] Standardize unlogged behavior and extend to pgResourceUnique --- .../src/plugins/PgBasicsPlugin.ts | 11 +++ .../src/plugins/PgTablesPlugin.ts | 71 ++++++++++++------- 2 files changed, 55 insertions(+), 27 deletions(-) diff --git a/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts index 8e11654ce..6f22a6fd7 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts @@ -44,6 +44,8 @@ declare global { orderBy: true; "resource:connection": true; "resource:list": true; + "resource:array": true; + "resource:single": true; } type HasGraphQLTypeForPgCodec = ( codec: PgCodec, @@ -237,6 +239,15 @@ export const PgBasicsPlugin: GraphileConfig.Plugin = { description: "should we use a list field for this?", entities: ["pgCodec", "pgResource", "pgResourceUnique"], }, + "resource:array": { + description: + "should we use a list field for this non-connection-capable thing?", + entities: ["pgCodec", "pgResource", "pgResourceUnique"], + }, + "resource:single": { + description: "can we get one of this thing?", + entities: ["pgCodec", "pgResource", "pgResourceUnique"], + }, }, }, entityBehavior: { diff --git a/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts index e7e58c197..2cd31c6c9 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts @@ -2,7 +2,6 @@ import type { PgCodec, PgCodecAttribute, PgResource, - PgResourceExtensions, PgResourceOptions, PgResourceUnique, } from "@dataplan/pg"; @@ -468,7 +467,7 @@ export const PgTablesPlugin: GraphileConfig.Plugin = { const isVirtual = !["r", "v", "m", "f", "p"].includes( pgClass.relkind, ); - const extensions: PgResourceExtensions = { + const extensions: DataplanPg.PgResourceExtensions = { description, pg: { serviceName, @@ -611,24 +610,13 @@ export const PgTablesPlugin: GraphileConfig.Plugin = { before: ["inferred", "override"], callback(behavior, codec) { if (codec.attributes) { - const isUnloggedOrTemp = - codec.extensions?.pg?.persistence === "u" || - codec.extensions?.pg?.persistence === "t"; return [ "resource:select", "table", ...((!codec.isAnonymous ? ["resource:insert", "resource:update", "resource:delete"] : []) as GraphileBuild.BehaviorString[]), - behavior, - ...((isUnloggedOrTemp - ? [ - "-resource:select", - "-resource:insert", - "-resource:update", - "-resource:delete", - ] - : []) as GraphileBuild.BehaviorString[]), + ...unloggedOrTempBehaviors(codec.extensions, behavior, null), ]; } else { return [behavior]; @@ -641,28 +629,29 @@ export const PgTablesPlugin: GraphileConfig.Plugin = { provides: ["default"], before: ["inferred", "override"], callback(behavior, resource) { - const isFunction = !!resource.parameters; const ext = resource.extensions; - const isUnloggedOrTemp = - ext?.pg?.persistence === "u" || ext?.pg?.persistence === "t"; return [ ...(ext?.isInsertable === false ? ["-resource:insert"] : []), ...(ext?.isUpdatable === false ? ["-resource:update"] : []), ...(ext?.isDeletable === false ? ["-resource:delete"] : []), - ...(!isFunction && !isUnloggedOrTemp ? ["resource:select"] : []), - behavior, - ...(isUnloggedOrTemp - ? [ - "-resource:select", - "-resource:insert", - "-resource:update", - "-resource:delete", - ] - : []), + ...unloggedOrTempBehaviors(ext, behavior, resource), ] as GraphileBuild.BehaviorString[]; }, }, }, + pgResourceUnique: { + inferred: { + provides: ["default"], + before: ["inferred", "override"], + callback(behavior, [resource, unique]) { + return unloggedOrTempBehaviors( + resource.extensions, + behavior, + resource, + ); + }, + }, + }, }, hooks: { init(_, build, _context) { @@ -825,3 +814,31 @@ export const PgTablesPlugin: GraphileConfig.Plugin = { }, }, }; + +function unloggedOrTempBehaviors( + extensions: + | Partial + | Partial + | undefined, + behavior: GraphileBuild.BehaviorString, + resource: PgResource | null, +): GraphileBuild.BehaviorString[] { + const isUnloggedOrTemp = + extensions?.pg?.persistence === "u" || extensions?.pg?.persistence === "t"; + return [ + ...(resource && !resource.parameters ? ["resource:select" as const] : []), + behavior, + ...(isUnloggedOrTemp + ? ([ + "-resource:select", + "-resource:connection", + "-resource:list", + "-resource:array", + "-resource:single", + "-resource:insert", + "-resource:update", + "-resource:delete", + ] as const) + : []), + ]; +} From 16d364ce69b60a6ae1628d036184169c236f5fa6 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Fri, 27 Sep 2024 16:33:50 +0100 Subject: [PATCH 07/10] Add mutations back; no idea why they weren't present before --- ...-clash-with-tags-file-workaround.1.graphql | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) 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 977e116dd..73b964103 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 @@ -4361,6 +4361,18 @@ type Mutation { """ input: NoArgsMutationInput! ): NoArgsMutationPayload + postMany( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: PostManyInput! + ): PostManyPayload + postWithSuffix( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: PostWithSuffixInput! + ): PostWithSuffixPayload @deprecated(reason: "This is deprecated (comment on function a.post_with_suffix).") returnVoidMutation( """ The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. @@ -6269,6 +6281,41 @@ input PostCondition { id: Int } +"""An input for mutations affecting `Post`""" +input PostInput { + authorId: Int + body: String + comptypes: [ComptypeInput] + enums: [AnEnum] + headline: String! + id: Int +} + +"""All input for the `postMany` mutation.""" +input PostManyInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + posts: [PostInput] +} + +"""The output of our `postMany` mutation.""" +type PostManyPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + posts: [Post] + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + """Represents an update to a `Post`. Fields that are set will be updated.""" input PostPatch { authorId: Int @@ -6279,6 +6326,41 @@ input PostPatch { id: Int } +"""All input for the `postWithSuffix` mutation.""" +input PostWithSuffixInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + post: PostInput + suffix: String +} + +"""The output of our `postWithSuffix` mutation.""" +type PostWithSuffixPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """Reads a single `Person` that is related to this `Post`.""" + personByAuthorId: Person + post: Post + + """An edge for our `Post`. May be used by Relay 1.""" + postEdge( + """The method to use when ordering `Post`.""" + orderBy: [PostsOrderBy!]! = [PRIMARY_KEY_ASC] + ): PostsEdge + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + """A connection to a list of `Post` values.""" type PostsConnection { """ From e76fde674df29d980341d6835fdc7fa583f67f61 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Fri, 27 Sep 2024 17:00:12 +0100 Subject: [PATCH 08/10] Update schema exports --- .../schema/v4/enum_tables.1.export.mjs | 2 +- ...ash-with-tags-file-workaround.1.export.mjs | 430 ++++++++++++++++-- .../schema/v4/omit-rename.1.export.mjs | 2 +- .../v4/omit-rename.omitcolumns.1.export.mjs | 2 +- ...it-rename.omitcolumns.execute.1.export.mjs | 2 +- ...ename.omitcolumns.loads-title.1.export.mjs | 4 +- ...tcolumns.shows-title-asterisk.1.export.mjs | 6 +- ...ename.omitcolumns.title-order.1.export.mjs | 2 +- ...name.omitcolumns.update-title.1.export.mjs | 2 +- .../v4/omit-rename.omitstuff.1.export.mjs | 2 +- ...-rename.omitstuff.constraints.1.export.mjs | 2 +- ...name.omitstuff.films-asterisk.1.export.mjs | 6 +- ...rename.omitstuff.films-create.1.export.mjs | 2 +- ...rename.omitstuff.films-delete.1.export.mjs | 2 +- ...-rename.omitstuff.films-loads.1.export.mjs | 4 +- ...rename.omitstuff.films-update.1.export.mjs | 2 +- ...-rename.omitstuff.shows-order.1.export.mjs | 2 +- .../schema/v4/polymorphic.1.export.mjs | 8 +- .../__tests__/schema/v4/refs.1.export.mjs | 6 +- .../__tests__/schema/v4/relay.1.export.mjs | 2 +- .../skipNodePlugin.polymorphic.1.export.mjs | 8 +- .../v4/smart_comment_relations.1.export.mjs | 4 +- .../smart_comment_relations.post.1.export.mjs | 4 +- ...t_comment_relations.post_view.1.export.mjs | 4 +- ...ent_relations.post_view_no_pk.1.export.mjs | 4 +- ...nt_relations.view_fake_unique.1.export.mjs | 4 +- ...relations.view_fake_unique_pk.1.export.mjs | 4 +- 27 files changed, 437 insertions(+), 85 deletions(-) diff --git a/postgraphile/postgraphile/__tests__/schema/v4/enum_tables.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/enum_tables.1.export.mjs index 80a0b6d86..84f8bb1f9 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/enum_tables.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/enum_tables.1.export.mjs @@ -523,7 +523,7 @@ const spec_lotsOfEnums = { }, tags: Object.assign(Object.create(null), { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor 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 666239536..03ab57a58 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 @@ -15369,16 +15369,22 @@ const makeArgs119 = (args, path = []) => { }; const resource_table_mutationPgResource = registry.pgResources["table_mutation"]; const argDetailsSimple120 = [{ - graphqlArgName: "object", - postgresArgName: "object", - pgCodec: compoundTypeCodec, + graphqlArgName: "post", + postgresArgName: "post", + pgCodec: postCodec, + required: true, + fetcher: null +}, { + graphqlArgName: "suffix", + postgresArgName: "suffix", + pgCodec: TYPES.text, required: true, fetcher: null }]; const makeArgs120 = (args, path = []) => { const selectArgs = []; let skipped = false; - for (let i = 0; i < 1; i++) { + for (let i = 0; i < 2; i++) { const { graphqlArgName, postgresArgName, @@ -15419,7 +15425,7 @@ const makeArgs120 = (args, path = []) => { } return selectArgs; }; -const resource_mutation_compound_type_arrayPgResource = registry.pgResources["mutation_compound_type_array"]; +const resource_post_with_suffixPgResource = registry.pgResources["post_with_suffix"]; const argDetailsSimple121 = [{ graphqlArgName: "object", postgresArgName: "object", @@ -15471,8 +15477,112 @@ const makeArgs121 = (args, path = []) => { } return selectArgs; }; -const resource_compound_type_array_mutationPgResource = registry.pgResources["compound_type_array_mutation"]; +const resource_mutation_compound_type_arrayPgResource = registry.pgResources["mutation_compound_type_array"]; const argDetailsSimple122 = [{ + graphqlArgName: "object", + postgresArgName: "object", + pgCodec: compoundTypeCodec, + required: true, + fetcher: null +}]; +const makeArgs122 = (args, path = []) => { + const selectArgs = []; + let skipped = false; + for (let i = 0; i < 1; i++) { + const { + graphqlArgName, + postgresArgName, + pgCodec, + required, + fetcher + } = argDetailsSimple122[i]; + const $raw = args.getRaw([...path, graphqlArgName]); + let step; + if ($raw.evalIs(undefined)) { + if (!required && i >= 0 - 1) { + skipped = true; + continue; + } else { + step = constant(null); + } + } else if (fetcher) { + step = fetcher(args.get([...path, graphqlArgName])).record(); + } else { + step = args.get([...path, graphqlArgName]); + } + if (skipped) { + const name = postgresArgName; + if (!name) { + throw new Error("GraphileInternalError<6f9e0fbc-6c73-4811-a7cf-c2bc2b3c0946>: This should not be possible since we asserted that allArgsAreNamed"); + } + selectArgs.push({ + step, + pgCodec, + name + }); + } else { + selectArgs.push({ + step, + pgCodec + }); + } + } + return selectArgs; +}; +const resource_compound_type_array_mutationPgResource = registry.pgResources["compound_type_array_mutation"]; +const argDetailsSimple123 = [{ + graphqlArgName: "posts", + postgresArgName: "posts", + pgCodec: postArrayCodec, + required: true, + fetcher: null +}]; +const makeArgs123 = (args, path = []) => { + const selectArgs = []; + let skipped = false; + for (let i = 0; i < 1; i++) { + const { + graphqlArgName, + postgresArgName, + pgCodec, + required, + fetcher + } = argDetailsSimple123[i]; + const $raw = args.getRaw([...path, graphqlArgName]); + let step; + if ($raw.evalIs(undefined)) { + if (!required && i >= 0 - 1) { + skipped = true; + continue; + } else { + step = constant(null); + } + } else if (fetcher) { + step = fetcher(args.get([...path, graphqlArgName])).record(); + } else { + step = args.get([...path, graphqlArgName]); + } + if (skipped) { + const name = postgresArgName; + if (!name) { + throw new Error("GraphileInternalError<6f9e0fbc-6c73-4811-a7cf-c2bc2b3c0946>: This should not be possible since we asserted that allArgsAreNamed"); + } + selectArgs.push({ + step, + pgCodec, + name + }); + } else { + selectArgs.push({ + step, + pgCodec + }); + } + } + return selectArgs; +}; +const resource_post_manyPgResource = registry.pgResources["post_many"]; +const argDetailsSimple124 = [{ graphqlArgName: "a", postgresArgName: "a", pgCodec: TYPES.int, @@ -15485,7 +15595,7 @@ const argDetailsSimple122 = [{ required: true, fetcher: null }]; -const makeArgs122 = (args, path = []) => { +const makeArgs124 = (args, path = []) => { const selectArgs = []; let skipped = false; for (let i = 0; i < 2; i++) { @@ -15495,7 +15605,7 @@ const makeArgs122 = (args, path = []) => { pgCodec, required, fetcher - } = argDetailsSimple122[i]; + } = argDetailsSimple124[i]; const $raw = args.getRaw([...path, graphqlArgName]); let step; if ($raw.evalIs(undefined)) { @@ -15530,7 +15640,7 @@ const makeArgs122 = (args, path = []) => { return selectArgs; }; const resource_mutation_out_complexPgResource = registry.pgResources["mutation_out_complex"]; -const argDetailsSimple123 = [{ +const argDetailsSimple125 = [{ graphqlArgName: "a", postgresArgName: "a", pgCodec: TYPES.int, @@ -15543,7 +15653,7 @@ const argDetailsSimple123 = [{ required: true, fetcher: null }]; -const makeArgs123 = (args, path = []) => { +const makeArgs125 = (args, path = []) => { const selectArgs = []; let skipped = false; for (let i = 0; i < 2; i++) { @@ -15553,7 +15663,7 @@ const makeArgs123 = (args, path = []) => { pgCodec, required, fetcher - } = argDetailsSimple123[i]; + } = argDetailsSimple125[i]; const $raw = args.getRaw([...path, graphqlArgName]); let step; if ($raw.evalIs(undefined)) { @@ -15588,8 +15698,8 @@ const makeArgs123 = (args, path = []) => { return selectArgs; }; const resource_mutation_out_complex_setofPgResource = registry.pgResources["mutation_out_complex_setof"]; -const argDetailsSimple124 = []; -const makeArgs124 = (args, path = []) => { +const argDetailsSimple126 = []; +const makeArgs126 = (args, path = []) => { const selectArgs = []; let skipped = false; for (let i = 0; i < 0; i++) { @@ -15599,7 +15709,7 @@ const makeArgs124 = (args, path = []) => { pgCodec, required, fetcher - } = argDetailsSimple124[i]; + } = argDetailsSimple126[i]; const $raw = args.getRaw([...path, graphqlArgName]); let step; if ($raw.evalIs(undefined)) { @@ -15634,8 +15744,8 @@ const makeArgs124 = (args, path = []) => { return selectArgs; }; const resource_mutation_out_tablePgResource = registry.pgResources["mutation_out_table"]; -const argDetailsSimple125 = []; -const makeArgs125 = (args, path = []) => { +const argDetailsSimple127 = []; +const makeArgs127 = (args, path = []) => { const selectArgs = []; let skipped = false; for (let i = 0; i < 0; i++) { @@ -15645,7 +15755,7 @@ const makeArgs125 = (args, path = []) => { pgCodec, required, fetcher - } = argDetailsSimple125[i]; + } = argDetailsSimple127[i]; const $raw = args.getRaw([...path, graphqlArgName]); let step; if ($raw.evalIs(undefined)) { @@ -15680,8 +15790,8 @@ const makeArgs125 = (args, path = []) => { return selectArgs; }; const resource_mutation_out_table_setofPgResource = registry.pgResources["mutation_out_table_setof"]; -const argDetailsSimple126 = []; -const makeArgs126 = (args, path = []) => { +const argDetailsSimple128 = []; +const makeArgs128 = (args, path = []) => { const selectArgs = []; let skipped = false; for (let i = 0; i < 0; i++) { @@ -15691,7 +15801,7 @@ const makeArgs126 = (args, path = []) => { pgCodec, required, fetcher - } = argDetailsSimple126[i]; + } = argDetailsSimple128[i]; const $raw = args.getRaw([...path, graphqlArgName]); let step; if ($raw.evalIs(undefined)) { @@ -15726,8 +15836,8 @@ const makeArgs126 = (args, path = []) => { return selectArgs; }; const resource_table_set_mutationPgResource = registry.pgResources["table_set_mutation"]; -const argDetailsSimple127 = []; -const makeArgs127 = (args, path = []) => { +const argDetailsSimple129 = []; +const makeArgs129 = (args, path = []) => { const selectArgs = []; let skipped = false; for (let i = 0; i < 0; i++) { @@ -15737,7 +15847,7 @@ const makeArgs127 = (args, path = []) => { pgCodec, required, fetcher - } = argDetailsSimple127[i]; + } = argDetailsSimple129[i]; const $raw = args.getRaw([...path, graphqlArgName]); let step; if ($raw.evalIs(undefined)) { @@ -15772,14 +15882,14 @@ const makeArgs127 = (args, path = []) => { return selectArgs; }; const resource_type_function_connection_mutationPgResource = registry.pgResources["type_function_connection_mutation"]; -const argDetailsSimple128 = [{ +const argDetailsSimple130 = [{ graphqlArgName: "id", postgresArgName: "id", pgCodec: TYPES.int, required: true, fetcher: null }]; -const makeArgs128 = (args, path = []) => { +const makeArgs130 = (args, path = []) => { const selectArgs = []; let skipped = false; for (let i = 0; i < 1; i++) { @@ -15789,7 +15899,7 @@ const makeArgs128 = (args, path = []) => { pgCodec, required, fetcher - } = argDetailsSimple128[i]; + } = argDetailsSimple130[i]; const $raw = args.getRaw([...path, graphqlArgName]); let step; if ($raw.evalIs(undefined)) { @@ -15824,8 +15934,8 @@ const makeArgs128 = (args, path = []) => { return selectArgs; }; const resource_type_function_mutationPgResource = registry.pgResources["type_function_mutation"]; -const argDetailsSimple129 = []; -const makeArgs129 = (args, path = []) => { +const argDetailsSimple131 = []; +const makeArgs131 = (args, path = []) => { const selectArgs = []; let skipped = false; for (let i = 0; i < 0; i++) { @@ -15835,7 +15945,7 @@ const makeArgs129 = (args, path = []) => { pgCodec, required, fetcher - } = argDetailsSimple129[i]; + } = argDetailsSimple131[i]; const $raw = args.getRaw([...path, graphqlArgName]); let step; if ($raw.evalIs(undefined)) { @@ -20412,6 +20522,12 @@ type Mutation { """ input: TableMutationInput! ): TableMutationPayload + postWithSuffix( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: PostWithSuffixInput! + ): PostWithSuffixPayload @deprecated(reason: "This is deprecated (comment on function a.post_with_suffix).") mutationCompoundTypeArray( """ The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. @@ -20424,6 +20540,12 @@ type Mutation { """ input: CompoundTypeArrayMutationInput! ): CompoundTypeArrayMutationPayload + postMany( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: PostManyInput! + ): PostManyPayload mutationOutComplex( """ The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. @@ -22518,6 +22640,51 @@ input TableMutationInput { id: Int } +"""The output of our \`postWithSuffix\` mutation.""" +type PostWithSuffixPayload { + """ + The exact same \`clientMutationId\` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + post: Post + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our \`Post\`. May be used by Relay 1.""" + postEdge( + """The method to use when ordering \`Post\`.""" + orderBy: [PostsOrderBy!]! = [PRIMARY_KEY_ASC] + ): PostsEdge + + """Reads a single \`Person\` that is related to this \`Post\`.""" + personByAuthorId: Person +} + +"""All input for the \`postWithSuffix\` mutation.""" +input PostWithSuffixInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + post: PostInput + suffix: String +} + +"""An input for mutations affecting \`Post\`""" +input PostInput { + id: Int + headline: String! + body: String + authorId: Int + enums: [AnEnum] + comptypes: [ComptypeInput] +} + """The output of our \`mutationCompoundTypeArray\` mutation.""" type MutationCompoundTypeArrayPayload { """ @@ -22568,6 +22735,31 @@ input CompoundTypeArrayMutationInput { object: CompoundTypeInput } +"""The output of our \`postMany\` mutation.""" +type PostManyPayload { + """ + The exact same \`clientMutationId\` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + posts: [Post] + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the \`postMany\` mutation.""" +input PostManyInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + posts: [PostInput] +} + """The output of our \`mutationOutComplex\` mutation.""" type MutationOutComplexPayload { """ @@ -39941,9 +40133,26 @@ export const plans = { } } }, - mutationCompoundTypeArray: { + postWithSuffix: { plan($root, args, _info) { const selectArgs = makeArgs120(args, ["input"]); + const $result = resource_post_with_suffixPgResource.execute(selectArgs, "mutation"); + return object({ + result: $result + }); + }, + args: { + input: { + autoApplyAfterParentPlan: true, + applyPlan(_, $object) { + return $object; + } + } + } + }, + mutationCompoundTypeArray: { + plan($root, args, _info) { + const selectArgs = makeArgs121(args, ["input"]); const $result = resource_mutation_compound_type_arrayPgResource.execute(selectArgs, "mutation"); return object({ result: $result @@ -39960,7 +40169,7 @@ export const plans = { }, compoundTypeArrayMutation: { plan($root, args, _info) { - const selectArgs = makeArgs121(args, ["input"]); + const selectArgs = makeArgs122(args, ["input"]); const $result = resource_compound_type_array_mutationPgResource.execute(selectArgs, "mutation"); return object({ result: $result @@ -39975,9 +40184,26 @@ export const plans = { } } }, + postMany: { + plan($root, args, _info) { + const selectArgs = makeArgs123(args, ["input"]); + const $result = resource_post_manyPgResource.execute(selectArgs, "mutation"); + return object({ + result: $result + }); + }, + args: { + input: { + autoApplyAfterParentPlan: true, + applyPlan(_, $object) { + return $object; + } + } + } + }, mutationOutComplex: { plan($root, args, _info) { - const selectArgs = makeArgs122(args, ["input"]); + const selectArgs = makeArgs124(args, ["input"]); const $result = resource_mutation_out_complexPgResource.execute(selectArgs, "mutation"); return object({ result: $result @@ -39994,7 +40220,7 @@ export const plans = { }, mutationOutComplexSetof: { plan($root, args, _info) { - const selectArgs = makeArgs123(args, ["input"]); + const selectArgs = makeArgs125(args, ["input"]); const $result = resource_mutation_out_complex_setofPgResource.execute(selectArgs, "mutation"); return object({ result: $result @@ -40011,7 +40237,7 @@ export const plans = { }, mutationOutTable: { plan($root, args, _info) { - const selectArgs = makeArgs124(args, ["input"]); + const selectArgs = makeArgs126(args, ["input"]); const $result = resource_mutation_out_tablePgResource.execute(selectArgs, "mutation"); return object({ result: $result @@ -40028,7 +40254,7 @@ export const plans = { }, mutationOutTableSetof: { plan($root, args, _info) { - const selectArgs = makeArgs125(args, ["input"]); + const selectArgs = makeArgs127(args, ["input"]); const $result = resource_mutation_out_table_setofPgResource.execute(selectArgs, "mutation"); return object({ result: $result @@ -40045,7 +40271,7 @@ export const plans = { }, tableSetMutation: { plan($root, args, _info) { - const selectArgs = makeArgs126(args, ["input"]); + const selectArgs = makeArgs128(args, ["input"]); const $result = resource_table_set_mutationPgResource.execute(selectArgs, "mutation"); return object({ result: $result @@ -40062,7 +40288,7 @@ export const plans = { }, typeFunctionConnectionMutation: { plan($root, args, _info) { - const selectArgs = makeArgs127(args, ["input"]); + const selectArgs = makeArgs129(args, ["input"]); const $result = resource_type_function_connection_mutationPgResource.execute(selectArgs, "mutation"); return object({ result: $result @@ -40079,7 +40305,7 @@ export const plans = { }, typeFunctionMutation: { plan($root, args, _info) { - const selectArgs = makeArgs128(args, ["input"]); + const selectArgs = makeArgs130(args, ["input"]); const $result = resource_type_function_mutationPgResource.execute(selectArgs, "mutation"); return object({ result: $result @@ -40096,7 +40322,7 @@ export const plans = { }, typeFunctionListMutation: { plan($root, args, _info) { - const selectArgs = makeArgs129(args, ["input"]); + const selectArgs = makeArgs131(args, ["input"]); const $result = resource_type_function_list_mutationPgResource.execute(selectArgs, "mutation"); return object({ result: $result @@ -43058,6 +43284,111 @@ export const plans = { }, id: undefined }, + PostWithSuffixPayload: { + __assertStep: ObjectStep, + clientMutationId($object) { + return $object.getStepForKey("clientMutationId", true) ?? constant(undefined); + }, + post($object) { + return $object.get("result"); + }, + query() { + return rootValue(); + }, + postEdge: { + plan($mutation, args, info) { + const $result = $mutation.getStepForKey("result", true); + if (!$result) { + return constant(null); + } + const $select = (() => { + if ($result instanceof PgDeleteSingleStep) { + return pgSelectFromRecord($result.resource, $result.record()); + } else { + const spec = postUniques[0].attributes.reduce((memo, attributeName) => { + memo[attributeName] = $result.get(attributeName); + return memo; + }, Object.create(null)); + return pgResource_postPgResource.find(spec); + } + })(); + // Perform ordering + const $value = args.getRaw("orderBy"); + applyOrderToPlan($select, $value, info.schema.getType("PostsOrderBy")); + const $connection = connection($select); + // NOTE: you must not use `$single = $select.single()` + // here because doing so will mark the row as unique, and + // then the ordering logic (and thus cursor) will differ. + const $single = $select.row(first($select)); + return new EdgeStep($connection, $single); + }, + args: { + orderBy: undefined + } + }, + personByAuthorId($record) { + return pgResource_personPgResource.get({ + id: $record.get("result").get("author_id") + }); + } + }, + PostWithSuffixInput: { + clientMutationId: { + applyPlan($input, val) { + $input.set("clientMutationId", val.get()); + }, + autoApplyAfterParentApplyPlan: true + }, + post: undefined, + suffix: undefined + }, + PostInput: { + "__inputPlan": function PostInput_inputPlan() { + return object(Object.create(null)); + }, + id: { + applyPlan($insert, val) { + $insert.set("id", val.get()); + }, + autoApplyAfterParentInputPlan: true, + autoApplyAfterParentApplyPlan: true + }, + headline: { + applyPlan($insert, val) { + $insert.set("headline", val.get()); + }, + autoApplyAfterParentInputPlan: true, + autoApplyAfterParentApplyPlan: true + }, + body: { + applyPlan($insert, val) { + $insert.set("body", val.get()); + }, + autoApplyAfterParentInputPlan: true, + autoApplyAfterParentApplyPlan: true + }, + authorId: { + applyPlan($insert, val) { + $insert.set("author_id", val.get()); + }, + autoApplyAfterParentInputPlan: true, + autoApplyAfterParentApplyPlan: true + }, + enums: { + applyPlan($insert, val) { + $insert.set("enums", val.get()); + }, + autoApplyAfterParentInputPlan: true, + autoApplyAfterParentApplyPlan: true + }, + comptypes: { + applyPlan($insert, val) { + $insert.set("comptypes", val.get()); + }, + autoApplyAfterParentInputPlan: true, + autoApplyAfterParentApplyPlan: true + } + }, MutationCompoundTypeArrayPayload: { __assertStep: ObjectStep, clientMutationId($object) { @@ -43100,6 +43431,27 @@ export const plans = { }, object: undefined }, + PostManyPayload: { + __assertStep: ObjectStep, + clientMutationId($object) { + return $object.getStepForKey("clientMutationId", true) ?? constant(undefined); + }, + posts($object) { + return $object.get("result"); + }, + query() { + return rootValue(); + } + }, + PostManyInput: { + clientMutationId: { + applyPlan($input, val) { + $input.set("clientMutationId", val.get()); + }, + autoApplyAfterParentApplyPlan: true + }, + posts: undefined + }, MutationOutComplexPayload: { __assertStep: ObjectStep, clientMutationId($object) { diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.1.export.mjs index 6ba72dbe4..33b077f69 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.1.export.mjs @@ -505,7 +505,7 @@ const spec_person = { extensions: { tags: { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] } } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.1.export.mjs index 0d9abf666..f1e25449a 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.1.export.mjs @@ -508,7 +508,7 @@ const spec_person = { extensions: { tags: { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] } } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.execute.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.execute.1.export.mjs index 2b7063db6..bedac4b92 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.execute.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.execute.1.export.mjs @@ -505,7 +505,7 @@ const spec_person = { extensions: { tags: { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] } } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.loads-title.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.loads-title.1.export.mjs index 659c66f97..013f184a4 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.loads-title.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.loads-title.1.export.mjs @@ -324,7 +324,7 @@ const spec_tvShows = { extensions: { tags: { omit: "read,create,update,delete,all,many", - behavior: ["-select -node -insert -update -delete -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection"] + behavior: ["-select -node -connection -list -array -single -insert -update -delete -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection"] } } }, @@ -508,7 +508,7 @@ const spec_person = { extensions: { tags: { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] } } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.shows-title-asterisk.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.shows-title-asterisk.1.export.mjs index ab1bcbbb7..3cbeb18ce 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.shows-title-asterisk.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.shows-title-asterisk.1.export.mjs @@ -278,7 +278,7 @@ const spec_tvEpisodes = { extensions: { tags: { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] } } }, @@ -327,7 +327,7 @@ const spec_tvShows = { extensions: { tags: { omit: "*", - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] } } }, @@ -511,7 +511,7 @@ const spec_person = { extensions: { tags: { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] } } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.title-order.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.title-order.1.export.mjs index 66d266b72..75123b5a2 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.title-order.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.title-order.1.export.mjs @@ -508,7 +508,7 @@ const spec_person = { extensions: { tags: { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] } } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.update-title.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.update-title.1.export.mjs index df33b2099..60b6130df 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.update-title.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.update-title.1.export.mjs @@ -508,7 +508,7 @@ const spec_person = { extensions: { tags: { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] } } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.1.export.mjs index 0c6516488..fd8311f6e 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.1.export.mjs @@ -508,7 +508,7 @@ const spec_person = { extensions: { tags: { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] } } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.constraints.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.constraints.1.export.mjs index 80fa57ce3..78a05ad25 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.constraints.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.constraints.1.export.mjs @@ -508,7 +508,7 @@ const spec_person = { extensions: { tags: { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] } } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-asterisk.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-asterisk.1.export.mjs index 176983f0a..66ea9e529 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-asterisk.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-asterisk.1.export.mjs @@ -170,7 +170,7 @@ const spec_films = { }, tags: Object.assign(Object.create(null), { omit: "*", - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor @@ -348,7 +348,7 @@ const spec_tvShows = { }, tags: Object.assign(Object.create(null), { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor @@ -511,7 +511,7 @@ const spec_person = { extensions: { tags: { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] } } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-create.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-create.1.export.mjs index f40afd84e..e55b501c6 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-create.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-create.1.export.mjs @@ -508,7 +508,7 @@ const spec_person = { extensions: { tags: { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] } } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-delete.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-delete.1.export.mjs index 642bdf57d..52a43c074 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-delete.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-delete.1.export.mjs @@ -508,7 +508,7 @@ const spec_person = { extensions: { tags: { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] } } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-loads.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-loads.1.export.mjs index 505dd0a39..ad10e0364 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-loads.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-loads.1.export.mjs @@ -170,7 +170,7 @@ const spec_films = { }, tags: Object.assign(Object.create(null), { omit: "read,all,update,create,delete,many", - behavior: ["-select -node -query:resource:list -query:resource:connection -update -insert -delete -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection"] + behavior: ["-select -node -connection -list -array -single -query:resource:list -query:resource:connection -update -insert -delete -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection"] }) }, executor: executor @@ -508,7 +508,7 @@ const spec_person = { extensions: { tags: { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] } } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-update.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-update.1.export.mjs index b5f871744..9ad85be6f 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-update.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-update.1.export.mjs @@ -508,7 +508,7 @@ const spec_person = { extensions: { tags: { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] } } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.shows-order.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.shows-order.1.export.mjs index 3bb3cecf2..cd3ffdbe2 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.shows-order.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.shows-order.1.export.mjs @@ -508,7 +508,7 @@ const spec_person = { extensions: { tags: { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] } } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/polymorphic.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/polymorphic.1.export.mjs index 74cd99272..dcb3afd98 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/polymorphic.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/polymorphic.1.export.mjs @@ -64,7 +64,7 @@ const spec_awsApplicationFirstPartyVulnerabilities = { }, tags: Object.assign(Object.create(null), { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor @@ -104,7 +104,7 @@ const spec_awsApplicationThirdPartyVulnerabilities = { }, tags: Object.assign(Object.create(null), { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor @@ -144,7 +144,7 @@ const spec_gcpApplicationFirstPartyVulnerabilities = { }, tags: Object.assign(Object.create(null), { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor @@ -184,7 +184,7 @@ const spec_gcpApplicationThirdPartyVulnerabilities = { }, tags: Object.assign(Object.create(null), { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor diff --git a/postgraphile/postgraphile/__tests__/schema/v4/refs.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/refs.1.export.mjs index 04b783bd2..28d8421d5 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/refs.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/refs.1.export.mjs @@ -134,7 +134,7 @@ const spec_posts = { extensions: { tags: { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] } } } @@ -259,7 +259,7 @@ const registry = makeRegistry({ extensions: { tags: { omit: true, - behavior: ["-select", "-*"] + behavior: ["-select", "-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] } } } @@ -277,7 +277,7 @@ const registry = makeRegistry({ extensions: { tags: { omit: true, - behavior: ["-select", "-*"] + behavior: ["-select", "-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] } } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/relay.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/relay.1.export.mjs index cc558be42..15f1d27c1 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/relay.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/relay.1.export.mjs @@ -505,7 +505,7 @@ const spec_person = { extensions: { tags: { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] } } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.polymorphic.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.polymorphic.1.export.mjs index cdf9417dd..0b65a26c9 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.polymorphic.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.polymorphic.1.export.mjs @@ -47,7 +47,7 @@ const spec_awsApplicationFirstPartyVulnerabilities = { }, tags: Object.assign(Object.create(null), { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor @@ -87,7 +87,7 @@ const spec_awsApplicationThirdPartyVulnerabilities = { }, tags: Object.assign(Object.create(null), { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor @@ -127,7 +127,7 @@ const spec_gcpApplicationFirstPartyVulnerabilities = { }, tags: Object.assign(Object.create(null), { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor @@ -167,7 +167,7 @@ const spec_gcpApplicationThirdPartyVulnerabilities = { }, tags: Object.assign(Object.create(null), { omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor diff --git a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.1.export.mjs index 06545ac1b..ff7a3dbf5 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.1.export.mjs @@ -101,7 +101,7 @@ const spec_post_table = { tags: Object.assign(Object.create(null), { name: "post_table", omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor @@ -173,7 +173,7 @@ const spec_offer_table = { tags: Object.assign(Object.create(null), { name: "offer_table", omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor diff --git a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post.1.export.mjs index db9a7f383..ca0246c46 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post.1.export.mjs @@ -101,7 +101,7 @@ const spec_post_table = { tags: Object.assign(Object.create(null), { name: "post_table", omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor @@ -173,7 +173,7 @@ const spec_offer_table = { tags: Object.assign(Object.create(null), { name: "offer_table", omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor diff --git a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post_view.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post_view.1.export.mjs index f596d51ed..410fcbfb7 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post_view.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post_view.1.export.mjs @@ -101,7 +101,7 @@ const spec_post_table = { tags: Object.assign(Object.create(null), { name: "post_table", omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor @@ -173,7 +173,7 @@ const spec_offer_table = { tags: Object.assign(Object.create(null), { name: "offer_table", omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor diff --git a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post_view_no_pk.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post_view_no_pk.1.export.mjs index 285f7ef22..4aa5199ac 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post_view_no_pk.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post_view_no_pk.1.export.mjs @@ -101,7 +101,7 @@ const spec_post_table = { tags: Object.assign(Object.create(null), { name: "post_table", omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor @@ -174,7 +174,7 @@ const spec_offer_table = { tags: Object.assign(Object.create(null), { name: "offer_table", omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor diff --git a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.view_fake_unique.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.view_fake_unique.1.export.mjs index 4b11739f9..da6b14fb9 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.view_fake_unique.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.view_fake_unique.1.export.mjs @@ -101,7 +101,7 @@ const spec_post_table = { tags: Object.assign(Object.create(null), { name: "post_table", omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor @@ -173,7 +173,7 @@ const spec_offer_table = { tags: Object.assign(Object.create(null), { name: "offer_table", omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor diff --git a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.view_fake_unique_pk.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.view_fake_unique_pk.1.export.mjs index c1b32160a..b2db96258 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.view_fake_unique_pk.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.view_fake_unique_pk.1.export.mjs @@ -101,7 +101,7 @@ const spec_post_table = { tags: Object.assign(Object.create(null), { name: "post_table", omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor @@ -173,7 +173,7 @@ const spec_offer_table = { tags: Object.assign(Object.create(null), { name: "offer_table", omit: true, - behavior: ["-*"] + behavior: ["-insert -select -node -connection -list -array -single -update -delete -queryField -mutationField -typeField -filter -filterBy -order -orderBy -query:resource:list -query:resource:connection -singularRelation:resource:list -singularRelation:resource:connection -manyRelation:resource:list -manyRelation:resource:connection -manyToMany"] }) }, executor: executor From bb006ec7bdab24192c84f093ce3f92969aeb7279 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Fri, 27 Sep 2024 17:04:42 +0100 Subject: [PATCH 09/10] docs(changeset): Fix behavior inheritance especially around functions incorrectly inheriting from their underlying codecs, bugs in unlogged/temp table behavior, and incorrect skipping of generating table types. You may find after this change you have fields appearing in your schema that were not present before, typically these will represent database functions where you `@omit`'d the underlying table - omitting the table should not prevent a function from accessing it. Further, fix behavior of `@omit read` emulation to add `-connection -list -array -single`. --- .changeset/chilly-cups-exercise.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .changeset/chilly-cups-exercise.md diff --git a/.changeset/chilly-cups-exercise.md b/.changeset/chilly-cups-exercise.md new file mode 100644 index 000000000..706734021 --- /dev/null +++ b/.changeset/chilly-cups-exercise.md @@ -0,0 +1,12 @@ +--- +"graphile-build-pg": patch +"postgraphile": patch +--- + +Fix behavior inheritance especially around functions incorrectly inheriting from +their underlying codecs, bugs in unlogged/temp table behavior, and incorrect +skipping of generating table types. You may find after this change you have +fields appearing in your schema that were not present before, typically these +will represent database functions where you `@omit`'d the underlying table - +omitting the table should not prevent a function from accessing it. Further, fix +behavior of `@omit read` emulation to add `-connection -list -array -single`. From e86e5a78e6c80b2b4be1f03d6afe6fae162ef84b Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Fri, 27 Sep 2024 17:05:47 +0100 Subject: [PATCH 10/10] Lint --- graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts index 2cd31c6c9..67cc4541f 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts @@ -643,7 +643,7 @@ export const PgTablesPlugin: GraphileConfig.Plugin = { inferred: { provides: ["default"], before: ["inferred", "override"], - callback(behavior, [resource, unique]) { + callback(behavior, [resource, _unique]) { return unloggedOrTempBehaviors( resource.extensions, behavior,