From 9893ec30204d06331b26ba62205ebb32b7015628 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Sat, 17 Aug 2024 12:43:05 +0100 Subject: [PATCH 01/50] graphile-config now supports lists of hook objects, to allow hooking multiple times with different priorities --- utils/graphile-config/src/functionality.ts | 81 +++++++++++++--------- utils/graphile-config/src/hooks.ts | 2 +- utils/graphile-config/src/interfaces.ts | 14 +++- 3 files changed, 61 insertions(+), 36 deletions(-) diff --git a/utils/graphile-config/src/functionality.ts b/utils/graphile-config/src/functionality.ts index e140bd03a2..a50b8271f8 100644 --- a/utils/graphile-config/src/functionality.ts +++ b/utils/graphile-config/src/functionality.ts @@ -7,6 +7,21 @@ import type { } from "./interfaces.js"; import { sortWithBeforeAfterProvides } from "./sort.js"; +// TypeScript nonsense +const isCallbackDescriptor = ( + v: CallbackOrDescriptor, +): v is CallbackDescriptor => typeof v !== "function"; +const isCallback = ( + v: CallbackOrDescriptor, +): v is T => typeof v === "function"; +function isArray( + arg: + | CallbackOrDescriptor + | readonly CallbackDescriptor[], +): arg is readonly CallbackDescriptor[] { + return Array.isArray(arg); +} + export function orderedApply< TFunctionality extends FunctionalityObject, >( @@ -20,6 +35,10 @@ export function orderedApply< infer U > ? U + : TFunctionality[TFunctionalityName] extends ReadonlyArray< + CallbackDescriptor + > + ? U : never, plugin: GraphileConfig.Plugin, ) => void, @@ -45,42 +64,40 @@ export function orderedApply< } const keys = Object.keys(hooks) as unknown as Array; for (const key of keys) { - const hookSpecRaw: TFunctionality[typeof key] | undefined = hooks[key]; - if (!hookSpecRaw) { + const value: + | CallbackOrDescriptor + | readonly CallbackDescriptor[] + | undefined = hooks[key]; + if (!value) { continue; } - // TypeScript nonsense - const isCallbackDescriptor = ( - v: CallbackOrDescriptor, - ): v is CallbackDescriptor => typeof v !== "function"; - const isCallback = ( - v: CallbackOrDescriptor, - ): v is T => typeof v === "function"; - - const callback: TFunctionality[typeof key] extends CallbackOrDescriptor< - infer U - > - ? U - : never = ( - isCallback(hookSpecRaw) ? hookSpecRaw : hookSpecRaw.callback - ) as any; - const { provides, before, after } = isCallbackDescriptor(hookSpecRaw) - ? hookSpecRaw - : ({} as { provides?: never[]; before?: never[]; after?: never }); - if (!allFunctionalities[key]) { - allFunctionalities[key] = []; + const hookList = isArray(value) ? value : [value]; + for (const hookSpecRaw of hookList) { + const callback: TFunctionality[typeof key] extends CallbackOrDescriptor< + infer U + > + ? U + : never = ( + isCallback(hookSpecRaw) ? hookSpecRaw : hookSpecRaw.callback + ) as any; + const { provides, before, after } = isCallbackDescriptor(hookSpecRaw) + ? hookSpecRaw + : ({} as { provides?: never[]; before?: never[]; after?: never }); + if (!allFunctionalities[key]) { + allFunctionalities[key] = []; + } + // We need to give each functionality a unique ID + const id = String(uid++); + allFunctionalities[key]!.push({ + id, + plugin, + callback, + provides: [...(provides || []), id, plugin.name], + before: before || [], + after: after || [], + }); } - // We need to give each functionality a unique ID - const id = String(uid++); - allFunctionalities[key]!.push({ - id, - plugin, - callback, - provides: [...(provides || []), id, plugin.name], - before: before || [], - after: after || [], - }); } } } diff --git a/utils/graphile-config/src/hooks.ts b/utils/graphile-config/src/hooks.ts index ba6456ee9d..c78e5b971e 100644 --- a/utils/graphile-config/src/hooks.ts +++ b/utils/graphile-config/src/hooks.ts @@ -74,7 +74,7 @@ export type PluginHookObject any> = /** @deprecated Use CallbackOrDescriptor */ export type PluginHook< T extends (...args: any[]) => PromiseOrDirect | void>, -> = CallbackOrDescriptor; +> = CallbackOrDescriptor | readonly CallbackDescriptor[]; /** @deprecated Use UnwrapCallback */ export type PluginHookCallback< T extends CallbackOrDescriptor<(...args: any[]) => any>, diff --git a/utils/graphile-config/src/interfaces.ts b/utils/graphile-config/src/interfaces.ts index a2de0d14f5..311c9b1a60 100644 --- a/utils/graphile-config/src/interfaces.ts +++ b/utils/graphile-config/src/interfaces.ts @@ -13,10 +13,18 @@ export type CallbackOrDescriptor = | T | CallbackDescriptor; -export type UnwrapCallback> = - T extends CallbackOrDescriptor ? U : never; +export type UnwrapCallback< + T extends + | CallbackOrDescriptor + | ReadonlyArray>, +> = T extends CallbackOrDescriptor + ? U + : T extends ReadonlyArray> + ? U + : never; export type FunctionalityObject = Record< keyof T, - CallbackOrDescriptor + | CallbackOrDescriptor + | ReadonlyArray> >; From 9cd9bb5222a9f0398ee4b8bfa4f741b6de2a2192 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Sat, 17 Aug 2024 12:43:39 +0100 Subject: [PATCH 02/50] docs(changeset): Add support for lists of hook objects, so that the same hook can be applied multiple times in the same plugin but with different priorities. --- .changeset/wise-chefs-dance.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/wise-chefs-dance.md diff --git a/.changeset/wise-chefs-dance.md b/.changeset/wise-chefs-dance.md new file mode 100644 index 0000000000..f3a587039f --- /dev/null +++ b/.changeset/wise-chefs-dance.md @@ -0,0 +1,6 @@ +--- +"graphile-config": patch +--- + +Add support for lists of hook objects, so that the same hook can be applied +multiple times in the same plugin but with different priorities. From 8a264e958121a3b7a9985672671dbbb567844243 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Sat, 17 Aug 2024 15:12:18 +0100 Subject: [PATCH 03/50] Type-safety around behaviors --- .../graphile-build-pg/src/behavior.ts | 14 +++-- .../src/plugins/PgAttributesPlugin.ts | 30 ++++++++++- .../src/plugins/PgBasicsPlugin.ts | 28 ++++++++++ .../src/plugins/PgConditionArgumentPlugin.ts | 13 ++++- .../plugins/PgConditionCustomFieldsPlugin.ts | 8 +++ .../plugins/PgConnectionTotalCountPlugin.ts | 9 ++++ .../src/plugins/PgCustomTypeFieldPlugin.ts | 20 +++++-- .../PgInterfaceModeUnionAllRowsPlugin.ts | 2 +- .../src/plugins/PgMutationCreatePlugin.ts | 18 ++++++- .../plugins/PgMutationUpdateDeletePlugin.ts | 27 ++++++++-- .../src/plugins/PgNodeIdAttributesPlugin.ts | 25 ++++++++- .../src/plugins/PgPolymorphismPlugin.ts | 21 +++++--- .../src/plugins/PgProceduresPlugin.ts | 9 ++++ .../src/plugins/PgRelationsPlugin.ts | 26 ++++++++-- .../src/plugins/PgTablesPlugin.ts | 52 ++++++++++++++++--- graphile-build/graphile-build/src/behavior.ts | 12 +++-- graphile-build/graphile-build/src/global.ts | 8 +++ graphile-build/graphile-build/src/index.ts | 23 ++++++-- .../AddNodeInterfaceToSuitableTypesPlugin.ts | 3 +- .../src/plugins/CommonBehaviorsPlugin.ts | 50 ++++++++++++++++++ .../graphile-build/src/plugins/index.ts | 2 + graphile-build/graphile-build/src/preset.ts | 2 + .../postgraphile/src/presets/relay.ts | 2 +- postgraphile/postgraphile/src/presets/v4.ts | 2 +- 24 files changed, 358 insertions(+), 48 deletions(-) create mode 100644 graphile-build/graphile-build/src/plugins/CommonBehaviorsPlugin.ts diff --git a/graphile-build/graphile-build-pg/src/behavior.ts b/graphile-build/graphile-build-pg/src/behavior.ts index 4e18d0cfe4..9686113173 100644 --- a/graphile-build/graphile-build-pg/src/behavior.ts +++ b/graphile-build/graphile-build-pg/src/behavior.ts @@ -26,9 +26,9 @@ export function getBehavior( > | undefined >, -): string { +): GraphileBuild.BehaviorString { const allExtensions = Array.isArray(extensions) ? extensions : [extensions]; - const behaviors: string[] = []; + const behaviors: GraphileBuild.BehaviorString[] = []; for (const extensions of allExtensions) { // LOGGING: all of these are just for user convenience, users should be guided not to use them. add(extensions?.tags?.behaviours); @@ -38,7 +38,7 @@ export function getBehavior( // This is the real one add(extensions?.tags?.behavior); } - return behaviors.join(" "); + return behaviors.join(" ") as GraphileBuild.BehaviorString; function add( rawBehavior: (string | true)[] | string | true | null | undefined, @@ -56,7 +56,9 @@ export function getBehavior( )}`, ); } - behaviors.push(behavior.join(" ")); + for (const b of behavior) { + behaviors.push(b as GraphileBuild.BehaviorString); + } return; } if (isValidBehavior(behavior)) { @@ -79,7 +81,9 @@ export function getBehavior( * * @internal */ -function isValidBehavior(behavior: unknown): behavior is string { +function isValidBehavior( + behavior: unknown, +): behavior is GraphileBuild.BehaviorString { return ( typeof behavior === "string" && /^[+-]?([a-zA-Z](?:[_:]?[a-zA-Z0-9])+|\*)(?:\s+[+-]?(?:[a-zA-Z]([_:]?[a-zA-Z0-9])+|\*))*$/.test( diff --git a/graphile-build/graphile-build-pg/src/plugins/PgAttributesPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgAttributesPlugin.ts index 8423659bba..52fd49f6f4 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgAttributesPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgAttributesPlugin.ts @@ -28,6 +28,15 @@ declare global { } namespace GraphileBuild { + interface BehaviorStrings { + "-condition:attribute:filterBy": true; + "-attribute:select": true; + "-attribute:base": true; + "-attribute:insert": true; + "-attribute:update": true; + "-attribute:filterBy": true; + "-attribute:orderBy": true; + } interface Build { pgResolveOutputType( codec: PgCodec, @@ -288,13 +297,30 @@ export const PgAttributesPlugin: GraphileConfig.Plugin = { }, schema: { + behaviorRegistry: { + add: { + "-condition:attribute:filterBy": {}, + "-attribute:select": {}, + "-attribute:base": {}, + "-attribute:insert": {}, + "-attribute:update": {}, + "-attribute:filterBy": {}, + "-attribute:orderBy": {}, + }, + }, + entityBehavior: { pgCodecAttribute: { provides: ["default"], before: ["inferred", "override"], callback(behavior, [codec, attributeName]) { - const behaviors = new Set([ - "select base update insert filterBy orderBy", + const behaviors = new Set([ + "select", + "base", + "update", + "insert", + "filterBy", + "orderBy", ]); const attribute = codec.attributes[attributeName]; function walk(codec: PgCodec) { diff --git a/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts index 5f866cdf39..7b40bc575b 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts @@ -32,6 +32,17 @@ declare global { "graphile-build-pg": string; "@dataplan/pg": string; } + interface BehaviorStrings { + select: true; + insert: true; + update: true; + delete: true; + base: true; + filter: true; + filterBy: true; + order: true; + orderBy: true; + } type HasGraphQLTypeForPgCodec = ( codec: PgCodec, situation?: string, @@ -177,6 +188,23 @@ export const PgBasicsPlugin: GraphileConfig.Plugin = { schema: { globalBehavior: "connection -list", + behaviorRegistry: { + add: { + select: { + description: + "can select this resource/column/etc. Note this does not necessarily mean you can do select * from users but it might mean that it's possible to see details about a users when it's returned by a function or similar. (In this case the codec has select but the resource has -select.)", + entities: ["pgCodec", "pgResource"], + }, + insert: { description: "", entities: [] }, + update: { description: "", entities: [] }, + delete: { description: "", entities: [] }, + base: { description: "", entities: [] }, + filter: { description: "", entities: [] }, + filterBy: { description: "", entities: [] }, + order: { description: "", entities: [] }, + orderBy: { description: "", entities: [] }, + }, + }, entityBehavior: { pgCodec: { after: ["default", "inferred"], diff --git a/graphile-build/graphile-build-pg/src/plugins/PgConditionArgumentPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgConditionArgumentPlugin.ts index eed2a89c0f..3f5f2202ec 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgConditionArgumentPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgConditionArgumentPlugin.ts @@ -20,6 +20,9 @@ declare global { } namespace GraphileBuild { + interface BehaviorStrings { + filter: true; + } interface Inflection { conditionType(this: Inflection, typeName: string): string; } @@ -46,13 +49,19 @@ export const PgConditionArgumentPlugin: GraphileConfig.Plugin = { }, schema: { + behaviorRegistry: { + add: { + filter: {}, + }, + }, + entityBehavior: { - pgCodec: "select filter", + pgCodec: ["select", "filter"], pgResource: { provides: ["default"], before: ["inferred", "override"], callback(behavior, resource) { - return [resource.parameters ? "" : "filter", behavior]; + return resource.parameters ? [behavior] : ["filter", behavior]; }, }, }, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgConditionCustomFieldsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgConditionCustomFieldsPlugin.ts index c7a403d864..508760c589 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgConditionCustomFieldsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgConditionCustomFieldsPlugin.ts @@ -18,6 +18,9 @@ declare global { } namespace GraphileBuild { + interface BehaviorStrings { + "proc:filterBy": true; + } interface ScopeInputObjectFieldsField { isPgConnectionConditionInputField?: boolean; pgFieldSource?: PgResource; @@ -51,6 +54,11 @@ export const PgConditionCustomFieldsPlugin: GraphileConfig.Plugin = { after: ["PgAttributesPlugin"], schema: { + behaviorRegistry: { + add: { + "proc:filterBy": {}, + }, + }, entityBehavior: { pgResource: { provides: ["inferred"], diff --git a/graphile-build/graphile-build-pg/src/plugins/PgConnectionTotalCountPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgConnectionTotalCountPlugin.ts index 7ab327c735..e226355b82 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgConnectionTotalCountPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgConnectionTotalCountPlugin.ts @@ -22,6 +22,9 @@ declare global { } namespace GraphileBuild { + interface BehaviorStrings { + totalCount: true; + } interface ScopeObjectFieldsField { /** * 'true' if this field is the 'totalCount' field on a connection as @@ -37,6 +40,12 @@ export const PgConnectionTotalCountPlugin: GraphileConfig.Plugin = { description: "Add 'totalCount' field to connections", version, schema: { + behaviorRegistry: { + add: { + totalCount: {}, + }, + }, + entityBehavior: { pgCodec: "totalCount", }, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts index 9169e356d6..2b02491e8f 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts @@ -61,6 +61,11 @@ declare global { } namespace GraphileBuild { + interface BehaviorStrings { + queryField: true; + mutationField: true; + typeField: true; + } interface Build { pgGetArgDetailsFromParameters( resource: PgResource, @@ -189,8 +194,8 @@ function shouldUseCustomConnection( function defaultProcSourceBehavior( s: PgResource, -): string { - const behavior = []; +): GraphileBuild.BehaviorString { + const behavior: GraphileBuild.BehaviorString[] = []; const firstParameter = ( s as PgResource ).parameters[0]; @@ -228,11 +233,11 @@ function defaultProcSourceBehavior( const canUseConnection = !s.sqlPartitionByIndex && !s.isList && !s.codec.arrayOfCodec; if (!canUseConnection) { - behavior.push("-connection +list"); + behavior.push("-connection", "list"); } } - return behavior.join(" "); + return behavior.join(" ") as GraphileBuild.BehaviorString; } function hasRecord( @@ -338,6 +343,13 @@ export const PgCustomTypeFieldPlugin: GraphileConfig.Plugin = { }, schema: { + behaviorRegistry: { + add: { + queryField: {}, + mutationField: {}, + typeField: {}, + }, + }, entityBehavior: { pgResource: { provides: ["inferred"], diff --git a/graphile-build/graphile-build-pg/src/plugins/PgInterfaceModeUnionAllRowsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgInterfaceModeUnionAllRowsPlugin.ts index 1bdafc41d3..67799750d8 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgInterfaceModeUnionAllRowsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgInterfaceModeUnionAllRowsPlugin.ts @@ -73,7 +73,7 @@ export const PgInterfaceModeUnionAllRowsPlugin: GraphileConfig.Plugin = { before: ["inferred", "override"], callback(behavior, entity) { if (entity.polymorphism?.mode === "union") { - return ["connection -list", behavior]; + return ["connection", "-list", behavior]; } else { return behavior; } diff --git a/graphile-build/graphile-build-pg/src/plugins/PgMutationCreatePlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgMutationCreatePlugin.ts index 2f533189ee..96c29bbbea 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgMutationCreatePlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgMutationCreatePlugin.ts @@ -18,6 +18,10 @@ declare global { } namespace GraphileBuild { + interface BehaviorStrings { + "insert:resource:select": true; + record: true; + } interface ScopeObject { isPgCreatePayloadType?: boolean; } @@ -77,12 +81,24 @@ export const PgMutationCreatePlugin: GraphileConfig.Plugin = { }, schema: { + behaviorRegistry: { + add: { + "insert:resource:select": {}, + record: { + description: "record type used for insert", + }, + }, + }, + entityBehavior: { pgResource: { provides: ["default"], before: ["inferred", "override"], callback(behavior, resource) { - const newBehavior = [behavior, "+insert:resource:select"]; + const newBehavior: GraphileBuild.BehaviorString[] = [ + behavior, + "insert:resource:select", + ]; if ( !resource.parameters && !!resource.codec.attributes && diff --git a/graphile-build/graphile-build-pg/src/plugins/PgMutationUpdateDeletePlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgMutationUpdateDeletePlugin.ts index a8724fc167..9050f78ef2 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgMutationUpdateDeletePlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgMutationUpdateDeletePlugin.ts @@ -34,6 +34,13 @@ declare global { } namespace GraphileBuild { + interface BehaviorStrings { + "constraint:resource:update": true; + "constraint:resource:delete": true; + "update:resource:select": true; + "delete:resource:nodeId": true; + "delete:resource:select": true; + } interface ScopeObject { isPgUpdatePayloadType?: boolean; isPgDeletePayloadType?: boolean; @@ -239,10 +246,24 @@ export const PgMutationUpdateDeletePlugin: GraphileConfig.Plugin = { }, schema: { + behaviorRegistry: { + add: { + "constraint:resource:update": {}, + "constraint:resource:delete": {}, + "update:resource:select": {}, + "delete:resource:nodeId": {}, + "delete:resource:select": {}, + }, + }, entityBehavior: { - pgResource: - "update delete update:resource:select delete:resource:nodeId -delete:resource:select", - pgResourceUnique: "update delete", + pgResource: [ + "update", + "delete", + "update:resource:select", + "delete:resource:nodeId", + "-delete:resource:select", + ], + pgResourceUnique: ["update", "delete"], }, hooks: { diff --git a/graphile-build/graphile-build-pg/src/plugins/PgNodeIdAttributesPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgNodeIdAttributesPlugin.ts index 0ec6c143d3..df7b6c0745 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgNodeIdAttributesPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgNodeIdAttributesPlugin.ts @@ -22,6 +22,13 @@ declare global { } namespace GraphileBuild { + interface BehaviorStrings { + "nodeId:insert": true; + "nodeId:update": true; + "nodeId:delete": true; + "nodeId:base": true; + "nodeId:filterBy": true; + } interface Inflection { /** * The name of the attribute used as an `ID` input representing a related @@ -55,10 +62,24 @@ export const PgNodeIdAttributesPlugin: GraphileConfig.Plugin = { }, schema: { + behaviorRegistry: { + add: { + "nodeId:insert": {}, + "nodeId:update": {}, + "nodeId:delete": {}, + "nodeId:base": {}, + "nodeId:filterBy": {}, + }, + }, + entityBehavior: { // By default, column attributes will be present, so we don't want this to also be set - pgCodecRelation: - "-nodeId:insert -nodeId:update -nodeId:base -nodeId:filterBy", + pgCodecRelation: [ + "-nodeId:insert", + "-nodeId:update", + "-nodeId:base", + "-nodeId:filterBy", + ], }, hooks: { GraphQLInputObjectType_fields(fields, build, context) { diff --git a/graphile-build/graphile-build-pg/src/plugins/PgPolymorphismPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgPolymorphismPlugin.ts index bee1a09531..0d5f162c74 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgPolymorphismPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgPolymorphismPlugin.ts @@ -663,7 +663,9 @@ export const PgPolymorphismPlugin: GraphileConfig.Plugin = { return [ "select", "table", - ...(!codec.isAnonymous ? ["insert", "update"] : []), + ...((!codec.isAnonymous + ? ["insert", "update"] + : []) as GraphileBuild.BehaviorString[]), behavior, ]; }, @@ -698,7 +700,7 @@ export const PgPolymorphismPlugin: GraphileConfig.Plugin = { if ( arraysMatch(relation.remoteAttributes, entity.localAttributes) ) { - return [behavior, "-connection -list -single"]; + return [behavior, "-connection", "-list", "-single"]; } } } @@ -709,7 +711,7 @@ export const PgPolymorphismPlugin: GraphileConfig.Plugin = { (t) => pgRelations[localCodec.name]?.[t.relationName], ); if (relations.includes(entity)) { - return [behavior, "-connection -list -single"]; + return [behavior, "-connection", "-list", "-single"]; } } @@ -742,7 +744,10 @@ export const PgPolymorphismPlugin: GraphileConfig.Plugin = { ) { return [ behavior, - "-attribute:select -attribute:update -attribute:filterBy -attribute:orderBy", + "-attribute:select", + "-attribute:update", + "-attribute:filterBy", + "-attribute:orderBy", ]; } } @@ -767,7 +772,9 @@ export const PgPolymorphismPlugin: GraphileConfig.Plugin = { if ((resource.codec as PgCodec).polymorphism) { // This is a polymorphic type newBehavior.push( - "-resource:insert -resource:update -resource:delete", + "-resource:insert", + "-resource:update", + "-resource:delete", ); } else { const resourceTypeName = build.inflection.tableType( @@ -795,7 +802,9 @@ export const PgPolymorphismPlugin: GraphileConfig.Plugin = { ) { // This is part of a relational polymorphic type newBehavior.push( - "-resource:insert -resource:update -resource:delete", + "-resource:insert", + "-resource:update", + "-resource:delete", ); } } diff --git a/graphile-build/graphile-build-pg/src/plugins/PgProceduresPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgProceduresPlugin.ts index 4c09d3ccc7..31082db75e 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgProceduresPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgProceduresPlugin.ts @@ -26,6 +26,9 @@ import { version } from "../version.js"; declare global { namespace GraphileBuild { + interface BehaviorStrings { + "resource:connection:backwards": true; + } interface Inflection { functionResourceName( this: Inflection, @@ -674,6 +677,12 @@ export const PgProceduresPlugin: GraphileConfig.Plugin = { }, }), schema: { + behaviorRegistry: { + add: { + "resource:connection:backwards": {}, + }, + }, + entityBehavior: { pgResource: { provides: ["default"], diff --git a/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts index 901c97e085..c10332fa84 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts @@ -34,6 +34,10 @@ const ref_sql = te.ref(sql, "sql"); declare global { namespace GraphileBuild { + interface BehaviorStrings { + "singularRelation:resource:list": true; + "singularRelation:resource:connection": true; + } interface SchemaOptions { pgMutationPayloadRelations?: boolean; } @@ -503,19 +507,27 @@ export const PgRelationsPlugin: GraphileConfig.Plugin = { }), schema: { + behaviorRegistry: { + add: { + "singularRelation:resource:list": {}, + "singularRelation:resource:connection": {}, + }, + }, entityBehavior: { pgCodecRelation: { provides: ["inferred"], before: ["override"], after: ["default"], - callback(behavior, entity) { + callback(behavior, entity): GraphileBuild.BehaviorString[] { if (entity.isUnique) { return [ behavior, - "single -singularRelation:resource:list -singularRelation:resource:connection", + "single", + "-singularRelation:resource:list", + "-singularRelation:resource:connection", ]; } else { - return behavior; + return [behavior]; } }, }, @@ -528,7 +540,9 @@ export const PgRelationsPlugin: GraphileConfig.Plugin = { if (ref?.definition.singular) { return [ behavior, - "single -singularRelation:resource:list -singularRelation:resource:connection", + "single", + "-singularRelation:resource:list", + "-singularRelation:resource:connection", ]; } else { return behavior; @@ -543,7 +557,9 @@ export const PgRelationsPlugin: GraphileConfig.Plugin = { if (entity.singular) { return [ behavior, - "single -singularRelation:resource:list -singularRelation:resource:connection", + "single", + "-singularRelation:resource:list", + "-singularRelation:resource:connection", ]; } else { return behavior; diff --git a/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts index 6283ea1782..f14a981d54 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts @@ -20,6 +20,13 @@ import { version } from "../version.js"; declare global { namespace GraphileBuild { + interface BehaviorStrings { + table: true; + "resource:select": true; + "resource:insert": true; + "resource:update": true; + "resource:delete": true; + } interface SchemaOptions { /** * If true, setof functions cannot return null, so our list and @@ -569,6 +576,30 @@ export const PgTablesPlugin: GraphileConfig.Plugin = { }), schema: { + behaviorRegistry: { + add: { + "resource:select": { + description: "can select rows from this resource", + entities: ["pgCodec", "pgResource"], + }, + "resource:insert": { + description: "can insert into this resource", + entities: ["pgCodec", "pgResource"], + }, + "resource:update": { + description: "can update a record in this resource", + entities: ["pgCodec", "pgResource"], + }, + "resource:delete": { + description: "can delete a record in this resource", + entities: ["pgCodec", "pgResource"], + }, + table: { + description: "is this codec table-like?", + entities: ["pgCodec"], + }, + }, + }, entityBehavior: { pgCodec: { provides: ["default"], @@ -581,15 +612,18 @@ export const PgTablesPlugin: GraphileConfig.Plugin = { return [ "resource:select", "table", - ...(!codec.isAnonymous + ...((!codec.isAnonymous ? ["resource:insert", "resource:update", "resource:delete"] - : []), + : []) as GraphileBuild.BehaviorString[]), behavior, - ...(isUnloggedOrTemp + ...((isUnloggedOrTemp ? [ - "-resource:select -resource:insert -resource:update -resource:delete", + "-resource:select", + "-resource:insert", + "-resource:update", + "-resource:delete", ] - : []), + : []) as GraphileBuild.BehaviorString[]), ]; } else { return [behavior]; @@ -605,13 +639,15 @@ export const PgTablesPlugin: GraphileConfig.Plugin = { resource.extensions?.pg?.persistence === "u" || resource.extensions?.pg?.persistence === "t"; return [ - ...(!isFunction && !isUnloggedOrTemp ? ["resource:select"] : []), + ...((!isFunction && !isUnloggedOrTemp + ? ["resource:select"] + : []) as GraphileBuild.BehaviorString[]), behavior, - ...(isUnloggedOrTemp + ...((isUnloggedOrTemp ? [ "-resource:select -resource:insert -resource:update -resource:delete", ] - : []), + : []) as GraphileBuild.BehaviorString[]), ]; }, }, diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index 9ab88847d2..c31f96c0b7 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -19,8 +19,10 @@ const getEntityBehaviorHooks = (plugin: GraphileConfig.Plugin) => { const entries = Object.entries(val); let changed = false; for (const entry of entries) { - const lhs = entry[1]; - if (typeof lhs === "string") { + const lhs = entry[1] as GraphileBuild.BehaviorString; + const isArrayOfStrings = + Array.isArray(lhs) && lhs.every((t) => typeof t === "string"); + if (isArrayOfStrings || typeof lhs === "string") { const hook: Exclude< NonNullable< NonNullable["entityBehavior"] @@ -29,7 +31,9 @@ const getEntityBehaviorHooks = (plugin: GraphileConfig.Plugin) => { > = { provides: ["default"], before: ["inferred", "override"], - callback: (behavior) => [lhs, behavior], + callback: isArrayOfStrings + ? (behavior) => [...lhs, behavior] + : (behavior) => [lhs, behavior], }; entry[1] = hook; changed = true; @@ -57,6 +61,7 @@ export type BehaviorDynamicMethods = { export class Behavior { private behaviorEntities: { [entityType in keyof GraphileBuild.BehaviorEntities]: { + behaviorStrings: Record; behaviorCallbacks: Array< [ source: string, @@ -156,6 +161,7 @@ export class Behavior { } this.behaviorEntityTypes.push(entityType); this.behaviorEntities[entityType] = { + behaviorStrings: Object.create(null), behaviorCallbacks: [], listCache: new Map(), cacheWithDefault: new Map(), diff --git a/graphile-build/graphile-build/src/global.ts b/graphile-build/graphile-build/src/global.ts index b5a8eb61ab..57a23b0bd5 100644 --- a/graphile-build/graphile-build/src/global.ts +++ b/graphile-build/graphile-build/src/global.ts @@ -95,6 +95,10 @@ interface RegisterObjectType { declare global { namespace GraphileBuild { + type BehaviorString = + | (string & { __incomingBehaviorString: true }) + | `${"" | "-"}${keyof GraphileBuild.BehaviorStrings}`; + /** * Input to the 'schema build' phase, this is typically the output of the * gather phase. @@ -103,6 +107,10 @@ declare global { // Expand this interface with declaration merging } + interface BehaviorStrings { + // Expand me through declaration merging + } + interface BehaviorEntities { string: string; // Expand me through declaration merging diff --git a/graphile-build/graphile-build/src/index.ts b/graphile-build/graphile-build/src/index.ts index 33cb96d492..bbdb36abdf 100644 --- a/graphile-build/graphile-build/src/index.ts +++ b/graphile-build/graphile-build/src/index.ts @@ -16,6 +16,7 @@ import { AddNodeInterfaceToSuitableTypesPlugin, BuiltinScalarConnectionsPlugin, ClientMutationIdDescriptionPlugin, + CommonBehaviorsPlugin, CommonTypesPlugin, CursorTypePlugin, MutationPayloadQueryPlugin, @@ -504,6 +505,7 @@ export { AddNodeInterfaceToSuitableTypesPlugin, BuiltinScalarConnectionsPlugin, ClientMutationIdDescriptionPlugin, + CommonBehaviorsPlugin, CommonTypesPlugin, CursorTypePlugin, MutationPayloadQueryPlugin, @@ -853,6 +855,18 @@ declare global { build: GraphileBuild.Build, ) => string | string[]); + behaviorRegistry?: { + add?: Partial< + Record< + keyof GraphileBuild.BehaviorStrings, + { + description?: string; + entities?: (keyof GraphileBuild.BehaviorEntities)[]; + } + > + >; + }; + /** * You should use `before`, `after` and `provides` to ensure that the entity * behaviors apply in order. The order should be roughly: @@ -863,13 +877,16 @@ declare global { */ entityBehavior?: { [entityType in keyof GraphileBuild.BehaviorEntities]?: - | string + | GraphileBuild.BehaviorString + | GraphileBuild.BehaviorString[] | PluginHook< ( - behavior: string, + behavior: GraphileBuild.BehaviorString, entity: GraphileBuild.BehaviorEntities[entityType], build: GraphileBuild.Build, - ) => string | string[] + ) => + | GraphileBuild.BehaviorString + | GraphileBuild.BehaviorString[] >; }; diff --git a/graphile-build/graphile-build/src/plugins/AddNodeInterfaceToSuitableTypesPlugin.ts b/graphile-build/graphile-build/src/plugins/AddNodeInterfaceToSuitableTypesPlugin.ts index 353ddd5c65..029a601d37 100644 --- a/graphile-build/graphile-build/src/plugins/AddNodeInterfaceToSuitableTypesPlugin.ts +++ b/graphile-build/graphile-build/src/plugins/AddNodeInterfaceToSuitableTypesPlugin.ts @@ -5,6 +5,7 @@ import { lambda } from "grafast"; import type { GraphQLInterfaceType } from "grafast/graphql"; import { EXPORTABLE } from "../utils.js"; +import { version } from "../version.js"; import { NODE_ID_CODECS, NODE_ID_HANDLER_BY_TYPE_NAME } from "./NodePlugin.js"; declare global { @@ -17,7 +18,7 @@ declare global { export const AddNodeInterfaceToSuitableTypesPlugin: GraphileConfig.Plugin = { name: "AddNodeInterfaceToSuitableTypesPlugin", - version: "1.0.0", + version, description: `Adds the 'Node' interface to all types that have registered a Node ID handler`, schema: { diff --git a/graphile-build/graphile-build/src/plugins/CommonBehaviorsPlugin.ts b/graphile-build/graphile-build/src/plugins/CommonBehaviorsPlugin.ts new file mode 100644 index 0000000000..eac4c808b8 --- /dev/null +++ b/graphile-build/graphile-build/src/plugins/CommonBehaviorsPlugin.ts @@ -0,0 +1,50 @@ +import "graphile-config"; + +import { version } from "../version.js"; + +declare global { + namespace GraphileBuild { + interface BehaviorStrings { + connection: true; + list: true; + single: true; + + "interface:node": true; + "type:node": true; + } + } +} + +export const CommonBehaviorsPlugin: GraphileConfig.Plugin = { + name: "CommonBehaviorsPlugin", + version, + + schema: { + behaviorRegistry: { + add: { + connection: { + description: + "represent collection as a connection (GraphQL Cursor Pagination Spec)", + entities: [], + }, + list: { + description: "represent collection as a list (simple collections)", + entities: [], + }, + single: { + description: "fetch a single record", + entities: [], + }, + + "interface:node": { + description: "should this interface implement the Node interface?", + entities: [], + }, + "type:node": { + description: "should this type implement the Node interface?", + entities: [], + }, + }, + }, + }, +}; diff --git a/graphile-build/graphile-build/src/plugins/index.ts b/graphile-build/graphile-build/src/plugins/index.ts index 18ee1eec8b..88d2f00ba8 100644 --- a/graphile-build/graphile-build/src/plugins/index.ts +++ b/graphile-build/graphile-build/src/plugins/index.ts @@ -1,6 +1,7 @@ import { AddNodeInterfaceToSuitableTypesPlugin } from "./AddNodeInterfaceToSuitableTypesPlugin.js"; import { BuiltinScalarConnectionsPlugin } from "./BuiltinScalarConnectionsPlugin.js"; import { ClientMutationIdDescriptionPlugin } from "./ClientMutationIdDescriptionPlugin.js"; +import { CommonBehaviorsPlugin } from "./CommonBehaviorsPlugin.js"; import { CommonTypesPlugin } from "./CommonTypesPlugin.js"; import { ConnectionPlugin } from "./ConnectionPlugin.js"; import { CursorTypePlugin } from "./CursorTypePlugin.js"; @@ -23,6 +24,7 @@ export { AddNodeInterfaceToSuitableTypesPlugin, BuiltinScalarConnectionsPlugin, ClientMutationIdDescriptionPlugin, + CommonBehaviorsPlugin, CommonTypesPlugin, ConnectionPlugin, CursorTypePlugin, diff --git a/graphile-build/graphile-build/src/preset.ts b/graphile-build/graphile-build/src/preset.ts index 2725bf8d94..fb7071f631 100644 --- a/graphile-build/graphile-build/src/preset.ts +++ b/graphile-build/graphile-build/src/preset.ts @@ -5,6 +5,7 @@ import { AddNodeInterfaceToSuitableTypesPlugin, BuiltinScalarConnectionsPlugin, ClientMutationIdDescriptionPlugin, + CommonBehaviorsPlugin, CommonTypesPlugin, ConnectionPlugin, CursorTypePlugin, @@ -29,6 +30,7 @@ export const defaultPreset: GraphileConfig.Preset = { MutationPlugin, SubscriptionPlugin, // StreamDeferPlugin, + CommonBehaviorsPlugin, ClientMutationIdDescriptionPlugin, MutationPayloadQueryPlugin, CursorTypePlugin, diff --git a/postgraphile/postgraphile/src/presets/relay.ts b/postgraphile/postgraphile/src/presets/relay.ts index de4f3d861e..333a9683bf 100644 --- a/postgraphile/postgraphile/src/presets/relay.ts +++ b/postgraphile/postgraphile/src/presets/relay.ts @@ -5,7 +5,7 @@ import type { PgCodecRelation } from "@dataplan/pg"; import { version } from "../version.js"; -const RELAY_HIDDEN_COLUMN_BEHAVIORS = [ +const RELAY_HIDDEN_COLUMN_BEHAVIORS: readonly GraphileBuild.BehaviorString[] = [ "-select", "-update", "-base", diff --git a/postgraphile/postgraphile/src/presets/v4.ts b/postgraphile/postgraphile/src/presets/v4.ts index 05943f059a..fe991c0c68 100644 --- a/postgraphile/postgraphile/src/presets/v4.ts +++ b/postgraphile/postgraphile/src/presets/v4.ts @@ -160,7 +160,7 @@ const makeV4Plugin = (options: V4Options): GraphileConfig.Plugin => { return `${behavior} ${simpleCollectionsBehavior} -singularRelation:resource:connection -singularRelation:resource:list +condition:attribute:filterBy +attribute:orderBy +resource:connection:backwards`; }, entityBehavior: { - pgResource: "+delete:resource:select", + pgResource: "delete:resource:select", pgCodecAttribute(behavior, [codec, attributeName]) { const attribute = codec.attributes[attributeName]; const underlyingCodec = From eca1ad62eba7321f5fb78a346f94512dd7917fca Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Sat, 17 Aug 2024 16:12:13 +0100 Subject: [PATCH 04/50] Add descriptions and entities --- .../src/plugins/PgAttributesPlugin.ts | 36 +++++++++++++++---- .../src/plugins/PgConditionArgumentPlugin.ts | 5 ++- .../plugins/PgConditionCustomFieldsPlugin.ts | 6 +++- .../plugins/PgConnectionTotalCountPlugin.ts | 5 ++- .../src/plugins/PgCustomTypeFieldPlugin.ts | 16 +++++++-- .../src/plugins/PgMutationCreatePlugin.ts | 7 +++- .../plugins/PgMutationUpdateDeletePlugin.ts | 27 +++++++++++--- .../src/plugins/PgNodeIdAttributesPlugin.ts | 26 ++++++++++---- .../src/plugins/PgProceduresPlugin.ts | 6 +++- .../src/plugins/PgRelationsPlugin.ts | 18 ++++++++-- graphile-build/graphile-build/src/global.ts | 4 ++- graphile-build/graphile-build/src/index.ts | 4 +-- 12 files changed, 129 insertions(+), 31 deletions(-) diff --git a/graphile-build/graphile-build-pg/src/plugins/PgAttributesPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgAttributesPlugin.ts index 52fd49f6f4..6b25b41bc3 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgAttributesPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgAttributesPlugin.ts @@ -299,13 +299,35 @@ export const PgAttributesPlugin: GraphileConfig.Plugin = { schema: { behaviorRegistry: { add: { - "-condition:attribute:filterBy": {}, - "-attribute:select": {}, - "-attribute:base": {}, - "-attribute:insert": {}, - "-attribute:update": {}, - "-attribute:filterBy": {}, - "-attribute:orderBy": {}, + "-attribute:select": { + description: "can this attribute be selected?", + entities: ["pgCodecAttribute"], + }, + "-attribute:insert": { + description: "can this attribute be written on create?", + entities: ["pgCodecAttribute"], + }, + "-attribute:update": { + description: "can this attribute be updated?", + entities: ["pgCodecAttribute"], + }, + "-attribute:base": { + description: "should we add this attribute to the 'base' input type?", + entities: ["pgCodecAttribute"], + }, + "-attribute:filterBy": { + description: "can we filter by this attribute?", + entities: ["pgCodecAttribute"], + }, + "-condition:attribute:filterBy": { + description: + "can we filter by this attribute in the `condition` argument?", + entities: ["pgCodecAttribute"], + }, + "-attribute:orderBy": { + description: "can we order by this attribute?", + entities: ["pgCodecAttribute"], + }, }, }, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgConditionArgumentPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgConditionArgumentPlugin.ts index 3f5f2202ec..eefcc00e0f 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgConditionArgumentPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgConditionArgumentPlugin.ts @@ -51,7 +51,10 @@ export const PgConditionArgumentPlugin: GraphileConfig.Plugin = { schema: { behaviorRegistry: { add: { - filter: {}, + filter: { + description: "can we filter this resource/codec", + entities: ["pgCodec", "pgResource"], + }, }, }, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgConditionCustomFieldsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgConditionCustomFieldsPlugin.ts index 508760c589..87da3a352d 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgConditionCustomFieldsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgConditionCustomFieldsPlugin.ts @@ -56,7 +56,11 @@ export const PgConditionCustomFieldsPlugin: GraphileConfig.Plugin = { schema: { behaviorRegistry: { add: { - "proc:filterBy": {}, + "proc:filterBy": { + description: + "can we filter by the result of this proc (function resource)", + entities: ["pgResource"], + }, }, }, entityBehavior: { diff --git a/graphile-build/graphile-build-pg/src/plugins/PgConnectionTotalCountPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgConnectionTotalCountPlugin.ts index e226355b82..cb426a21f0 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgConnectionTotalCountPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgConnectionTotalCountPlugin.ts @@ -42,7 +42,10 @@ export const PgConnectionTotalCountPlugin: GraphileConfig.Plugin = { schema: { behaviorRegistry: { add: { - totalCount: {}, + totalCount: { + description: "on a codec, should we add the totalCount field?", + entities: ["pgCodec"], + }, }, }, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts index 2b02491e8f..11156dc1df 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts @@ -345,9 +345,19 @@ export const PgCustomTypeFieldPlugin: GraphileConfig.Plugin = { schema: { behaviorRegistry: { add: { - queryField: {}, - mutationField: {}, - typeField: {}, + queryField: { + description: 'a "custom query function"', + entities: ["pgResource"], + }, + mutationField: { + description: 'a "custom mutation function"', + entities: ["pgResource"], + }, + typeField: { + description: + 'a "custom field function" - add it to a specific type (aka "computed column")', + entities: ["pgResource"], + }, }, }, entityBehavior: { diff --git a/graphile-build/graphile-build-pg/src/plugins/PgMutationCreatePlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgMutationCreatePlugin.ts index 96c29bbbea..50fb198717 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgMutationCreatePlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgMutationCreatePlugin.ts @@ -83,9 +83,14 @@ export const PgMutationCreatePlugin: GraphileConfig.Plugin = { schema: { behaviorRegistry: { add: { - "insert:resource:select": {}, + "insert:resource:select": { + description: + "can select the row that was inserted (on the mutation payload)", + entities: ["pgResource"], + }, record: { description: "record type used for insert", + entities: ["pgResource"], }, }, }, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgMutationUpdateDeletePlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgMutationUpdateDeletePlugin.ts index 9050f78ef2..be8281e853 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgMutationUpdateDeletePlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgMutationUpdateDeletePlugin.ts @@ -248,11 +248,28 @@ export const PgMutationUpdateDeletePlugin: GraphileConfig.Plugin = { schema: { behaviorRegistry: { add: { - "constraint:resource:update": {}, - "constraint:resource:delete": {}, - "update:resource:select": {}, - "delete:resource:nodeId": {}, - "delete:resource:select": {}, + "constraint:resource:update": { + description: "can update a record by this constraint", + entities: ["pgResourceUnique"], + }, + "constraint:resource:delete": { + description: "can delete a record by this constraint", + entities: ["pgResourceUnique"], + }, + "delete:resource:nodeId": { + description: "can delete a record by its Node ID", + entities: ["pgResource"], + }, + "update:resource:select": { + description: + "can you select the record that was updated on the mutation payload?", + entities: ["pgResource"], + }, + "delete:resource:select": { + description: + "can you select the record that was deleted on the mutation payload?", + entities: ["pgResource"], + }, }, }, entityBehavior: { diff --git a/graphile-build/graphile-build-pg/src/plugins/PgNodeIdAttributesPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgNodeIdAttributesPlugin.ts index df7b6c0745..e1b3661b20 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgNodeIdAttributesPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgNodeIdAttributesPlugin.ts @@ -25,7 +25,6 @@ declare global { interface BehaviorStrings { "nodeId:insert": true; "nodeId:update": true; - "nodeId:delete": true; "nodeId:base": true; "nodeId:filterBy": true; } @@ -64,11 +63,26 @@ export const PgNodeIdAttributesPlugin: GraphileConfig.Plugin = { schema: { behaviorRegistry: { add: { - "nodeId:insert": {}, - "nodeId:update": {}, - "nodeId:delete": {}, - "nodeId:base": {}, - "nodeId:filterBy": {}, + "nodeId:insert": { + description: + "can we insert to the columns represented by this nodeId which represents a table related via foreign key constraint?", + entities: ["pgCodecRelation"], + }, + "nodeId:update": { + description: + "can we update the columns represented by this nodeId which represents a table related via foreign key constraint?", + entities: ["pgCodecRelation"], + }, + "nodeId:base": { + description: + 'should we add a nodeId input representing this foreign key constraint to the "base" input type?', + entities: ["pgCodecRelation"], + }, + "nodeId:filterBy": { + description: + "can we filter by the columns represented by this nodeId which represents a table related via foreign key constraint?", + entities: ["pgCodecRelation"], + }, }, }, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgProceduresPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgProceduresPlugin.ts index 31082db75e..256e66644c 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgProceduresPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgProceduresPlugin.ts @@ -679,7 +679,11 @@ export const PgProceduresPlugin: GraphileConfig.Plugin = { schema: { behaviorRegistry: { add: { - "resource:connection:backwards": {}, + "resource:connection:backwards": { + description: + "can we paginate backwards through this collection's connection?", + entities: ["pgResource"], + }, }, }, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts index c10332fa84..c36b36f24d 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts @@ -35,6 +35,7 @@ const ref_sql = te.ref(sql, "sql"); declare global { namespace GraphileBuild { interface BehaviorStrings { + "singularRelation:resource:single": true; "singularRelation:resource:list": true; "singularRelation:resource:connection": true; } @@ -509,8 +510,21 @@ export const PgRelationsPlugin: GraphileConfig.Plugin = { schema: { behaviorRegistry: { add: { - "singularRelation:resource:list": {}, - "singularRelation:resource:connection": {}, + "singularRelation:resource:single": { + description: + "can we get a single one of these (resource) from a type?", + entities: ["pgCodecRelation", "pgCodecRef"], + }, + "singularRelation:resource:list": { + description: + "should we add a list field to navigate this singular relationship (when we know there can be at most one)?", + entities: ["pgCodecRelation", "pgCodecRef"], + }, + "singularRelation:resource:connection": { + description: + "should we add a connection field to navigate this singular relationship (when we know there can be at most one)?", + entities: ["pgCodecRelation", "pgCodecRef"], + }, }, }, entityBehavior: { diff --git a/graphile-build/graphile-build/src/global.ts b/graphile-build/graphile-build/src/global.ts index 57a23b0bd5..24269694b5 100644 --- a/graphile-build/graphile-build/src/global.ts +++ b/graphile-build/graphile-build/src/global.ts @@ -96,7 +96,9 @@ interface RegisterObjectType { declare global { namespace GraphileBuild { type BehaviorString = - | (string & { __incomingBehaviorString: true }) + | (string & { + /* lies; just for TS */ readonly __incomingBehaviorString: unique symbol; + }) | `${"" | "-"}${keyof GraphileBuild.BehaviorStrings}`; /** diff --git a/graphile-build/graphile-build/src/index.ts b/graphile-build/graphile-build/src/index.ts index bbdb36abdf..ddb2e9746f 100644 --- a/graphile-build/graphile-build/src/index.ts +++ b/graphile-build/graphile-build/src/index.ts @@ -860,8 +860,8 @@ declare global { Record< keyof GraphileBuild.BehaviorStrings, { - description?: string; - entities?: (keyof GraphileBuild.BehaviorEntities)[]; + description: string; + entities: (keyof GraphileBuild.BehaviorEntities)[]; } > >; From 7f84b4077ae4f44883152da99a22793ef40c8cf6 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Tue, 24 Sep 2024 13:35:49 +0100 Subject: [PATCH 05/50] More descriptions --- .../src/plugins/PgBasicsPlugin.ts | 30 +++++++++++++------ 1 file changed, 21 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 7b40bc575b..18ccf3679a 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts @@ -192,17 +192,29 @@ export const PgBasicsPlugin: GraphileConfig.Plugin = { add: { select: { description: - "can select this resource/column/etc. Note this does not necessarily mean you can do select * from users but it might mean that it's possible to see details about a users when it's returned by a function or similar. (In this case the codec has select but the resource has -select.)", + "can select this resource/column/etc. Note this does not necessarily mean you can do `select * from users` but it might mean that it's possible to see details about a `users` when it's returned by a function or similar. (In this case the `codec` has `select` but the `resource` has `-select`.)", entities: ["pgCodec", "pgResource"], }, - insert: { description: "", entities: [] }, - update: { description: "", entities: [] }, - delete: { description: "", entities: [] }, - base: { description: "", entities: [] }, - filter: { description: "", entities: [] }, - filterBy: { description: "", entities: [] }, - order: { description: "", entities: [] }, - orderBy: { description: "", entities: [] }, + insert: { + description: "can insert into this resource/column/etc", + entities: [], + }, + update: { + description: "can update a record in a resource/a column/etc", + entities: [], + }, + delete: { + description: "can delete a record in a resource", + entities: [], + }, + base: { + description: 'should we add this attribute to the "base" input type?', + entities: [], + }, + // filter: { description: "can we filter these results?", entities: [] }, + filterBy: { description: "can we filter by this thing?", entities: [] }, + order: { description: "can we order these results?", entities: [] }, + orderBy: { description: "can we order by this thing?", entities: [] }, }, }, entityBehavior: { From 4611bdec25e37cfeeec2c89425501b347f417ec9 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Tue, 24 Sep 2024 14:25:44 +0100 Subject: [PATCH 06/50] No connection for non-existant type --- .../src/plugins/PgTablesPlugin.ts | 1 + graphile-build/graphile-build/src/behavior.ts | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts index f14a981d54..f8242d87e7 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts @@ -794,6 +794,7 @@ export const PgTablesPlugin: GraphileConfig.Plugin = { } if ( + selectable && !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/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index c31f96c0b7..40c92a472c 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -84,13 +84,26 @@ export class Behavior { }; }; + private behaviorRegistry: { + [behavior in keyof GraphileBuild.BehaviorStrings]: { + entities: { + [entity in keyof GraphileBuild.BehaviorEntities]?: { + description: string; + pluginName: string; + }; + }; + }; + }; + public behaviorEntityTypes: (keyof GraphileBuild.BehaviorEntities)[] = []; private globalDefaultBehavior: ResolvedBehavior; + constructor( private resolvedPreset: GraphileConfig.ResolvedPreset, private build: GraphileBuild.Build, ) { + this.behaviorRegistry = Object.create(null); this.behaviorEntities = Object.create(null); this.registerEntity("string"); // This will be overwritten in freeze @@ -104,6 +117,36 @@ export class Behavior { const { resolvedPreset, build } = this; const plugins = sortedPlugins(resolvedPreset.plugins); + for (const plugin of plugins) { + const r = plugin.schema?.behaviorRegistry; + if (r?.add) { + for (const [key, spec] of Object.entries(r.add)) { + const behaviorString = key as keyof GraphileBuild.BehaviorStrings; + if (!this.behaviorRegistry[behaviorString]) { + this.behaviorRegistry[behaviorString] = { + entities: {}, + }; + } + const { description } = spec; + for (const entityType of spec.entities) { + if (!this.behaviorRegistry[behaviorString].entities[entityType]) { + this.behaviorRegistry[behaviorString].entities[entityType] = { + description, + pluginName: plugin.name, + }; + } else { + console.warn( + `Behavior string '${behaviorString}' for entity type '${entityType}' has been registered by more than one plugin! First registered by ${ + this.behaviorRegistry[behaviorString].entities[entityType]! + .pluginName + }; and then later again by ${plugin.name}`, + ); + } + } + } + } + } + const initialBehavior = resolvedPreset.schema?.defaultBehavior ?? ""; this.globalDefaultBehavior = resolveBehavior( initialBehavior From ea6e6d1cc684fa343549f1b803b557fbc919b8fc Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Tue, 24 Sep 2024 14:39:47 +0100 Subject: [PATCH 07/50] Move into class --- graphile-build/graphile-build/src/behavior.ts | 118 +++++++++--------- 1 file changed, 59 insertions(+), 59 deletions(-) diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index 40c92a472c..3a018505f0 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -148,7 +148,7 @@ export class Behavior { } const initialBehavior = resolvedPreset.schema?.defaultBehavior ?? ""; - this.globalDefaultBehavior = resolveBehavior( + this.globalDefaultBehavior = this.resolveBehavior( initialBehavior ? { behaviorString: initialBehavior, @@ -289,7 +289,7 @@ export class Behavior { return existing; } const behaviorEntity = this.behaviorEntities[entityType]; - const behavior = resolveBehavior( + const behavior = this.resolveBehavior( applyDefaultBehavior ? this.globalDefaultBehavior : NULL_BEHAVIOR, behaviorEntity.behaviorCallbacks, entity, @@ -334,6 +334,63 @@ export class Behavior { parseScope(filter: string) { return parseScope(filter); } + + private resolveBehavior( + initialBehavior: ResolvedBehavior, + // Misnomer; also allows strings or nothings + callbacks: ReadonlyArray< + [ + source: string, + callback: + | string + | null + | undefined + | ((behavior: string, ...args: TArgs) => string | string[]), + ] + >, + ...args: TArgs + ) { + let behaviorString = initialBehavior.behaviorString; + const stack: Array = [...initialBehavior.stack]; + + for (const [source, g] of callbacks) { + const oldBehavior = behaviorString; + if (typeof g === "string") { + if (g === "") { + continue; + } else if (behaviorString === "") { + behaviorString = g; + } else { + behaviorString = g + " " + behaviorString; + } + } else if (typeof g === "function") { + const newBehavior = g(oldBehavior, ...args); + if (!newBehavior.includes(oldBehavior)) { + throw new Error( + `${source} callback must return a list that contains the current (passed in) behavior in addition to any other behaviors you wish to set.`, + ); + } + if (Array.isArray(newBehavior)) { + behaviorString = joinBehaviors(newBehavior); + } else { + behaviorString = newBehavior; + } + } + const i = behaviorString.indexOf(oldBehavior); + const prefix = behaviorString.substring(0, i); + const suffix = behaviorString.substring(i + oldBehavior.length); + if (prefix !== "" || suffix !== "") { + stack.push({ source, prefix, suffix }); + } + } + return { + stack, + behaviorString, + toString() { + return behaviorString; + }, + }; + } } /** @@ -446,63 +503,6 @@ interface ResolvedBehavior { behaviorString: string; } -function resolveBehavior( - initialBehavior: ResolvedBehavior, - // Misnomer; also allows strings or nothings - callbacks: ReadonlyArray< - [ - source: string, - callback: - | string - | null - | undefined - | ((behavior: string, ...args: TArgs) => string | string[]), - ] - >, - ...args: TArgs -) { - let behaviorString = initialBehavior.behaviorString; - const stack: Array = [...initialBehavior.stack]; - - for (const [source, g] of callbacks) { - const oldBehavior = behaviorString; - if (typeof g === "string") { - if (g === "") { - continue; - } else if (behaviorString === "") { - behaviorString = g; - } else { - behaviorString = g + " " + behaviorString; - } - } else if (typeof g === "function") { - const newBehavior = g(oldBehavior, ...args); - if (!newBehavior.includes(oldBehavior)) { - throw new Error( - `${source} callback must return a list that contains the current (passed in) behavior in addition to any other behaviors you wish to set.`, - ); - } - if (Array.isArray(newBehavior)) { - behaviorString = joinBehaviors(newBehavior); - } else { - behaviorString = newBehavior; - } - } - const i = behaviorString.indexOf(oldBehavior); - const prefix = behaviorString.substring(0, i); - const suffix = behaviorString.substring(i + oldBehavior.length); - if (prefix !== "" || suffix !== "") { - stack.push({ source, prefix, suffix }); - } - } - return { - stack, - behaviorString, - toString() { - return behaviorString; - }, - }; -} - function getCachedEntity( listCache: Map, entity: T, From 22482abd09bc7dec43926580ec25687628ce81bb Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Tue, 24 Sep 2024 15:05:06 +0100 Subject: [PATCH 08/50] Move isValidBehaviorString to graphile-build --- .../graphile-build-pg/src/behavior.ts | 24 +++---------------- graphile-build/graphile-build/src/behavior.ts | 17 +++++++++++++ graphile-build/graphile-build/src/index.ts | 1 + 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/graphile-build/graphile-build-pg/src/behavior.ts b/graphile-build/graphile-build-pg/src/behavior.ts index 9686113173..ba86b60532 100644 --- a/graphile-build/graphile-build-pg/src/behavior.ts +++ b/graphile-build/graphile-build-pg/src/behavior.ts @@ -5,6 +5,7 @@ import type { PgResourceExtensions, } from "@dataplan/pg"; import { isDev } from "grafast"; +import { isValidBehaviorString } from "graphile-build"; import { inspect } from "util"; // NOTE: 'behaviour' is the correct spelling in UK English; we try and stick to @@ -49,7 +50,7 @@ export function getBehavior( return; } if (Array.isArray(behavior)) { - if (isDev && !behavior.every(isValidBehavior)) { + if (isDev && !behavior.every(isValidBehaviorString)) { throw new Error( `Invalid value for behavior; expected a string or string array using simple alphanumeric strings, but found ${inspect( behavior, @@ -61,7 +62,7 @@ export function getBehavior( } return; } - if (isValidBehavior(behavior)) { + if (isValidBehaviorString(behavior)) { behaviors.push(behavior); return; } @@ -72,22 +73,3 @@ export function getBehavior( ); } } - -/** - * We're strict with this because we want to be able to expand this in future. - * For example I want to allow `@behavior all some` to operate the same as - * `@behavior all\n@behavior some`. I also want to be able to add - * `@behavior -all` to remove a previously enabled behavior. - * - * @internal - */ -function isValidBehavior( - behavior: unknown, -): behavior is GraphileBuild.BehaviorString { - return ( - typeof behavior === "string" && - /^[+-]?([a-zA-Z](?:[_:]?[a-zA-Z0-9])+|\*)(?:\s+[+-]?(?:[a-zA-Z]([_:]?[a-zA-Z0-9])+|\*))*$/.test( - behavior, - ) - ); -} diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index 3a018505f0..76d03938a2 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -544,3 +544,20 @@ function stringMatches( } return undefined; } + +/** + * We're strict with this because we want to be able to expand this in future. + * For example I want to allow `@behavior all some` to operate the same as + * `@behavior all\n@behavior some`. I also want to be able to add + * `@behavior -all` to remove a previously enabled behavior. + */ +export function isValidBehaviorString( + behavior: unknown, +): behavior is GraphileBuild.BehaviorString { + return ( + typeof behavior === "string" && + /^[+-]?([a-zA-Z](?:[_:]?[a-zA-Z0-9])+|\*)(?:\s+[+-]?(?:[a-zA-Z]([_:]?[a-zA-Z0-9])+|\*))*$/.test( + behavior, + ) + ); +} diff --git a/graphile-build/graphile-build/src/index.ts b/graphile-build/graphile-build/src/index.ts index ddb2e9746f..42ef7c78c3 100644 --- a/graphile-build/graphile-build/src/index.ts +++ b/graphile-build/graphile-build/src/index.ts @@ -10,6 +10,7 @@ import { } from "grafast/graphql"; import { AsyncHooks, orderedApply, resolvePresets } from "graphile-config"; +export { isValidBehaviorString } from "./behavior.js"; import extend from "./extend.js"; import { makeInitialInflection } from "./inflection.js"; import { From 9039b00aa782f127fad2efb055ce6f13ee5b33c5 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Tue, 24 Sep 2024 15:19:16 +0100 Subject: [PATCH 09/50] Warn when behaviors don't match the registry --- graphile-build/graphile-build/src/behavior.ts | 46 +++++++++++++++++-- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index 76d03938a2..526a5fad45 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -149,6 +149,7 @@ export class Behavior { const initialBehavior = resolvedPreset.schema?.defaultBehavior ?? ""; this.globalDefaultBehavior = this.resolveBehavior( + null, initialBehavior ? { behaviorString: initialBehavior, @@ -290,6 +291,7 @@ export class Behavior { } const behaviorEntity = this.behaviorEntities[entityType]; const behavior = this.resolveBehavior( + entityType, applyDefaultBehavior ? this.globalDefaultBehavior : NULL_BEHAVIOR, behaviorEntity.behaviorCallbacks, entity, @@ -336,6 +338,7 @@ export class Behavior { } private resolveBehavior( + entityType: keyof GraphileBuild.BehaviorEntities | null, initialBehavior: ResolvedBehavior, // Misnomer; also allows strings or nothings callbacks: ReadonlyArray< @@ -377,9 +380,11 @@ export class Behavior { } } const i = behaviorString.indexOf(oldBehavior); - const prefix = behaviorString.substring(0, i); - const suffix = behaviorString.substring(i + oldBehavior.length); - if (prefix !== "" || suffix !== "") { + const rawPrefix = behaviorString.substring(0, i); + const rawSuffix = behaviorString.substring(i + oldBehavior.length); + if (rawPrefix !== "" || rawSuffix !== "") { + const prefix = this.validateBehavior(entityType, source, rawPrefix); + const suffix = this.validateBehavior(entityType, source, rawSuffix); stack.push({ source, prefix, suffix }); } } @@ -391,6 +396,41 @@ export class Behavior { }, }; } + + private validateBehavior( + entityType: keyof GraphileBuild.BehaviorEntities | null, + source: string, + rawBehaviorString: string, + ): GraphileBuild.BehaviorString { + const behaviorString = rawBehaviorString.trim(); + if (behaviorString == "") { + return "" as GraphileBuild.BehaviorString; + } + if (!isValidBehaviorString(behaviorString)) { + throw new Error( + `Expected ${JSON.stringify( + behaviorString, + )} to be a behavior string (source: ${source}).`, + ); + } + if (!entityType) return behaviorString; + const parts = behaviorString.split(/\s+/); + for (const part of parts) { + const behavior = part as keyof GraphileBuild.BehaviorStrings; + if (!this.behaviorRegistry[behavior]) { + console.trace( + `Behavior '${behavior}' has not been registered! (Source: ${source})`, + ); + } else if (!this.behaviorRegistry[behavior].entities[entityType]) { + console.trace( + `Behavior '${behavior}' is not registered for entity type '${entityType}'; it's only expected to be used with '${Object.keys( + this.behaviorRegistry[behavior].entities, + ).join("', '")}'. (Source: ${source})`, + ); + } + } + return behaviorString; + } } /** From 450c92dd58f0984378ca20ad3c572c930789a63b Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Tue, 24 Sep 2024 15:56:17 +0100 Subject: [PATCH 10/50] Register more behaviors and fix unregistered behavior detection --- .../src/plugins/PgAllRowsPlugin.ts | 18 ++++++++ .../src/plugins/PgAttributesPlugin.ts | 28 ++++++------ .../plugins/PgConnectionArgOrderByPlugin.ts | 16 +++++++ .../src/plugins/PgOrderCustomFieldsPlugin.ts | 12 +++++ .../src/plugins/PgRowByUniquePlugin.ts | 12 +++++ .../src/plugins/PgTableNodePlugin.ts | 9 ++++ graphile-build/graphile-build/src/behavior.ts | 44 +++++++++---------- 7 files changed, 102 insertions(+), 37 deletions(-) diff --git a/graphile-build/graphile-build-pg/src/plugins/PgAllRowsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgAllRowsPlugin.ts index 8518953998..9a16b4d0f2 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgAllRowsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgAllRowsPlugin.ts @@ -17,6 +17,11 @@ declare global { } namespace GraphileBuild { + interface BehaviorStrings { + "query:resource:connection": true; + "query:resource:list": true; + } + interface Inflection { /** * The base inflector used by `allRowsConnection` and `allRowsList`. @@ -69,6 +74,19 @@ export const PgAllRowsPlugin: GraphileConfig.Plugin = { }, schema: { + behaviorRegistry: { + add: { + "query:resource:connection": { + description: + '"connection" field for a resource at the root Query level', + entities: ["pgCodec"], + }, + "query:resource:list": { + description: '"list" field for a resource at the root Query level', + entities: ["pgCodec"], + }, + }, + }, hooks: { GraphQLObjectType_fields(fields, build, context) { const { diff --git a/graphile-build/graphile-build-pg/src/plugins/PgAttributesPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgAttributesPlugin.ts index 6b25b41bc3..49aac3d3db 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgAttributesPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgAttributesPlugin.ts @@ -29,13 +29,13 @@ declare global { namespace GraphileBuild { interface BehaviorStrings { - "-condition:attribute:filterBy": true; - "-attribute:select": true; - "-attribute:base": true; - "-attribute:insert": true; - "-attribute:update": true; - "-attribute:filterBy": true; - "-attribute:orderBy": true; + "condition:attribute:filterBy": true; + "attribute:select": true; + "attribute:base": true; + "attribute:insert": true; + "attribute:update": true; + "attribute:filterBy": true; + "attribute:orderBy": true; } interface Build { pgResolveOutputType( @@ -299,32 +299,32 @@ export const PgAttributesPlugin: GraphileConfig.Plugin = { schema: { behaviorRegistry: { add: { - "-attribute:select": { + "attribute:select": { description: "can this attribute be selected?", entities: ["pgCodecAttribute"], }, - "-attribute:insert": { + "attribute:insert": { description: "can this attribute be written on create?", entities: ["pgCodecAttribute"], }, - "-attribute:update": { + "attribute:update": { description: "can this attribute be updated?", entities: ["pgCodecAttribute"], }, - "-attribute:base": { + "attribute:base": { description: "should we add this attribute to the 'base' input type?", entities: ["pgCodecAttribute"], }, - "-attribute:filterBy": { + "attribute:filterBy": { description: "can we filter by this attribute?", entities: ["pgCodecAttribute"], }, - "-condition:attribute:filterBy": { + "condition:attribute:filterBy": { description: "can we filter by this attribute in the `condition` argument?", entities: ["pgCodecAttribute"], }, - "-attribute:orderBy": { + "attribute:orderBy": { description: "can we order by this attribute?", entities: ["pgCodecAttribute"], }, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgConnectionArgOrderByPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgConnectionArgOrderByPlugin.ts index f7c0a332c8..ae8d0943fd 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgConnectionArgOrderByPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgConnectionArgOrderByPlugin.ts @@ -27,6 +27,10 @@ declare global { } namespace GraphileBuild { + interface BehaviorStrings { + "resource:connection:order": true; + "resource:list:order": true; + } interface Inflection { orderByType(this: Inflection, typeName: string): string; } @@ -52,6 +56,18 @@ export const PgConnectionArgOrderByPlugin: GraphileConfig.Plugin = { }, schema: { + behaviorRegistry: { + add: { + "resource:connection:order": { + entities: ["pgResource"], + description: "", + }, + "resource:list:order": { + entities: ["pgResource"], + description: "", + }, + }, + }, entityBehavior: { pgCodec: "order", pgResource: { diff --git a/graphile-build/graphile-build-pg/src/plugins/PgOrderCustomFieldsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgOrderCustomFieldsPlugin.ts index 72aad68061..6d83eb7596 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgOrderCustomFieldsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgOrderCustomFieldsPlugin.ts @@ -19,6 +19,9 @@ declare global { } namespace GraphileBuild { + interface BehaviorStrings { + "proc:orderBy": true; + } interface Inflection { computedAttributeOrder( this: Inflection, @@ -54,6 +57,15 @@ export const PgOrderCustomFieldsPlugin: GraphileConfig.Plugin = { }, schema: { + behaviorRegistry: { + add: { + "proc:orderBy": { + entities: ["pgResource"], + description: + "can we order by the result of this functional resource?", + }, + }, + }, entityBehavior: { pgResource: { provides: ["inferred"], diff --git a/graphile-build/graphile-build-pg/src/plugins/PgRowByUniquePlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgRowByUniquePlugin.ts index cbe17d6e12..5fec712a7e 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgRowByUniquePlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgRowByUniquePlugin.ts @@ -21,6 +21,9 @@ declare global { } namespace GraphileBuild { + interface BehaviorStrings { + "query:resource:single": true; + } interface Inflection { rowByUnique( this: Inflection, @@ -62,6 +65,15 @@ export const PgRowByUniquePlugin: GraphileConfig.Plugin = { }, schema: { + behaviorRegistry: { + add: { + "query:resource:single": { + entities: ["pgResourceUnique"], + description: + "should we add a root level Query field to get just one record by this unique cosntraint?", + }, + }, + }, entityBehavior: { pgResourceUnique: "single", }, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgTableNodePlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgTableNodePlugin.ts index 0227b5d779..3797d64c66 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgTableNodePlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgTableNodePlugin.ts @@ -35,6 +35,15 @@ export const PgTableNodePlugin: GraphileConfig.Plugin = { after: ["PgTablesPlugin", "PgPolymorphismPlugin"], schema: { + behaviorRegistry: { + add: { + "type:node": { + entities: ["pgCodec"], + description: + "should the GraphQLObjectType (`type`) this codec represents implement the GraphQL Global Object Identification specification", + }, + }, + }, entityBehavior: { pgCodec: { provides: ["default"], diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index 526a5fad45..03e816668e 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -380,11 +380,11 @@ export class Behavior { } } const i = behaviorString.indexOf(oldBehavior); - const rawPrefix = behaviorString.substring(0, i); - const rawSuffix = behaviorString.substring(i + oldBehavior.length); - if (rawPrefix !== "" || rawSuffix !== "") { - const prefix = this.validateBehavior(entityType, source, rawPrefix); - const suffix = this.validateBehavior(entityType, source, rawSuffix); + const prefix = behaviorString.substring(0, i); + const suffix = behaviorString.substring(i + oldBehavior.length); + if (prefix !== "" || suffix !== "") { + this.validateBehavior(entityType, source, prefix); + this.validateBehavior(entityType, source, suffix); stack.push({ source, prefix, suffix }); } } @@ -400,28 +400,27 @@ export class Behavior { private validateBehavior( entityType: keyof GraphileBuild.BehaviorEntities | null, source: string, - rawBehaviorString: string, - ): GraphileBuild.BehaviorString { - const behaviorString = rawBehaviorString.trim(); - if (behaviorString == "") { - return "" as GraphileBuild.BehaviorString; - } - if (!isValidBehaviorString(behaviorString)) { - throw new Error( - `Expected ${JSON.stringify( - behaviorString, - )} to be a behavior string (source: ${source}).`, - ); + behaviorString: string, + ): void /*asserts behaviorString is GraphileBuild.BehaviorString*/ { + const result = this.parseBehaviorString(behaviorString); + if (!entityType) { + return; } - if (!entityType) return behaviorString; - const parts = behaviorString.split(/\s+/); - for (const part of parts) { - const behavior = part as keyof GraphileBuild.BehaviorStrings; + for (const { scope } of result) { + const behavior = scope.join(":") as keyof GraphileBuild.BehaviorStrings; if (!this.behaviorRegistry[behavior]) { console.trace( `Behavior '${behavior}' has not been registered! (Source: ${source})`, ); - } else if (!this.behaviorRegistry[behavior].entities[entityType]) { + } + + if ( + !Object.entries(this.behaviorRegistry).some( + ([bhv, { entities }]) => + (entities[entityType] && bhv === behavior) || + bhv.endsWith(":" + behavior), + ) + ) { console.trace( `Behavior '${behavior}' is not registered for entity type '${entityType}'; it's only expected to be used with '${Object.keys( this.behaviorRegistry[behavior].entities, @@ -429,7 +428,6 @@ export class Behavior { ); } } - return behaviorString; } } From ab1d70572bf3aa2161fe14eaa407b3db2fd00c72 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Tue, 24 Sep 2024 16:01:37 +0100 Subject: [PATCH 11/50] More behaviors registered --- .../graphile-build-pg/src/plugins/PgAllRowsPlugin.ts | 4 ++-- .../src/plugins/PgRelationsPlugin.ts | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/graphile-build/graphile-build-pg/src/plugins/PgAllRowsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgAllRowsPlugin.ts index 9a16b4d0f2..5b85e6df0d 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgAllRowsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgAllRowsPlugin.ts @@ -79,11 +79,11 @@ export const PgAllRowsPlugin: GraphileConfig.Plugin = { "query:resource:connection": { description: '"connection" field for a resource at the root Query level', - entities: ["pgCodec"], + entities: ["pgCodec", "pgResource", "pgResourceUnique"], }, "query:resource:list": { description: '"list" field for a resource at the root Query level', - entities: ["pgCodec"], + entities: ["pgCodec", "pgResource", "pgResourceUnique"], }, }, }, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts index c36b36f24d..195912fbdd 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts @@ -38,6 +38,8 @@ declare global { "singularRelation:resource:single": true; "singularRelation:resource:list": true; "singularRelation:resource:connection": true; + "manyRelation:resource:list": true; + "manyRelation:resource:connection": true; } interface SchemaOptions { pgMutationPayloadRelations?: boolean; @@ -525,6 +527,16 @@ export const PgRelationsPlugin: GraphileConfig.Plugin = { "should we add a connection field to navigate this singular relationship (when we know there can be at most one)?", entities: ["pgCodecRelation", "pgCodecRef"], }, + "manyRelation:resource:list": { + description: + "should we add a list field to navigate this relationship?", + entities: ["pgCodecRelation", "pgCodecRef"], + }, + "manyRelation:resource:connection": { + description: + "should we add a connection field to navigate this relationship?", + entities: ["pgCodecRelation", "pgCodecRef"], + }, }, }, entityBehavior: { From b7f5f293dab7bdb0844bb5b08d67af16aa7b0541 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Tue, 24 Sep 2024 17:33:29 +0100 Subject: [PATCH 12/50] Behavior multiplication plugin --- graphile-build/graphile-build/src/behavior.ts | 142 +++++++++++++++++- 1 file changed, 140 insertions(+), 2 deletions(-) diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index 03e816668e..a3db1c9569 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -1,6 +1,8 @@ import { arraysMatch } from "grafast"; import { orderedApply, sortedPlugins } from "graphile-config"; +import { version } from "./version.js"; + type BehaviorScope = string[]; interface BehaviorSpec { positive: boolean; @@ -117,6 +119,8 @@ export class Behavior { const { resolvedPreset, build } = this; const plugins = sortedPlugins(resolvedPreset.plugins); + const allEntities = new Set(); + for (const plugin of plugins) { const r = plugin.schema?.behaviorRegistry; if (r?.add) { @@ -129,6 +133,7 @@ export class Behavior { } const { description } = spec; for (const entityType of spec.entities) { + allEntities.add(entityType); if (!this.behaviorRegistry[behaviorString].entities[entityType]) { this.behaviorRegistry[behaviorString].entities[entityType] = { description, @@ -147,6 +152,62 @@ export class Behavior { } } + const defaultBehaviorByEntityTypeCache = new Map< + keyof GraphileBuild.BehaviorEntities, + string + >(); + const getDefaultBehaviorFor = ( + entityType: keyof GraphileBuild.BehaviorEntities, + ) => { + if (!defaultBehaviorByEntityTypeCache.has(entityType)) { + const supportedBehaviors = ( + Object.keys( + this.behaviorRegistry, + ) as (keyof GraphileBuild.BehaviorStrings)[] + ).filter((k) => this.behaviorRegistry[k].entities[entityType]); + + // TODO: scope this on an entity basis + const defaultBehaviors = this.globalDefaultBehavior; + + const behaviorString = ( + supportedBehaviors.join(" ") + + " " + + defaultBehaviors.behaviorString + ).trim(); + defaultBehaviorByEntityTypeCache.set(entityType, behaviorString); + return behaviorString; + } + return defaultBehaviorByEntityTypeCache.get(entityType)!; + }; + + plugins.unshift({ + name: "_GraphileBuildBehaviorSystemApplyPreferencesPlugin", + version, + description: + "This is a built-in plugin designed to apply preferences to the systems" + + " inferred behaviors; it runs for each `entityBehavior` after 'default'" + + " and 'inferred', but before 'override'.", + + schema: { + entityBehavior: Object.fromEntries( + [...allEntities].map((entityType) => { + return [ + entityType, + { + after: ["default", "inferred"], + before: ["override"], + provides: ["preferences"], + callback(behavior, entity) { + const defaultBehavior = getDefaultBehaviorFor(entityType); + return multiplyBehavior(defaultBehavior, behavior); + }, + }, + ]; + }), + ), + }, + }); + const initialBehavior = resolvedPreset.schema?.defaultBehavior ?? ""; this.globalDefaultBehavior = this.resolveBehavior( null, @@ -170,7 +231,7 @@ export class Behavior { ); orderedApply( - resolvedPreset.plugins, + plugins, getEntityBehaviorHooks, (hookName, hookFn, plugin) => { const entityType = hookName as keyof GraphileBuild.BehaviorEntities; @@ -368,7 +429,12 @@ export class Behavior { } } else if (typeof g === "function") { const newBehavior = g(oldBehavior, ...args); - if (!newBehavior.includes(oldBehavior)) { + if ( + !newBehavior.includes(oldBehavior) && + !source.startsWith( + "_GraphileBuildBehaviorSystemApplyPreferencesPlugin", + ) + ) { throw new Error( `${source} callback must return a list that contains the current (passed in) behavior in addition to any other behaviors you wish to set.`, ); @@ -599,3 +665,75 @@ export function isValidBehaviorString( ) ); } + +/* + * 1. Take each behavior from inferred + * 2. Find the matching behaviors from preferences + * 3. Output for the behavior a list of behaviors formed by combining the + * matching behaviors. The result needs to remain at least as constrained as + * it already is. + * + * For example: + * - Preferences: "-* +resource:list -resource:connection +query:resource:connection -query:resource:list" + * - AKA: turn everything off, use connections at the root, lists elsewhere + * - Inferred: "+connection +list" + * - Split to ["+connection", "+list"] + * - For "+connection" (which is equivalent to `+*:*:*:connection`, remember): + * - "-*" becomes "-connection" (needs to remain at least as constrained as it already is) + * - "-resource:connection" matches and is kept + * - "+query:resource:connection" matches and is kept + * - all other behaviors ignored (don't match) + * - For "+list": + * - "-*" becomes "-list" + * - "+resource:list" kept + * - "-query:resource:list" kept + * - all others don't match + * - Result: concatenate these: + * - "-connection -resource:connection +query:resource:connection -list +resource:list -query:resource:list" + */ +function multiplyBehavior(preferences: string, inferred: string) { + const pref = parseSpecs(preferences); + const inf = parseSpecs(inferred); + const result = inf.flatMap((infEntry) => { + const final: BehaviorSpec[] = []; + nextPref: for (const prefEntry of pref) { + // If it matches; new scope must be at least as constrainted as old scope + const newScope: BehaviorScope = []; + const l = Math.max(prefEntry.scope.length, infEntry.scope.length); + // Does it match? Loop backwards through scope keys ensuring matches + for (let i = 1; i <= l; i++) { + const infScope = + i <= infEntry.scope.length + ? infEntry.scope[infEntry.scope.length - i] + : "*"; + const prefScope = + i <= prefEntry.scope.length + ? prefEntry.scope[prefEntry.scope.length - i] + : "*"; + const match = + infScope === "*" || prefScope === "*" || infScope == prefScope; + + if (!match) { + // No match! Skip to next preference + continue nextPref; + } + + // There was a match; ensure we're suitably constrained + const scopeText = infScope == "*" ? prefScope : infScope; + newScope.unshift(scopeText); + } + + // If we get here, it must match; add our new behavior + final.push({ + scope: newScope, + positive: prefEntry.positive && infEntry.positive, + }); + } + return final; + }); + + const behaviorString = result + .map((r) => `${r.positive ? "" : "-"}${r.scope.join(":")}`) + .join(" "); + return behaviorString; +} From 82850b7ad99fddedb7b55ca1a76c6391f8d2c616 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Tue, 24 Sep 2024 17:35:52 +0100 Subject: [PATCH 13/50] Must conform --- graphile-build/graphile-build/src/behavior.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index a3db1c9569..d10632c496 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -199,7 +199,10 @@ export class Behavior { provides: ["preferences"], callback(behavior, entity) { const defaultBehavior = getDefaultBehaviorFor(entityType); - return multiplyBehavior(defaultBehavior, behavior); + return [ + behavior, + multiplyBehavior(defaultBehavior, behavior), + ]; }, }, ]; @@ -429,12 +432,7 @@ export class Behavior { } } else if (typeof g === "function") { const newBehavior = g(oldBehavior, ...args); - if ( - !newBehavior.includes(oldBehavior) && - !source.startsWith( - "_GraphileBuildBehaviorSystemApplyPreferencesPlugin", - ) - ) { + if (!newBehavior.includes(oldBehavior)) { throw new Error( `${source} callback must return a list that contains the current (passed in) behavior in addition to any other behaviors you wish to set.`, ); From 76f0444a4dc66c399e70f6846f7895969f54c8f2 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Tue, 24 Sep 2024 17:37:52 +0100 Subject: [PATCH 14/50] -* prevents corruption --- graphile-build/graphile-build/src/behavior.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index d10632c496..5757e263c7 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -200,7 +200,11 @@ export class Behavior { callback(behavior, entity) { const defaultBehavior = getDefaultBehaviorFor(entityType); return [ + // We must include the previous behavior; so let's keep everything... behavior, + // ... then remove everything ... + "-*", + // ... then replace it with what we actually want. multiplyBehavior(defaultBehavior, behavior), ]; }, From 421fceff4a345c753f86b5f73762ac928b54bcf9 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Tue, 24 Sep 2024 17:53:53 +0100 Subject: [PATCH 15/50] Add the parent behaviors too --- graphile-build/graphile-build/src/behavior.ts | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index 5757e263c7..db27012cdc 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -160,17 +160,28 @@ export class Behavior { entityType: keyof GraphileBuild.BehaviorEntities, ) => { if (!defaultBehaviorByEntityTypeCache.has(entityType)) { - const supportedBehaviors = ( - Object.keys( - this.behaviorRegistry, - ) as (keyof GraphileBuild.BehaviorStrings)[] - ).filter((k) => this.behaviorRegistry[k].entities[entityType]); + const supportedBehaviors = new Set(); + + for (const [behaviorString, spec] of Object.entries( + this.behaviorRegistry, + )) { + if (spec.entities[entityType]) { + const parts = behaviorString.split(":"); + const l = parts.length; + for (let i = 0; i < l; i++) { + const subparts = parts.slice(i, l); + // We need to add all of the parent behaviors, e.g. `foo:bar:baz` + // should also add `bar:baz` and `baz` + supportedBehaviors.add(subparts.join(":")); + } + } + } // TODO: scope this on an entity basis const defaultBehaviors = this.globalDefaultBehavior; const behaviorString = ( - supportedBehaviors.join(" ") + + [...supportedBehaviors].sort().join(" ") + " " + defaultBehaviors.behaviorString ).trim(); From ec470d582b271dfc5cf6c108dbc22c50e8f17b02 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Tue, 24 Sep 2024 19:50:40 +0100 Subject: [PATCH 16/50] Add more missing behaviors, and fix behavior of connection-incapable lists (use 'array' instead) --- .../src/plugins/PgCustomTypeFieldPlugin.ts | 40 +++++++++++++++++-- graphile-build/graphile-build/src/behavior.ts | 25 ++++++++---- .../src/plugins/CommonBehaviorsPlugin.ts | 13 +++++- 3 files changed, 66 insertions(+), 12 deletions(-) diff --git a/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts index 11156dc1df..5b25904098 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts @@ -65,6 +65,14 @@ declare global { queryField: true; mutationField: true; typeField: true; + "typeField:resource:connection": true; + "typeField:resource:list": true; + "typeField:resource:array": true; + "queryField:resource:connection": true; + "queryField:resource:list": true; + "queryField:resource:array": true; + "typeField:single": true; + "queryField:single": true; } interface Build { pgGetArgDetailsFromParameters( @@ -195,7 +203,7 @@ function shouldUseCustomConnection( function defaultProcSourceBehavior( s: PgResource, ): GraphileBuild.BehaviorString { - const behavior: GraphileBuild.BehaviorString[] = []; + const behavior: GraphileBuild.BehaviorString[] = ["-array"]; const firstParameter = ( s as PgResource ).parameters[0]; @@ -233,7 +241,7 @@ function defaultProcSourceBehavior( const canUseConnection = !s.sqlPartitionByIndex && !s.isList && !s.codec.arrayOfCodec; if (!canUseConnection) { - behavior.push("-connection", "list"); + behavior.push("-connection", "-list", "array"); } } @@ -358,6 +366,30 @@ export const PgCustomTypeFieldPlugin: GraphileConfig.Plugin = { 'a "custom field function" - add it to a specific type (aka "computed column")', entities: ["pgResource"], }, + "typeField:resource:connection": { + description: "", + entities: ["pgResource"], + }, + "typeField:resource:list": { + description: "", + entities: ["pgResource"], + }, + "queryField:resource:connection": { + description: "", + entities: ["pgResource"], + }, + "queryField:resource:list": { + description: "", + entities: ["pgResource"], + }, + "typeField:single": { + description: "", + entities: ["pgResource"], + }, + "queryField:single": { + description: "", + entities: ["pgResource"], + }, }, }, entityBehavior: { @@ -1154,7 +1186,9 @@ export const PgCustomTypeFieldPlugin: GraphileConfig.Plugin = { const baseScope = isRootQuery ? `queryField` : `typeField`; const connectionFieldBehaviorScope = `${baseScope}:resource:connection`; - const listFieldBehaviorScope = `${baseScope}:resource:list`; + const listFieldBehaviorScope = canUseConnection + ? `${baseScope}:resource:list` + : `${baseScope}:resource:array`; if ( canUseConnection && build.behavior.pgResourceMatches( diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index db27012cdc..d7abc3f106 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -165,7 +165,10 @@ export class Behavior { for (const [behaviorString, spec] of Object.entries( this.behaviorRegistry, )) { - if (spec.entities[entityType]) { + if ( + spec.entities[entityType] || + true /* This ` || true` is because of inheritance (e.g. unique inherits from resource inherits from codec); it causes a headache if we factor it in */ + ) { const parts = behaviorString.split(":"); const l = parts.length; for (let i = 0; i < l; i++) { @@ -216,7 +219,7 @@ export class Behavior { // ... then remove everything ... "-*", // ... then replace it with what we actually want. - multiplyBehavior(defaultBehavior, behavior), + multiplyBehavior(defaultBehavior, behavior, entityType), ]; }, }, @@ -487,17 +490,19 @@ export class Behavior { } for (const { scope } of result) { const behavior = scope.join(":") as keyof GraphileBuild.BehaviorStrings; - if (!this.behaviorRegistry[behavior]) { + if ( + !Object.keys(this.behaviorRegistry).some((bhv) => + stringMatches(bhv, behavior), + ) + ) { console.trace( `Behavior '${behavior}' has not been registered! (Source: ${source})`, ); } if ( - !Object.entries(this.behaviorRegistry).some( - ([bhv, { entities }]) => - (entities[entityType] && bhv === behavior) || - bhv.endsWith(":" + behavior), + !Object.entries(this.behaviorRegistry).some(([bhv, { entities }]) => + /*entities[entityType] &&*/ stringMatches(bhv, behavior), ) ) { console.trace( @@ -704,7 +709,11 @@ export function isValidBehaviorString( * - Result: concatenate these: * - "-connection -resource:connection +query:resource:connection -list +resource:list -query:resource:list" */ -function multiplyBehavior(preferences: string, inferred: string) { +function multiplyBehavior( + preferences: string, + inferred: string, + entityType: string, +) { const pref = parseSpecs(preferences); const inf = parseSpecs(inferred); const result = inf.flatMap((infEntry) => { diff --git a/graphile-build/graphile-build/src/plugins/CommonBehaviorsPlugin.ts b/graphile-build/graphile-build/src/plugins/CommonBehaviorsPlugin.ts index eac4c808b8..33d6fec044 100644 --- a/graphile-build/graphile-build/src/plugins/CommonBehaviorsPlugin.ts +++ b/graphile-build/graphile-build/src/plugins/CommonBehaviorsPlugin.ts @@ -5,8 +5,13 @@ import { version } from "../version.js"; declare global { namespace GraphileBuild { interface BehaviorStrings { + // 'connection' and 'list' are for connection-capable collections. If + // your collection is not connection-capable, it should use 'array' + // instead. connection: true; list: true; + array: true; + single: true; "interface:node": true; @@ -28,7 +33,13 @@ export const CommonBehaviorsPlugin: GraphileConfig.Plugin = { entities: [], }, list: { - description: "represent collection as a list (simple collections)", + description: + "represent collection as a list - only use with collections that can be represented as a connection too", + entities: [], + }, + array: { + description: + "represent an array as a list - use with collections which are not connection-capable (otherwise use list)", entities: [], }, single: { From e07061445a0847d654c308019d3615b7cef8b539 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Wed, 25 Sep 2024 13:44:56 +0100 Subject: [PATCH 17/50] Implement new split inferred/override behavior system --- .../src/plugins/PgAttributesPlugin.ts | 74 +++-- .../src/plugins/PgBasicsPlugin.ts | 28 +- .../src/plugins/PgConditionArgumentPlugin.ts | 10 +- .../plugins/PgConditionCustomFieldsPlugin.ts | 5 +- .../plugins/PgConnectionArgOrderByPlugin.ts | 18 +- .../src/plugins/PgCustomTypeFieldPlugin.ts | 5 +- .../PgFirstLastBeforeAfterArgsPlugin.ts | 8 +- .../PgInterfaceModeUnionAllRowsPlugin.ts | 19 +- .../src/plugins/PgMutationCreatePlugin.ts | 36 +- .../src/plugins/PgOrderCustomFieldsPlugin.ts | 5 +- .../src/plugins/PgPolymorphismPlugin.ts | 39 +-- .../src/plugins/PgProceduresPlugin.ts | 32 +- .../src/plugins/PgRelationsPlugin.ts | 15 +- .../src/plugins/PgTableNodePlugin.ts | 46 +-- .../src/plugins/PgTablesPlugin.ts | 80 ++--- graphile-build/graphile-build/src/behavior.ts | 307 ++++++++++++------ graphile-build/graphile-build/src/index.ts | 24 +- .../src/plugins/CommonBehaviorsPlugin.ts | 6 + .../postgraphile/src/presets/relay.ts | 152 ++++----- postgraphile/postgraphile/src/presets/v4.ts | 40 +-- 20 files changed, 524 insertions(+), 425 deletions(-) diff --git a/graphile-build/graphile-build-pg/src/plugins/PgAttributesPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgAttributesPlugin.ts index 49aac3d3db..93372585f9 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgAttributesPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgAttributesPlugin.ts @@ -333,44 +333,46 @@ export const PgAttributesPlugin: GraphileConfig.Plugin = { entityBehavior: { pgCodecAttribute: { - provides: ["default"], - before: ["inferred", "override"], - callback(behavior, [codec, attributeName]) { - const behaviors = new Set([ - "select", - "base", - "update", - "insert", - "filterBy", - "orderBy", - ]); - const attribute = codec.attributes[attributeName]; - function walk(codec: PgCodec) { - if (codec.arrayOfCodec) { - behaviors.add("-condition:attribute:filterBy"); - behaviors.add(`-attribute:orderBy`); - walk(codec.arrayOfCodec); - } else if (codec.rangeOfCodec) { - behaviors.add(`-condition:attribute:filterBy`); - behaviors.add(`-attribute:orderBy`); - walk(codec.rangeOfCodec); - } else if (codec.domainOfCodec) { - // No need to add a behavior for domain - walk(codec.domainOfCodec); - } else if (codec.attributes) { - behaviors.add(`-condition:attribute:filterBy`); - behaviors.add(`-attribute:orderBy`); - } else if (codec.isBinary) { - // Never filter, not in condition plugin nor any other - behaviors.add(`-attribute:filterBy`); - behaviors.add(`-attribute:orderBy`); - } else { - // Done + inferred: { + provides: ["default"], + before: ["inferred", "override"], + callback(behavior, [codec, attributeName]) { + const behaviors = new Set([ + "select", + "base", + "update", + "insert", + "filterBy", + "orderBy", + ]); + const attribute = codec.attributes[attributeName]; + function walk(codec: PgCodec) { + if (codec.arrayOfCodec) { + behaviors.add("-condition:attribute:filterBy"); + behaviors.add(`-attribute:orderBy`); + walk(codec.arrayOfCodec); + } else if (codec.rangeOfCodec) { + behaviors.add(`-condition:attribute:filterBy`); + behaviors.add(`-attribute:orderBy`); + walk(codec.rangeOfCodec); + } else if (codec.domainOfCodec) { + // No need to add a behavior for domain + walk(codec.domainOfCodec); + } else if (codec.attributes) { + behaviors.add(`-condition:attribute:filterBy`); + behaviors.add(`-attribute:orderBy`); + } else if (codec.isBinary) { + // Never filter, not in condition plugin nor any other + behaviors.add(`-attribute:filterBy`); + behaviors.add(`-attribute:orderBy`); + } else { + // Done + } } - } - walk(attribute.codec); + walk(attribute.codec); - return [...behaviors, behavior]; + return [...behaviors, behavior]; + }, }, }, }, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts index 18ccf3679a..460c49c828 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts @@ -219,16 +219,12 @@ export const PgBasicsPlugin: GraphileConfig.Plugin = { }, entityBehavior: { pgCodec: { - after: ["default", "inferred"], - provides: ["override"], - callback(behavior, codec) { + override(behavior, codec) { return [behavior, getBehavior(codec.extensions)]; }, }, pgCodecAttribute: { - after: ["default", "inferred"], - provides: ["override"], - callback(behavior, [codec, attributeName]) { + override(behavior, [codec, attributeName]) { if (typeof attributeName !== "string") { throw new Error( `pgCodecAttribute no longer accepts (codec, attribute) - it now accepts (codec, attributeName). Please update your code. Sorry! (Changed in PostGraphile V5 alpha 13.)`, @@ -242,9 +238,7 @@ export const PgBasicsPlugin: GraphileConfig.Plugin = { }, }, pgResource: { - after: ["default", "inferred"], - provides: ["override"], - callback(behavior, resource) { + override(behavior, resource) { return [ behavior, getBehavior([resource.codec.extensions, resource.extensions]), @@ -252,9 +246,7 @@ export const PgBasicsPlugin: GraphileConfig.Plugin = { }, }, pgResourceUnique: { - after: ["default", "inferred"], - provides: ["override"], - callback(behavior, [resource, unique]) { + override(behavior, [resource, unique]) { return [ behavior, getBehavior([ @@ -266,9 +258,7 @@ export const PgBasicsPlugin: GraphileConfig.Plugin = { }, }, pgCodecRelation: { - after: ["default", "inferred"], - provides: ["override"], - callback(behavior, relationSpec) { + override(behavior, relationSpec) { return [ behavior, // The behavior is the relation behavior PLUS the remote table @@ -282,9 +272,7 @@ export const PgBasicsPlugin: GraphileConfig.Plugin = { }, }, pgCodecRef: { - after: ["default", "inferred"], - provides: ["override"], - callback(behavior, [codec, refName]) { + override(behavior, [codec, refName]) { const ref = codec.refs?.[refName]; if (!ref) { throw new Error(`Codec ${codec.name} has no ref '${refName}'`); @@ -296,9 +284,7 @@ export const PgBasicsPlugin: GraphileConfig.Plugin = { }, }, pgRefDefinition: { - after: ["default", "inferred"], - provides: ["override"], - callback(behavior, refSpec) { + override(behavior, refSpec) { return [behavior, getBehavior(refSpec.extensions)]; }, }, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgConditionArgumentPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgConditionArgumentPlugin.ts index eefcc00e0f..e22e8723de 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgConditionArgumentPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgConditionArgumentPlugin.ts @@ -61,10 +61,12 @@ export const PgConditionArgumentPlugin: GraphileConfig.Plugin = { entityBehavior: { pgCodec: ["select", "filter"], pgResource: { - provides: ["default"], - before: ["inferred", "override"], - callback(behavior, resource) { - return resource.parameters ? [behavior] : ["filter", behavior]; + inferred: { + provides: ["default"], + before: ["inferred", "override"], + callback(behavior, resource) { + return resource.parameters ? [behavior] : ["filter", behavior]; + }, }, }, }, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgConditionCustomFieldsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgConditionCustomFieldsPlugin.ts index 87da3a352d..8bb2f67efa 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgConditionCustomFieldsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgConditionCustomFieldsPlugin.ts @@ -65,10 +65,7 @@ export const PgConditionCustomFieldsPlugin: GraphileConfig.Plugin = { }, entityBehavior: { pgResource: { - provides: ["inferred"], - after: ["default"], - before: ["override"], - callback(behavior, entity) { + inferred(behavior, entity) { if (isSimpleScalarComputedColumnLike(entity)) { return [behavior, "-proc:filterBy"]; } else { diff --git a/graphile-build/graphile-build-pg/src/plugins/PgConnectionArgOrderByPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgConnectionArgOrderByPlugin.ts index ae8d0943fd..5e67ce9ab7 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgConnectionArgOrderByPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgConnectionArgOrderByPlugin.ts @@ -71,14 +71,16 @@ export const PgConnectionArgOrderByPlugin: GraphileConfig.Plugin = { entityBehavior: { pgCodec: "order", pgResource: { - provides: ["default"], - before: ["inferred", "override"], - callback(behavior, resource) { - if (resource.parameters) { - return behavior; - } else { - return ["order", behavior]; - } + inferred: { + provides: ["default"], + before: ["inferred", "override"], + callback(behavior, resource) { + if (resource.parameters) { + return behavior; + } else { + return ["order", behavior]; + } + }, }, }, }, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts index 5b25904098..a0ace4d79e 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts @@ -394,10 +394,7 @@ export const PgCustomTypeFieldPlugin: GraphileConfig.Plugin = { }, entityBehavior: { pgResource: { - provides: ["inferred"], - after: ["defaults"], - before: ["overrides"], - callback(behavior, entity) { + inferred(behavior, entity) { if (entity.parameters) { return [behavior, defaultProcSourceBehavior(entity)]; } else { diff --git a/graphile-build/graphile-build-pg/src/plugins/PgFirstLastBeforeAfterArgsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgFirstLastBeforeAfterArgsPlugin.ts index 393b448f6d..1a8f8fcda1 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgFirstLastBeforeAfterArgsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgFirstLastBeforeAfterArgsPlugin.ts @@ -39,13 +39,7 @@ export const PgFirstLastBeforeAfterArgsPlugin: GraphileConfig.Plugin = { schema: { entityBehavior: { - pgResource: { - provides: ["default"], - before: ["inferred", "override"], - callback(behavior) { - return ["resource:connection:backwards", behavior]; - }, - }, + pgResource: "resource:connection:backwards", }, hooks: { GraphQLObjectType_fields_field_args: commonFn, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgInterfaceModeUnionAllRowsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgInterfaceModeUnionAllRowsPlugin.ts index 67799750d8..95f23a10ca 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgInterfaceModeUnionAllRowsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgInterfaceModeUnionAllRowsPlugin.ts @@ -69,14 +69,17 @@ export const PgInterfaceModeUnionAllRowsPlugin: GraphileConfig.Plugin = { schema: { entityBehavior: { pgCodec: { - provides: ["default"], - before: ["inferred", "override"], - callback(behavior, entity) { - if (entity.polymorphism?.mode === "union") { - return ["connection", "-list", behavior]; - } else { - return behavior; - } + inferred: { + provides: ["default"], + before: ["inferred"], + callback(behavior, entity) { + if (entity.polymorphism?.mode === "union") { + // TODO: explain why this exists! Also, why is it default and not inferred? + return ["connection", "-list", behavior]; + } else { + return behavior; + } + }, }, }, }, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgMutationCreatePlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgMutationCreatePlugin.ts index 50fb198717..9ce292137c 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgMutationCreatePlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgMutationCreatePlugin.ts @@ -97,23 +97,25 @@ export const PgMutationCreatePlugin: GraphileConfig.Plugin = { entityBehavior: { pgResource: { - provides: ["default"], - before: ["inferred", "override"], - callback(behavior, resource) { - const newBehavior: GraphileBuild.BehaviorString[] = [ - behavior, - "insert:resource:select", - ]; - if ( - !resource.parameters && - !!resource.codec.attributes && - !resource.codec.polymorphism && - !resource.codec.isAnonymous - ) { - newBehavior.unshift("insert"); - newBehavior.unshift("record"); - } - return newBehavior; + inferred: { + provides: ["default"], + before: ["inferred", "override"], + callback(behavior, resource) { + const newBehavior: GraphileBuild.BehaviorString[] = [ + behavior, + "insert:resource:select", + ]; + if ( + !resource.parameters && + !!resource.codec.attributes && + !resource.codec.polymorphism && + !resource.codec.isAnonymous + ) { + newBehavior.unshift("insert"); + newBehavior.unshift("record"); + } + return newBehavior; + }, }, }, }, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgOrderCustomFieldsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgOrderCustomFieldsPlugin.ts index 6d83eb7596..0fe8b1277a 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgOrderCustomFieldsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgOrderCustomFieldsPlugin.ts @@ -68,10 +68,7 @@ export const PgOrderCustomFieldsPlugin: GraphileConfig.Plugin = { }, entityBehavior: { pgResource: { - provides: ["inferred"], - after: ["default"], - before: ["override"], - callback(behavior, resource) { + inferred(behavior, resource) { if (isSimpleScalarComputedColumnLike(resource)) { return [behavior, "-orderBy"]; } else { diff --git a/graphile-build/graphile-build-pg/src/plugins/PgPolymorphismPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgPolymorphismPlugin.ts index 0d5f162c74..a65967c368 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgPolymorphismPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgPolymorphismPlugin.ts @@ -657,24 +657,23 @@ export const PgPolymorphismPlugin: GraphileConfig.Plugin = { schema: { entityBehavior: { pgCodec: { - provides: ["default"], - before: ["inferred", "override"], - callback(behavior, codec) { - return [ - "select", - "table", - ...((!codec.isAnonymous - ? ["insert", "update"] - : []) as GraphileBuild.BehaviorString[]), - behavior, - ]; + inferred: { + provides: ["default"], + before: ["inferred", "override"], + callback(behavior, codec) { + return [ + "select", + "table", + ...((!codec.isAnonymous + ? ["insert", "update"] + : []) as GraphileBuild.BehaviorString[]), + behavior, + ]; + }, }, }, pgCodecRelation: { - provides: ["inferred"], - after: ["default", "PgRelationsPlugin"], - before: ["override"], - callback(behavior, entity, build) { + inferred(behavior, entity, build) { const { input: { pgRegistry: { pgRelations }, @@ -719,10 +718,7 @@ export const PgPolymorphismPlugin: GraphileConfig.Plugin = { }, }, pgCodecAttribute: { - provides: ["inferred"], - after: ["default"], - before: ["override"], - callback(behavior, [codec, attributeName], build) { + inferred(behavior, [codec, attributeName], build) { // If this is the primary key of a related table of a // `@interface mode:relational` table, then omit it from the schema const tbl = build.pgTableResource(codec); @@ -758,10 +754,7 @@ export const PgPolymorphismPlugin: GraphileConfig.Plugin = { }, }, pgResource: { - provides: ["inferred"], - after: ["default"], - before: ["override"], - callback(behavior, resource, build) { + inferred(behavior, resource, build) { // Disable insert/update/delete on relational tables const newBehavior = [behavior]; if ( diff --git a/graphile-build/graphile-build-pg/src/plugins/PgProceduresPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgProceduresPlugin.ts index 256e66644c..eccfdbd79e 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgProceduresPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgProceduresPlugin.ts @@ -689,21 +689,23 @@ export const PgProceduresPlugin: GraphileConfig.Plugin = { entityBehavior: { pgResource: { - provides: ["default"], - before: [ - // By running before this, we actually override it because it - // prefixes further back in the behavior chain - "PgFirstLastBeforeAfterArgsPlugin", - "inferred", - "override", - ], - callback(behavior, resource) { - if (resource.parameters) { - // Default to no backwards pagination for functions - return ["-resource:connection:backwards", behavior]; - } else { - return behavior; - } + inferred: { + provides: ["default"], + before: [ + // By running before this, we actually override it because it + // prefixes further back in the behavior chain + "PgFirstLastBeforeAfterArgsPlugin", + "inferred", + "override", + ], + callback(behavior, resource) { + if (resource.parameters) { + // Default to no backwards pagination for functions + return ["-resource:connection:backwards", behavior]; + } else { + return behavior; + } + }, }, }, }, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts index 195912fbdd..59451effe7 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts @@ -541,10 +541,7 @@ export const PgRelationsPlugin: GraphileConfig.Plugin = { }, entityBehavior: { pgCodecRelation: { - provides: ["inferred"], - before: ["override"], - after: ["default"], - callback(behavior, entity): GraphileBuild.BehaviorString[] { + inferred(behavior, entity): GraphileBuild.BehaviorString[] { if (entity.isUnique) { return [ behavior, @@ -558,10 +555,7 @@ export const PgRelationsPlugin: GraphileConfig.Plugin = { }, }, pgCodecRef: { - provides: ["inferred"], - before: ["override"], - after: ["default"], - callback(behavior, [codec, refName]) { + inferred(behavior, [codec, refName]) { const ref = codec.refs?.[refName]; if (ref?.definition.singular) { return [ @@ -576,10 +570,7 @@ export const PgRelationsPlugin: GraphileConfig.Plugin = { }, }, pgRefDefinition: { - provides: ["inferred"], - before: ["override"], - after: ["default"], - callback(behavior, entity) { + inferred(behavior, entity) { if (entity.singular) { return [ behavior, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgTableNodePlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgTableNodePlugin.ts index 3797d64c66..4c09a0404d 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgTableNodePlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgTableNodePlugin.ts @@ -46,31 +46,33 @@ export const PgTableNodePlugin: GraphileConfig.Plugin = { }, entityBehavior: { pgCodec: { - provides: ["default"], - before: ["inferred", "override"], - callback(behavior, codec, build) { - const newBehavior = [behavior]; - if ( - !codec.isAnonymous && - !!codec.attributes && - (!codec.polymorphism || - codec.polymorphism.mode === "single" || - codec.polymorphism.mode === "relational") - ) { - const resource = build.pgTableResource( - codec as PgCodecWithAttributes, - ); - if (resource && resource.uniques?.length >= 1) { - if (codec.polymorphism) { - newBehavior.push("interface:node"); + inferred: { + provides: ["default"], + before: ["inferred"], + callback(behavior, codec, build) { + const newBehavior = [behavior]; + if ( + !codec.isAnonymous && + !!codec.attributes && + (!codec.polymorphism || + codec.polymorphism.mode === "single" || + codec.polymorphism.mode === "relational") + ) { + const resource = build.pgTableResource( + codec as PgCodecWithAttributes, + ); + if (resource && resource.uniques?.length >= 1) { + if (codec.polymorphism) { + newBehavior.push("interface:node"); + } else { + newBehavior.push("type:node"); + } } else { - newBehavior.push("type:node"); + // Meh } - } else { - // Meh } - } - return newBehavior; + return newBehavior; + }, }, }, }, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts index f8242d87e7..9ecbb906a1 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts @@ -602,53 +602,57 @@ export const PgTablesPlugin: GraphileConfig.Plugin = { }, entityBehavior: { pgCodec: { - provides: ["default"], - before: ["inferred", "override"], - callback(behavior, codec) { - if (codec.attributes) { + inferred: { + provides: ["default"], + 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[]), + ]; + } else { + return [behavior]; + } + }, + }, + }, + pgResource: { + inferred: { + provides: ["default"], + before: ["inferred", "override"], + callback(behavior, resource) { + const isFunction = !!resource.parameters; const isUnloggedOrTemp = - codec.extensions?.pg?.persistence === "u" || - codec.extensions?.pg?.persistence === "t"; + resource.extensions?.pg?.persistence === "u" || + resource.extensions?.pg?.persistence === "t"; return [ - "resource:select", - "table", - ...((!codec.isAnonymous - ? ["resource:insert", "resource:update", "resource:delete"] + ...((!isFunction && !isUnloggedOrTemp + ? ["resource:select"] : []) as GraphileBuild.BehaviorString[]), behavior, ...((isUnloggedOrTemp ? [ - "-resource:select", - "-resource:insert", - "-resource:update", - "-resource:delete", + "-resource:select -resource:insert -resource:update -resource:delete", ] : []) as GraphileBuild.BehaviorString[]), ]; - } else { - return [behavior]; - } - }, - }, - pgResource: { - provides: ["default"], - before: ["inferred", "override"], - callback(behavior, resource) { - const isFunction = !!resource.parameters; - const isUnloggedOrTemp = - resource.extensions?.pg?.persistence === "u" || - resource.extensions?.pg?.persistence === "t"; - return [ - ...((!isFunction && !isUnloggedOrTemp - ? ["resource:select"] - : []) as GraphileBuild.BehaviorString[]), - behavior, - ...((isUnloggedOrTemp - ? [ - "-resource:select -resource:insert -resource:update -resource:delete", - ] - : []) as GraphileBuild.BehaviorString[]), - ]; + }, }, }, }, diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index d7abc3f106..c69012d1f5 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -1,4 +1,4 @@ -import { arraysMatch } from "grafast"; +import { arraysMatch, isDev } from "grafast"; import { orderedApply, sortedPlugins } from "graphile-config"; import { version } from "./version.js"; @@ -10,42 +10,73 @@ interface BehaviorSpec { } const NULL_BEHAVIOR: ResolvedBehavior = Object.freeze({ - behaviorString: "", + behaviorString: "" as GraphileBuild.BehaviorString, stack: Object.freeze([]), }); -const getEntityBehaviorHooks = (plugin: GraphileConfig.Plugin) => { +const getEntityBehaviorHooks = ( + plugin: GraphileConfig.Plugin, + type: "inferred" | "override", +) => { const val = plugin.schema?.entityBehavior; if (!val) return val; // These might not all be hooks, some might be strings. We need to convert the strings into hooks. - const entries = Object.entries(val); - let changed = false; - for (const entry of entries) { - const lhs = entry[1] as GraphileBuild.BehaviorString; + const result: { + [entityType in keyof GraphileBuild.BehaviorEntities]: GraphileBuild.EntityBehaviorHook; + } = Object.create(null); + for (const [entityType, rhs] of Object.entries(val)) { const isArrayOfStrings = - Array.isArray(lhs) && lhs.every((t) => typeof t === "string"); - if (isArrayOfStrings || typeof lhs === "string") { - const hook: Exclude< - NonNullable< - NonNullable["entityBehavior"] - >[keyof GraphileBuild.BehaviorEntities], - string - > = { - provides: ["default"], - before: ["inferred", "override"], - callback: isArrayOfStrings - ? (behavior) => [...lhs, behavior] - : (behavior) => [lhs, behavior], - }; - entry[1] = hook; - changed = true; + Array.isArray(rhs) && rhs.every((t) => typeof t === "string"); + if (isArrayOfStrings || typeof rhs === "string") { + if (type === "inferred") { + const hook: GraphileBuild.EntityBehaviorHook< + keyof GraphileBuild.BehaviorEntities + > = { + provides: ["default"], + before: ["inferred"], + callback: isArrayOfStrings + ? (behavior) => [...rhs, behavior] + : (behavior) => [rhs as GraphileBuild.BehaviorString, behavior], + }; + result[entityType as keyof GraphileBuild.BehaviorEntities] = hook; + } else { + // noop + } + } else if (Array.isArray(rhs)) { + if (type === "inferred") { + throw new Error( + `Behavior of '${entityType}' was specified as an array, but not every element of the array was a string (plugin: ${plugin.name})`, + ); + } else { + // noop + } + } else if (typeof rhs === "function") { + if (type === "inferred") { + const hook: GraphileBuild.EntityBehaviorHook< + keyof GraphileBuild.BehaviorEntities + > = { + provides: ["inferred"], + after: ["default"], + callback: rhs, + }; + result[entityType as keyof GraphileBuild.BehaviorEntities] = hook; + } else { + // noop + } + } else { + const hook = rhs[type]; + if (hook) { + result[entityType as keyof GraphileBuild.BehaviorEntities] = hook; + } } } - if (changed) { - return Object.fromEntries(entries) as any; - } else { - return val; - } + return result; +}; +const getEntityBehaviorInferredHooks = (plugin: GraphileConfig.Plugin) => { + return getEntityBehaviorHooks(plugin, "inferred"); +}; +const getEntityBehaviorOverrideHooks = (plugin: GraphileConfig.Plugin) => { + return getEntityBehaviorHooks(plugin, "override"); }; export type BehaviorDynamicMethods = { @@ -64,7 +95,17 @@ export class Behavior { private behaviorEntities: { [entityType in keyof GraphileBuild.BehaviorEntities]: { behaviorStrings: Record; - behaviorCallbacks: Array< + inferredBehaviorCallbacks: Array< + [ + source: string, + callback: ( + behavior: string, + entity: GraphileBuild.BehaviorEntities[entityType], + build: GraphileBuild.Build, + ) => string | string[], + ] + >; + overrideBehaviorCallbacks: Array< [ source: string, callback: ( @@ -152,48 +193,7 @@ export class Behavior { } } - const defaultBehaviorByEntityTypeCache = new Map< - keyof GraphileBuild.BehaviorEntities, - string - >(); - const getDefaultBehaviorFor = ( - entityType: keyof GraphileBuild.BehaviorEntities, - ) => { - if (!defaultBehaviorByEntityTypeCache.has(entityType)) { - const supportedBehaviors = new Set(); - - for (const [behaviorString, spec] of Object.entries( - this.behaviorRegistry, - )) { - if ( - spec.entities[entityType] || - true /* This ` || true` is because of inheritance (e.g. unique inherits from resource inherits from codec); it causes a headache if we factor it in */ - ) { - const parts = behaviorString.split(":"); - const l = parts.length; - for (let i = 0; i < l; i++) { - const subparts = parts.slice(i, l); - // We need to add all of the parent behaviors, e.g. `foo:bar:baz` - // should also add `bar:baz` and `baz` - supportedBehaviors.add(subparts.join(":")); - } - } - } - - // TODO: scope this on an entity basis - const defaultBehaviors = this.globalDefaultBehavior; - - const behaviorString = ( - [...supportedBehaviors].sort().join(" ") + - " " + - defaultBehaviors.behaviorString - ).trim(); - defaultBehaviorByEntityTypeCache.set(entityType, behaviorString); - return behaviorString; - } - return defaultBehaviorByEntityTypeCache.get(entityType)!; - }; - + /* plugins.unshift({ name: "_GraphileBuildBehaviorSystemApplyPreferencesPlugin", version, @@ -228,22 +228,11 @@ export class Behavior { ), }, }); + */ - const initialBehavior = resolvedPreset.schema?.defaultBehavior ?? ""; this.globalDefaultBehavior = this.resolveBehavior( null, - initialBehavior - ? { - behaviorString: initialBehavior, - stack: [ - { - source: "preset.schema.defaultBehavior", - prefix: initialBehavior, - suffix: "", - }, - ], - } - : { behaviorString: "", stack: [] }, + null, plugins.map((p) => [ `${p.name}.schema.globalBehavior`, p.schema?.globalBehavior, @@ -253,15 +242,31 @@ export class Behavior { orderedApply( plugins, - getEntityBehaviorHooks, + getEntityBehaviorInferredHooks, + (hookName, hookFn, plugin) => { + const entityType = hookName as keyof GraphileBuild.BehaviorEntities; + if (!this.behaviorEntities[entityType]) { + this.registerEntity(entityType); + } + const t = this.behaviorEntities[entityType]; + t.inferredBehaviorCallbacks.push([ + `${plugin.name}.schema.entityBehavior.${entityType}.inferred`, + hookFn, + ]); + }, + ); + + orderedApply( + plugins, + getEntityBehaviorOverrideHooks, (hookName, hookFn, plugin) => { const entityType = hookName as keyof GraphileBuild.BehaviorEntities; if (!this.behaviorEntities[entityType]) { this.registerEntity(entityType); } const t = this.behaviorEntities[entityType]; - t.behaviorCallbacks.push([ - `${plugin.name}.schema.entityBehavior.${entityType}`, + t.overrideBehaviorCallbacks.push([ + `${plugin.name}.schema.entityBehavior.${entityType}.override`, hookFn, ]); }, @@ -288,7 +293,8 @@ export class Behavior { this.behaviorEntityTypes.push(entityType); this.behaviorEntities[entityType] = { behaviorStrings: Object.create(null), - behaviorCallbacks: [], + inferredBehaviorCallbacks: [], + overrideBehaviorCallbacks: [], listCache: new Map(), cacheWithDefault: new Map(), cacheWithoutDefault: new Map(), @@ -359,7 +365,7 @@ export class Behavior { entityType: TEntityType, rawEntity: GraphileBuild.BehaviorEntities[TEntityType], applyDefaultBehavior = true, - ) { + ): ResolvedBehavior { this.assertEntity(entityType); const { cacheWithDefault, cacheWithoutDefault, listCache } = this.behaviorEntities[entityType]; @@ -372,13 +378,45 @@ export class Behavior { return existing; } const behaviorEntity = this.behaviorEntities[entityType]; - const behavior = this.resolveBehavior( + const inferredBehavior = this.resolveBehavior( entityType, - applyDefaultBehavior ? this.globalDefaultBehavior : NULL_BEHAVIOR, - behaviorEntity.behaviorCallbacks, + applyDefaultBehavior, + behaviorEntity.inferredBehaviorCallbacks, entity, this.build, ); + const overrideBehavior = this.resolveBehavior( + entityType, + applyDefaultBehavior, + behaviorEntity.overrideBehaviorCallbacks, + entity, + this.build, + ); + const defaultBehavior = this.getDefaultBehaviorFor(entityType); + const inferredBehaviorWithPreferencesApplied = multiplyBehavior( + defaultBehavior, + inferredBehavior.behaviorString, + entityType, + ); + const behaviorString = joinBehaviors([ + inferredBehaviorWithPreferencesApplied, + overrideBehavior.behaviorString, + ]); + const behavior: ResolvedBehavior = { + stack: [ + ...inferredBehavior.stack, + { + source: "__ApplyBehaviors__", + prefix: "", + suffix: `-* ${inferredBehaviorWithPreferencesApplied}`, + }, + ...overrideBehavior.stack, + ], + behaviorString, + toString() { + return behaviorString; + }, + }; cache.set(entity, behavior); return behavior; } @@ -421,7 +459,7 @@ export class Behavior { private resolveBehavior( entityType: keyof GraphileBuild.BehaviorEntities | null, - initialBehavior: ResolvedBehavior, + applyDefaultBehavior: boolean | null, // Misnomer; also allows strings or nothings callbacks: ReadonlyArray< [ @@ -434,7 +472,23 @@ export class Behavior { ] >, ...args: TArgs - ) { + ): ResolvedBehavior { + const defaultBehaviorFromPreset = + this.resolvedPreset.schema?.defaultBehavior ?? ""; + const initialBehavior = applyDefaultBehavior + ? this.globalDefaultBehavior + : applyDefaultBehavior === null + ? { + behaviorString: defaultBehaviorFromPreset, + stack: [ + { + source: "preset.schema.defaultBehavior", + prefix: defaultBehaviorFromPreset, + suffix: "", + }, + ], + } + : NULL_BEHAVIOR; let behaviorString = initialBehavior.behaviorString; const stack: Array = [...initialBehavior.stack]; @@ -472,7 +526,7 @@ export class Behavior { } return { stack, - behaviorString, + behaviorString: behaviorString as GraphileBuild.BehaviorString, toString() { return behaviorString; }, @@ -505,14 +559,58 @@ export class Behavior { /*entities[entityType] &&*/ stringMatches(bhv, behavior), ) ) { + ARGH(source, behavior, entityType); + /* console.trace( `Behavior '${behavior}' is not registered for entity type '${entityType}'; it's only expected to be used with '${Object.keys( this.behaviorRegistry[behavior].entities, ).join("', '")}'. (Source: ${source})`, ); + */ } } } + + _defaultBehaviorByEntityTypeCache = new Map< + keyof GraphileBuild.BehaviorEntities, + string + >(); + getDefaultBehaviorFor(entityType: keyof GraphileBuild.BehaviorEntities) { + if (!this._defaultBehaviorByEntityTypeCache.has(entityType)) { + const supportedBehaviors = new Set(); + + for (const [behaviorString, spec] of Object.entries( + this.behaviorRegistry, + )) { + if ( + spec.entities[entityType] || + true /* This ` || true` is because of inheritance (e.g. unique inherits from resource inherits from codec); it causes a headache if we factor it in */ + ) { + const parts = behaviorString.split(":"); + const l = parts.length; + for (let i = 0; i < l; i++) { + const subparts = parts.slice(i, l); + // We need to add all of the parent behaviors, e.g. `foo:bar:baz` + // should also add `bar:baz` and `baz` + supportedBehaviors.add(subparts.join(":")); + } + } + } + + // TODO: scope this on an entity basis + const defaultBehaviors = this.globalDefaultBehavior; + + const behaviorString = ( + [...supportedBehaviors].sort().join(" ") + + " " + + defaultBehaviors.behaviorString + ).trim(); + this._defaultBehaviorByEntityTypeCache.set(entityType, behaviorString); + return behaviorString; + } + return this._defaultBehaviorByEntityTypeCache.get(entityType)!; + } +} } /** @@ -600,10 +698,13 @@ function scopeMatches( export function joinBehaviors( strings: ReadonlyArray, -): string { +): GraphileBuild.BehaviorString { let str = ""; for (const string of strings) { if (string != null && string !== "") { + if (isDev && !isValidBehaviorString(string)) { + throw new Error(`'${string}' is not a valid behavior string`); + } if (str === "") { str = string; } else { @@ -611,7 +712,7 @@ export function joinBehaviors( } } } - return str; + return str as GraphileBuild.BehaviorString; } interface StackItem { @@ -622,7 +723,8 @@ interface StackItem { interface ResolvedBehavior { stack: ReadonlyArray; - behaviorString: string; + behaviorString: GraphileBuild.BehaviorString; + toString(): string; } function getCachedEntity( @@ -751,11 +853,18 @@ function multiplyBehavior( positive: prefEntry.positive && infEntry.positive, }); } + if (final.length === 0) { + console.warn( + `No matches for behavior '${infEntry.scope.join( + ":", + )}' - please ensure that this behavior is registered for entity type '${entityType}'`, + ); + } return final; }); const behaviorString = result .map((r) => `${r.positive ? "" : "-"}${r.scope.join(":")}`) .join(" "); - return behaviorString; + return behaviorString as GraphileBuild.BehaviorString; } diff --git a/graphile-build/graphile-build/src/index.ts b/graphile-build/graphile-build/src/index.ts index 42ef7c78c3..afe307db24 100644 --- a/graphile-build/graphile-build/src/index.ts +++ b/graphile-build/graphile-build/src/index.ts @@ -703,6 +703,17 @@ export async function watchSchema( export { version } from "./version.js"; declare global { + namespace GraphileBuild { + type EntityBehaviorHook< + entityType extends keyof GraphileBuild.BehaviorEntities, + > = PluginHook< + ( + behavior: GraphileBuild.BehaviorString, + entity: GraphileBuild.BehaviorEntities[entityType], + build: GraphileBuild.Build, + ) => GraphileBuild.BehaviorString | GraphileBuild.BehaviorString[] + >; + } namespace GraphileConfig { interface Provides { default: true; @@ -880,15 +891,10 @@ declare global { [entityType in keyof GraphileBuild.BehaviorEntities]?: | GraphileBuild.BehaviorString | GraphileBuild.BehaviorString[] - | PluginHook< - ( - behavior: GraphileBuild.BehaviorString, - entity: GraphileBuild.BehaviorEntities[entityType], - build: GraphileBuild.Build, - ) => - | GraphileBuild.BehaviorString - | GraphileBuild.BehaviorString[] - >; + | { + inferred?: GraphileBuild.EntityBehaviorHook; + override?: GraphileBuild.EntityBehaviorHook; + }; }; hooks?: { diff --git a/graphile-build/graphile-build/src/plugins/CommonBehaviorsPlugin.ts b/graphile-build/graphile-build/src/plugins/CommonBehaviorsPlugin.ts index 33d6fec044..be05356ead 100644 --- a/graphile-build/graphile-build/src/plugins/CommonBehaviorsPlugin.ts +++ b/graphile-build/graphile-build/src/plugins/CommonBehaviorsPlugin.ts @@ -16,6 +16,7 @@ declare global { "interface:node": true; "type:node": true; + node: true; } } } @@ -55,6 +56,11 @@ export const CommonBehaviorsPlugin: GraphileConfig.Plugin = { description: "should this type implement the Node interface?", entities: [], }, + + node: { + description: "should this type implement the Node interface?", + entities: [], + }, }, }, }, diff --git a/postgraphile/postgraphile/src/presets/relay.ts b/postgraphile/postgraphile/src/presets/relay.ts index 333a9683bf..77e92be5a4 100644 --- a/postgraphile/postgraphile/src/presets/relay.ts +++ b/postgraphile/postgraphile/src/presets/relay.ts @@ -57,87 +57,89 @@ export const PgRelayPlugin: GraphileConfig.Plugin = { +nodeId:base \ `, entityBehavior: { - pgCodecAttribute(behavior, [codec, attributeName], build) { - const newBehavior = [behavior]; - const attr = codec.attributes[attributeName]; + pgCodecAttribute: { + inferred(behavior, [codec, attributeName], build) { + const newBehavior = [behavior]; + const attr = codec.attributes[attributeName]; - const resource = - codec.polymorphism?.mode === "union" - ? Object.values(build.input.pgRegistry.pgResources).find((r) => { - if (r.parameters) return false; - if (r.isVirtual) return false; - if (r.isUnique) return false; - if (r.uniques.length === 0) return false; - const name = codec.extensions?.tags?.name ?? codec.name; - const impl = r.codec.extensions?.tags?.implements; - const implArr = impl - ? Array.isArray(impl) - ? impl - : [impl] - : []; - if (!implArr.includes(name)) return false; - return true; - }) - : Object.values(build.input.pgRegistry.pgResources).find((r) => { - if (r.codec !== codec) return false; - if (r.parameters) return false; - if (r.isVirtual) return false; - if (r.isUnique) return false; - if (r.uniques.length === 0) return false; - return true; - }); - const pk = resource?.uniques.find((u) => u.isPrimary); + const resource = + codec.polymorphism?.mode === "union" + ? Object.values(build.input.pgRegistry.pgResources).find((r) => { + if (r.parameters) return false; + if (r.isVirtual) return false; + if (r.isUnique) return false; + if (r.uniques.length === 0) return false; + const name = codec.extensions?.tags?.name ?? codec.name; + const impl = r.codec.extensions?.tags?.implements; + const implArr = impl + ? Array.isArray(impl) + ? impl + : [impl] + : []; + if (!implArr.includes(name)) return false; + return true; + }) + : Object.values(build.input.pgRegistry.pgResources).find((r) => { + if (r.codec !== codec) return false; + if (r.parameters) return false; + if (r.isVirtual) return false; + if (r.isUnique) return false; + if (r.uniques.length === 0) return false; + return true; + }); + const pk = resource?.uniques.find((u) => u.isPrimary); - // If the column is a primary key, don't include it (since it will be in the NodeID instead) - if (pk?.attributes.includes(attributeName)) { - // Do not include this column in the schema (other than for create) - newBehavior.push(...RELAY_HIDDEN_COLUMN_BEHAVIORS); - } else { - // If the column is available via a singular relation, don't include the column itself - const relationsMap = build.input.pgRegistry.pgRelations[codec.name]; - const relations = relationsMap - ? (Object.values( - build.input.pgRegistry.pgRelations[codec.name] ?? {}, - ) as PgCodecRelation[]) - : []; - const singularRelationsUsingThisColumn = relations.filter((r) => { - // NOTE: We do this even if the end table is not visible, because - // otherwise making the end table visible would be a breaking schema - // change. Users should make sure these columns are hidden from the - // schema if they are also hiding the target table. - if (!r.isUnique) return false; - if (r.isReferencee) return false; - if (!r.localAttributes.includes(attributeName)) return false; - return true; - }); - if ( - singularRelationsUsingThisColumn.length > 0 && - !attr.codec.extensions?.isEnumTableEnum - ) { + // If the column is a primary key, don't include it (since it will be in the NodeID instead) + if (pk?.attributes.includes(attributeName)) { // Do not include this column in the schema (other than for create) newBehavior.push(...RELAY_HIDDEN_COLUMN_BEHAVIORS); + } else { + // If the column is available via a singular relation, don't include the column itself + const relationsMap = build.input.pgRegistry.pgRelations[codec.name]; + const relations = relationsMap + ? (Object.values( + build.input.pgRegistry.pgRelations[codec.name] ?? {}, + ) as PgCodecRelation[]) + : []; + const singularRelationsUsingThisColumn = relations.filter((r) => { + // NOTE: We do this even if the end table is not visible, because + // otherwise making the end table visible would be a breaking schema + // change. Users should make sure these columns are hidden from the + // schema if they are also hiding the target table. + if (!r.isUnique) return false; + if (r.isReferencee) return false; + if (!r.localAttributes.includes(attributeName)) return false; + return true; + }); + if ( + singularRelationsUsingThisColumn.length > 0 && + !attr.codec.extensions?.isEnumTableEnum + ) { + // Do not include this column in the schema (other than for create) + newBehavior.push(...RELAY_HIDDEN_COLUMN_BEHAVIORS); + } + } + const relations = ( + Object.values( + build.input.pgRegistry.pgRelations[codec.name] ?? {}, + ) as PgCodecRelation[] + ).filter((r) => !r.isReferencee && r.isUnique); + const isPartOfRelation = + !attr.codec.extensions?.isEnumTableEnum && + relations.some((r) => r.localAttributes.includes(attributeName)); + if (isPartOfRelation) { + // `nodeId:filterBy` handles this + newBehavior.push(`-attribute:filterBy`); + // `nodeId:insert` handles this + newBehavior.push(`-attribute:insert`); + // `nodeId:update` handles this + newBehavior.push(`-attribute:update`); + // `nodeId:base` handles this + newBehavior.push(`-attribute:base`); } - } - const relations = ( - Object.values( - build.input.pgRegistry.pgRelations[codec.name] ?? {}, - ) as PgCodecRelation[] - ).filter((r) => !r.isReferencee && r.isUnique); - const isPartOfRelation = - !attr.codec.extensions?.isEnumTableEnum && - relations.some((r) => r.localAttributes.includes(attributeName)); - if (isPartOfRelation) { - // `nodeId:filterBy` handles this - newBehavior.push(`-attribute:filterBy`); - // `nodeId:insert` handles this - newBehavior.push(`-attribute:insert`); - // `nodeId:update` handles this - newBehavior.push(`-attribute:update`); - // `nodeId:base` handles this - newBehavior.push(`-attribute:base`); - } - return newBehavior; + return newBehavior; + }, }, }, }, diff --git a/postgraphile/postgraphile/src/presets/v4.ts b/postgraphile/postgraphile/src/presets/v4.ts index fe991c0c68..1adae9b82b 100644 --- a/postgraphile/postgraphile/src/presets/v4.ts +++ b/postgraphile/postgraphile/src/presets/v4.ts @@ -161,25 +161,27 @@ const makeV4Plugin = (options: V4Options): GraphileConfig.Plugin => { }, entityBehavior: { pgResource: "delete:resource:select", - pgCodecAttribute(behavior, [codec, attributeName]) { - const attribute = codec.attributes[attributeName]; - const underlyingCodec = - attribute.codec.domainOfCodec ?? attribute.codec; - const newBehavior = [behavior]; - if ( - underlyingCodec.arrayOfCodec || - underlyingCodec.isBinary || - underlyingCodec.rangeOfCodec - ) { - newBehavior.push("-attribute:orderBy"); - } - if ( - underlyingCodec.isBinary || - underlyingCodec.arrayOfCodec?.isBinary - ) { - newBehavior.push("-condition:attribute:filterBy"); - } - return newBehavior; + pgCodecAttribute: { + inferred(behavior, [codec, attributeName]) { + const attribute = codec.attributes[attributeName]; + const underlyingCodec = + attribute.codec.domainOfCodec ?? attribute.codec; + const newBehavior = [behavior]; + if ( + underlyingCodec.arrayOfCodec || + underlyingCodec.isBinary || + underlyingCodec.rangeOfCodec + ) { + newBehavior.push("-attribute:orderBy"); + } + if ( + underlyingCodec.isBinary || + underlyingCodec.arrayOfCodec?.isBinary + ) { + newBehavior.push("-condition:attribute:filterBy"); + } + return newBehavior; + }, }, }, }, From b368cb0ac9b4292f1c82577bcbbc53335ec8c069 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Wed, 25 Sep 2024 14:19:30 +0100 Subject: [PATCH 18/50] Getting combined behaviors for entities --- .../src/plugins/PgRelationsPlugin.ts | 7 + graphile-build/graphile-build/src/behavior.ts | 168 +++++++++++++++--- 2 files changed, 150 insertions(+), 25 deletions(-) diff --git a/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts index 59451effe7..8af2074572 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts @@ -1041,6 +1041,12 @@ function addRelations( // const isUnique = paths.every((p) => p.isUnique); + behavior = build.behavior.getCombinedBehaviorForEntities("pgCodecRef", { + ...(sharedCodec ? { pgCodec: sharedCodec } : null), + ...(hasExactlyOneSource ? { pgResource: firstSource } : null), + pgCodecRef: [codec, identifier], + }).behaviorString; + /* behavior = hasExactlyOneSource ? `${build.behavior.pgResourceBehavior( firstSource, @@ -1050,6 +1056,7 @@ function addRelations( sharedCodec, )} ${build.behavior.pgCodecRefBehavior([codec, identifier], false)}` : build.behavior.pgCodecRefBehavior([codec, identifier]); + */ // Shortcut simple relation alias ({ singleRecordPlan, listPlan, connectionPlan } = (() => { diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index c69012d1f5..adfd23a606 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -87,7 +87,6 @@ export type BehaviorDynamicMethods = { } & { [entityType in keyof GraphileBuild.BehaviorEntities as `${entityType}Behavior`]: ( entity: GraphileBuild.BehaviorEntities[entityType], - applyDefaultBehavior?: boolean, ) => string; }; @@ -116,11 +115,15 @@ export class Behavior { ] >; listCache: Map; - cacheWithDefault: Map< + inferredCache: Map< GraphileBuild.BehaviorEntities[entityType], ResolvedBehavior >; - cacheWithoutDefault: Map< + overrideCache: Map< + GraphileBuild.BehaviorEntities[entityType], + ResolvedBehavior + >; + fullCache: Map< GraphileBuild.BehaviorEntities[entityType], ResolvedBehavior >; @@ -231,7 +234,6 @@ export class Behavior { */ this.globalDefaultBehavior = this.resolveBehavior( - null, null, plugins.map((p) => [ `${p.name}.schema.globalBehavior`, @@ -296,8 +298,9 @@ export class Behavior { inferredBehaviorCallbacks: [], overrideBehaviorCallbacks: [], listCache: new Map(), - cacheWithDefault: new Map(), - cacheWithoutDefault: new Map(), + inferredCache: new Map(), + overrideCache: new Map(), + fullCache: new Map(), }; (this as this & BehaviorDynamicMethods)[`${entityType}Matches`] = ( entity: GraphileBuild.BehaviorEntities[TEntityType], @@ -305,10 +308,7 @@ export class Behavior { ): boolean | undefined => this.entityMatches(entityType, entity, behavior); (this as this & BehaviorDynamicMethods)[`${entityType}Behavior`] = ( entity: GraphileBuild.BehaviorEntities[TEntityType], - applyDefaultBehavior = true, - ): string => - this.getBehaviorForEntity(entityType, entity, applyDefaultBehavior) - .behaviorString; + ): string => this.getBehaviorForEntity(entityType, entity).behaviorString; } private assertEntity< @@ -364,34 +364,137 @@ export class Behavior { >( entityType: TEntityType, rawEntity: GraphileBuild.BehaviorEntities[TEntityType], - applyDefaultBehavior = true, ): ResolvedBehavior { this.assertEntity(entityType); - const { cacheWithDefault, cacheWithoutDefault, listCache } = - this.behaviorEntities[entityType]; - const cache = applyDefaultBehavior ? cacheWithDefault : cacheWithoutDefault; + const behaviorEntity = this.behaviorEntities[entityType]; + const { fullCache: cache } = behaviorEntity; + const entity = Array.isArray(rawEntity) - ? getCachedEntity(listCache, rawEntity) + ? getCachedEntity(behaviorEntity.listCache, rawEntity) : rawEntity; const existing = cache.get(entity); if (existing !== undefined) { return existing; } + const inferredBehavior = this.getInferredBehaviorForEntity( + entityType, + rawEntity, + ); + const overrideBehavior = this.getOverrideBehaviorForEntity( + entityType, + rawEntity, + ); + const behavior = this.getPreferencesAppliedBehaviors( + entityType, + inferredBehavior, + overrideBehavior, + ); + cache.set(entity, behavior); + return behavior; + } + + public getInferredBehaviorForEntity< + TEntityType extends keyof GraphileBuild.BehaviorEntities, + >( + entityType: TEntityType, + rawEntity: GraphileBuild.BehaviorEntities[TEntityType], + ): ResolvedBehavior { + this.assertEntity(entityType); const behaviorEntity = this.behaviorEntities[entityType]; - const inferredBehavior = this.resolveBehavior( + const { inferredCache: cache, inferredBehaviorCallbacks: callbacks } = + behaviorEntity; + + const entity = Array.isArray(rawEntity) + ? getCachedEntity(behaviorEntity.listCache, rawEntity) + : rawEntity; + const existing = cache.get(entity); + if (existing !== undefined) { + return existing; + } + const behavior = this.resolveBehavior( entityType, - applyDefaultBehavior, - behaviorEntity.inferredBehaviorCallbacks, + callbacks, entity, this.build, ); - const overrideBehavior = this.resolveBehavior( + cache.set(entity, behavior); + return behavior; + } + + public getOverrideBehaviorForEntity< + TEntityType extends keyof GraphileBuild.BehaviorEntities, + >( + entityType: TEntityType, + rawEntity: GraphileBuild.BehaviorEntities[TEntityType], + ): ResolvedBehavior { + this.assertEntity(entityType); + const behaviorEntity = this.behaviorEntities[entityType]; + const { overrideCache: cache, overrideBehaviorCallbacks: callbacks } = + behaviorEntity; + + const entity = Array.isArray(rawEntity) + ? getCachedEntity(behaviorEntity.listCache, rawEntity) + : rawEntity; + const existing = cache.get(entity); + if (existing !== undefined) { + return existing; + } + const behavior = this.resolveBehavior( entityType, - applyDefaultBehavior, - behaviorEntity.overrideBehaviorCallbacks, + callbacks, entity, this.build, ); + cache.set(entity, behavior); + return behavior; + } + + public getCombinedBehaviorForEntities< + TEntityType extends keyof GraphileBuild.BehaviorEntities, + >( + entityType: TEntityType, + sources: { + [entityType in keyof GraphileBuild.BehaviorEntities]?: GraphileBuild.BehaviorEntities[entityType]; + }, + ): ResolvedBehavior { + // First; ensure that `entityType` is the last key in sources + const keys = Object.keys(sources); + if (keys[keys.length - 1] !== entityType || !sources[entityType]) { + throw new Error( + `The order of keys in 'sources' is significant; you must ensure that '${entityType}' is the last key in 'sources' so that it has highest precedence`, + ); + } + const inferredBehaviors = keys.map((key) => + this.getInferredBehaviorForEntity( + key as keyof GraphileBuild.BehaviorEntities, + sources[ + key as keyof GraphileBuild.BehaviorEntities + ] as GraphileBuild.BehaviorEntities[keyof GraphileBuild.BehaviorEntities], + ), + ); + const overrideBehaviors = keys.map((key) => + this.getOverrideBehaviorForEntity( + key as keyof GraphileBuild.BehaviorEntities, + sources[ + key as keyof GraphileBuild.BehaviorEntities + ] as GraphileBuild.BehaviorEntities[keyof GraphileBuild.BehaviorEntities], + ), + ); + const behavior = this.getPreferencesAppliedBehaviors( + entityType, + joinResolvedBehaviors(inferredBehaviors), + joinResolvedBehaviors(overrideBehaviors), + ); + return behavior; + } + + getPreferencesAppliedBehaviors< + TEntityType extends keyof GraphileBuild.BehaviorEntities, + >( + entityType: TEntityType, + inferredBehavior: ResolvedBehavior, + overrideBehavior: ResolvedBehavior, + ) { const defaultBehavior = this.getDefaultBehaviorFor(entityType); const inferredBehaviorWithPreferencesApplied = multiplyBehavior( defaultBehavior, @@ -417,7 +520,6 @@ export class Behavior { return behaviorString; }, }; - cache.set(entity, behavior); return behavior; } @@ -459,7 +561,6 @@ export class Behavior { private resolveBehavior( entityType: keyof GraphileBuild.BehaviorEntities | null, - applyDefaultBehavior: boolean | null, // Misnomer; also allows strings or nothings callbacks: ReadonlyArray< [ @@ -475,7 +576,9 @@ export class Behavior { ): ResolvedBehavior { const defaultBehaviorFromPreset = this.resolvedPreset.schema?.defaultBehavior ?? ""; - const initialBehavior = applyDefaultBehavior + const initialBehavior = NULL_BEHAVIOR; + /* + applyDefaultBehavior ? this.globalDefaultBehavior : applyDefaultBehavior === null ? { @@ -489,7 +592,8 @@ export class Behavior { ], } : NULL_BEHAVIOR; - let behaviorString = initialBehavior.behaviorString; + */ + let behaviorString: string = initialBehavior.behaviorString; const stack: Array = [...initialBehavior.stack]; for (const [source, g] of callbacks) { @@ -715,6 +819,20 @@ export function joinBehaviors( return str as GraphileBuild.BehaviorString; } +export function joinResolvedBehaviors( + behaviors: ReadonlyArray, +): ResolvedBehavior { + const stack: StackItem[] = behaviors.flatMap((b) => b.stack); + const behaviorString = joinBehaviors( + behaviors.flatMap((b) => b.behaviorString), + ); + const b: ResolvedBehavior = { + behaviorString, + stack, + }; + return b; +} + interface StackItem { source: string; prefix: string; From 4a9ca7a9fabf27da391c97259d3bb4a6f152fecb Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Wed, 25 Sep 2024 16:39:28 +0100 Subject: [PATCH 19/50] Fix PgPolymorphismPlugin --- .../src/plugins/PgPolymorphismPlugin.ts | 80 ++++++++++--------- graphile-build/graphile-build/src/behavior.ts | 2 +- 2 files changed, 45 insertions(+), 37 deletions(-) diff --git a/graphile-build/graphile-build-pg/src/plugins/PgPolymorphismPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgPolymorphismPlugin.ts index a65967c368..1b19d7277b 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgPolymorphismPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgPolymorphismPlugin.ts @@ -673,48 +673,56 @@ export const PgPolymorphismPlugin: GraphileConfig.Plugin = { }, }, pgCodecRelation: { - inferred(behavior, entity, build) { - const { - input: { - pgRegistry: { pgRelations }, - }, - grafast: { arraysMatch }, - } = build; - const { localCodec, remoteResource, isUnique, isReferencee } = entity; - const remoteCodec = remoteResource.codec; + inferred: { + provides: ["inferred"], + after: ["default", "PgRelationsPlugin"], + callback(behavior, entity, build) { + const { + input: { + pgRegistry: { pgRelations }, + }, + grafast: { arraysMatch }, + } = build; + const { localCodec, remoteResource, isUnique, isReferencee } = + entity; + const remoteCodec = remoteResource.codec; - // Hide relation from a concrete type back to the abstract root table. - if ( - isUnique && - !isReferencee && - remoteCodec.polymorphism?.mode === "relational" - ) { - const localTypeName = build.inflection.tableType(localCodec); - const polymorphicTypeDefinitionEntry = Object.entries( - remoteCodec.polymorphism.types, - ).find(([, val]) => val.name === localTypeName); - if (polymorphicTypeDefinitionEntry) { - const [, { relationName }] = polymorphicTypeDefinitionEntry; - const relation = pgRelations[remoteCodec.name]?.[relationName]; - if ( - arraysMatch(relation.remoteAttributes, entity.localAttributes) - ) { - return [behavior, "-connection", "-list", "-single"]; + // Hide relation from a concrete type back to the abstract root table. + if ( + isUnique && + !isReferencee && + remoteCodec.polymorphism?.mode === "relational" + ) { + const localTypeName = build.inflection.tableType(localCodec); + const polymorphicTypeDefinitionEntry = Object.entries( + remoteCodec.polymorphism.types, + ).find(([, val]) => val.name === localTypeName); + if (polymorphicTypeDefinitionEntry) { + const [, { relationName }] = polymorphicTypeDefinitionEntry; + const relation = pgRelations[remoteCodec.name]?.[relationName]; + if ( + arraysMatch(relation.remoteAttributes, entity.localAttributes) + ) { + return [behavior, "-connection", "-list", "-single"]; + } } } - } - // Hide relation from abstract root table to related elements - if (isReferencee && localCodec.polymorphism?.mode === "relational") { - const relations = Object.values(localCodec.polymorphism.types).map( - (t) => pgRelations[localCodec.name]?.[t.relationName], - ); - if (relations.includes(entity)) { - return [behavior, "-connection", "-list", "-single"]; + // Hide relation from abstract root table to related elements + if ( + isReferencee && + localCodec.polymorphism?.mode === "relational" + ) { + const relations = Object.values( + localCodec.polymorphism.types, + ).map((t) => pgRelations[localCodec.name]?.[t.relationName]); + if (relations.includes(entity)) { + return [behavior, "-connection", "-list", "-single"]; + } } - } - return behavior; + return behavior; + }, }, }, pgCodecAttribute: { diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index adfd23a606..ac19aa9d71 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -509,7 +509,7 @@ export class Behavior { stack: [ ...inferredBehavior.stack, { - source: "__ApplyBehaviors__", + source: `__ApplyBehaviors_${entityType}__`, prefix: "", suffix: `-* ${inferredBehaviorWithPreferencesApplied}`, }, From 6639bd74411614b926e66d710c66cb9701466583 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Wed, 25 Sep 2024 17:13:39 +0100 Subject: [PATCH 20/50] Cleanup and fix default behavior --- .../src/plugins/PgRelationsPlugin.ts | 25 +++---- graphile-build/graphile-build/src/behavior.ts | 72 +++++-------------- 2 files changed, 25 insertions(+), 72 deletions(-) diff --git a/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts index 8af2074572..6b381720ae 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts @@ -1041,22 +1041,15 @@ function addRelations( // const isUnique = paths.every((p) => p.isUnique); - behavior = build.behavior.getCombinedBehaviorForEntities("pgCodecRef", { - ...(sharedCodec ? { pgCodec: sharedCodec } : null), - ...(hasExactlyOneSource ? { pgResource: firstSource } : null), - pgCodecRef: [codec, identifier], - }).behaviorString; - /* - behavior = hasExactlyOneSource - ? `${build.behavior.pgResourceBehavior( - firstSource, - )} ${build.behavior.pgCodecRefBehavior([codec, identifier], false)}` - : sharedCodec - ? `${build.behavior.pgCodecBehavior( - sharedCodec, - )} ${build.behavior.pgCodecRefBehavior([codec, identifier], false)}` - : build.behavior.pgCodecRefBehavior([codec, identifier]); - */ + const behaviorObj = build.behavior.getCombinedBehaviorForEntities( + "pgCodecRef", + { + ...(sharedCodec ? { pgCodec: sharedCodec } : null), + ...(hasExactlyOneSource ? { pgResource: firstSource } : null), + pgCodecRef: [codec, identifier], + }, + ); + behavior = behaviorObj.behaviorString; // Shortcut simple relation alias ({ singleRecordPlan, listPlan, connectionPlan } = (() => { diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index ac19aa9d71..b13e668a99 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -196,45 +196,21 @@ export class Behavior { } } - /* - plugins.unshift({ - name: "_GraphileBuildBehaviorSystemApplyPreferencesPlugin", - version, - description: - "This is a built-in plugin designed to apply preferences to the systems" + - " inferred behaviors; it runs for each `entityBehavior` after 'default'" + - " and 'inferred', but before 'override'.", - - schema: { - entityBehavior: Object.fromEntries( - [...allEntities].map((entityType) => { - return [ - entityType, - { - after: ["default", "inferred"], - before: ["override"], - provides: ["preferences"], - callback(behavior, entity) { - const defaultBehavior = getDefaultBehaviorFor(entityType); - return [ - // We must include the previous behavior; so let's keep everything... - behavior, - // ... then remove everything ... - "-*", - // ... then replace it with what we actually want. - multiplyBehavior(defaultBehavior, behavior, entityType), - ]; - }, - }, - ]; - }), - ), - }, - }); - */ - + const defaultBehaviorFromPreset = + this.resolvedPreset.schema?.defaultBehavior ?? ""; + const resolvedDefaultBehavior: ResolvedBehavior = { + behaviorString: defaultBehaviorFromPreset as GraphileBuild.BehaviorString, + stack: [ + { + source: "preset.schema.defaultBehavior", + prefix: defaultBehaviorFromPreset, + suffix: "", + }, + ], + }; this.globalDefaultBehavior = this.resolveBehavior( null, + resolvedDefaultBehavior, plugins.map((p) => [ `${p.name}.schema.globalBehavior`, p.schema?.globalBehavior, @@ -413,6 +389,7 @@ export class Behavior { } const behavior = this.resolveBehavior( entityType, + NULL_BEHAVIOR, callbacks, entity, this.build, @@ -441,6 +418,7 @@ export class Behavior { } const behavior = this.resolveBehavior( entityType, + NULL_BEHAVIOR, callbacks, entity, this.build, @@ -561,6 +539,7 @@ export class Behavior { private resolveBehavior( entityType: keyof GraphileBuild.BehaviorEntities | null, + initialBehavior: ResolvedBehavior, // Misnomer; also allows strings or nothings callbacks: ReadonlyArray< [ @@ -574,25 +553,6 @@ export class Behavior { >, ...args: TArgs ): ResolvedBehavior { - const defaultBehaviorFromPreset = - this.resolvedPreset.schema?.defaultBehavior ?? ""; - const initialBehavior = NULL_BEHAVIOR; - /* - applyDefaultBehavior - ? this.globalDefaultBehavior - : applyDefaultBehavior === null - ? { - behaviorString: defaultBehaviorFromPreset, - stack: [ - { - source: "preset.schema.defaultBehavior", - prefix: defaultBehaviorFromPreset, - suffix: "", - }, - ], - } - : NULL_BEHAVIOR; - */ let behaviorString: string = initialBehavior.behaviorString; const stack: Array = [...initialBehavior.stack]; From 2a3d6bd1b2ea97b47858d3941ef36e53068b2817 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Wed, 25 Sep 2024 17:22:42 +0100 Subject: [PATCH 21/50] Fix bad git patch add edits --- graphile-build/graphile-build/src/behavior.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index b13e668a99..a098edce75 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -623,14 +623,11 @@ export class Behavior { /*entities[entityType] &&*/ stringMatches(bhv, behavior), ) ) { - ARGH(source, behavior, entityType); - /* console.trace( `Behavior '${behavior}' is not registered for entity type '${entityType}'; it's only expected to be used with '${Object.keys( this.behaviorRegistry[behavior].entities, ).join("', '")}'. (Source: ${source})`, ); - */ } } } @@ -675,7 +672,6 @@ export class Behavior { return this._defaultBehaviorByEntityTypeCache.get(entityType)!; } } -} /** * Parses a scope like `query:resource:connection:filter` into it's constituent parts. From 6d96108f60a5bf83cb4a5594a95c0fd327e6897a Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Wed, 25 Sep 2024 17:29:19 +0100 Subject: [PATCH 22/50] Add a bug to fix the bug caused by the bug --- graphile-build/graphile-build/src/behavior.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index a098edce75..3621f92de5 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -389,7 +389,9 @@ export class Behavior { } const behavior = this.resolveBehavior( entityType, - NULL_BEHAVIOR, + // TODO: this should be NULL_BEHAVIOR, but we had to hack it due to a bug + // in the way that refs used to work. + this.globalDefaultBehavior, callbacks, entity, this.build, From 00a781691075b1baa634cdf1f7b7f6426b1f18c2 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Wed, 25 Sep 2024 17:40:02 +0100 Subject: [PATCH 23/50] Register behavior on demand --- graphile-build/graphile-build/src/behavior.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index 3621f92de5..137a88bc9c 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -618,6 +618,9 @@ export class Behavior { console.trace( `Behavior '${behavior}' has not been registered! (Source: ${source})`, ); + this.behaviorRegistry[behavior] = { + entities: {}, + }; } if ( From c36063747da5d5c92b461a9d780d4186e782f663 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Wed, 25 Sep 2024 17:49:13 +0100 Subject: [PATCH 24/50] Fix implied behavior for refs --- .../graphile-build-pg/src/plugins/PgRelationsPlugin.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts index 6b381720ae..529f8cc9c4 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts @@ -565,7 +565,12 @@ export const PgRelationsPlugin: GraphileConfig.Plugin = { "-singularRelation:resource:connection", ]; } else { - return behavior; + return [ + behavior, + "-single", + "manyRelation:resource:connection", + "manyRelation:resource:list", + ]; } }, }, From 5c3301ec77c2f6622718acf2d62854e62e58cbbb Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Wed, 25 Sep 2024 17:49:39 +0100 Subject: [PATCH 25/50] Don't inherit global behavior --- graphile-build/graphile-build/src/behavior.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index 137a88bc9c..d7cb75e8b5 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -389,9 +389,7 @@ export class Behavior { } const behavior = this.resolveBehavior( entityType, - // TODO: this should be NULL_BEHAVIOR, but we had to hack it due to a bug - // in the way that refs used to work. - this.globalDefaultBehavior, + NULL_BEHAVIOR, callbacks, entity, this.build, From 004d4eda736b94a02ecdb9e8bc7dfd6b988f6c7d Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Wed, 25 Sep 2024 17:50:56 +0100 Subject: [PATCH 26/50] Actually we do want to start with default behaviors otherwise you can't turn on singleRelation:*:connection for example --- graphile-build/graphile-build/src/behavior.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index d7cb75e8b5..87489ff87c 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -389,7 +389,7 @@ export class Behavior { } const behavior = this.resolveBehavior( entityType, - NULL_BEHAVIOR, + this.globalDefaultBehavior, callbacks, entity, this.build, From 8d0d9037d5f938cf26513ba5071632ed3ce6cc72 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Wed, 25 Sep 2024 17:53:22 +0100 Subject: [PATCH 27/50] Fix lint --- graphile-build/graphile-build/src/behavior.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index 87489ff87c..f3ee8aaed1 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -1,8 +1,6 @@ import { arraysMatch, isDev } from "grafast"; import { orderedApply, sortedPlugins } from "graphile-config"; -import { version } from "./version.js"; - type BehaviorScope = string[]; interface BehaviorSpec { positive: boolean; @@ -622,8 +620,9 @@ export class Behavior { } if ( - !Object.entries(this.behaviorRegistry).some(([bhv, { entities }]) => - /*entities[entityType] &&*/ stringMatches(bhv, behavior), + !Object.entries(this.behaviorRegistry).some( + ([bhv /*, { entities } */]) => + /*entities[entityType] &&*/ stringMatches(bhv, behavior), ) ) { console.trace( @@ -646,10 +645,13 @@ export class Behavior { for (const [behaviorString, spec] of Object.entries( this.behaviorRegistry, )) { - if ( - spec.entities[entityType] || - true /* This ` || true` is because of inheritance (e.g. unique inherits from resource inherits from codec); it causes a headache if we factor it in */ - ) { + /* + * This is `true` because of inheritance (e.g. unique inherits from + * resource inherits from codec); it causes a headache if we factor it + * in. + */ + const applyBehaviorsFromAllEntities = true; + if (spec.entities[entityType] || applyBehaviorsFromAllEntities) { const parts = behaviorString.split(":"); const l = parts.length; for (let i = 0; i < l; i++) { From 3660ec85c3045489e04bc0549f706686f3e536d9 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Thu, 26 Sep 2024 11:59:57 +0100 Subject: [PATCH 28/50] Almost completely remove incorrect addBehaviorToTags usage --- graphile-build/graphile-build-pg/src/index.ts | 12 +- .../src/plugins/PgCodecsPlugin.ts | 38 +++- .../src/plugins/PgEnumTablesPlugin.ts | 24 ++- .../src/plugins/PgIndexBehaviorsPlugin.ts | 68 +++++-- .../src/plugins/PgProceduresPlugin.ts | 11 +- .../src/plugins/PgRBACPlugin.ts | 170 +++++++++++------- .../PgRemoveExtensionResourcesPlugin.ts | 1 - .../src/plugins/PgTablesPlugin.ts | 52 +++--- graphile-build/graphile-build-pg/src/utils.ts | 25 --- graphile-build/graphile-build/src/global.ts | 1 + .../src/plugins/PgV4SmartTagsPlugin.ts | 26 ++- 11 files changed, 273 insertions(+), 155 deletions(-) diff --git a/graphile-build/graphile-build-pg/src/index.ts b/graphile-build/graphile-build-pg/src/index.ts index 1df79e4469..3de75aa090 100644 --- a/graphile-build/graphile-build-pg/src/index.ts +++ b/graphile-build/graphile-build-pg/src/index.ts @@ -34,11 +34,7 @@ export { PgTableNodePlugin } from "./plugins/PgTableNodePlugin.js"; export { PgTablesPlugin } from "./plugins/PgTablesPlugin.js"; export { PgTypesPlugin } from "./plugins/PgTypesPlugin.js"; export { defaultPreset } from "./preset.js"; -export { - addBehaviorToTags, - parseDatabaseIdentifier, - parseDatabaseIdentifiers, -} from "./utils.js"; +export { parseDatabaseIdentifier, parseDatabaseIdentifiers } from "./utils.js"; export { version } from "./version.js"; declare global { @@ -57,6 +53,9 @@ declare global { deprecated: string | string[]; /** For functions returning polymorphic type, which type to choose? */ returnType: string; + + /** For enum tables; we shouldn't expose these through GraphQL */ + enum: string | true; } interface PgResourceUniqueTags extends PgSmartTagsDict { @@ -109,6 +108,9 @@ declare global { interface PgResourceExtensions { description?: string; tags: Partial; + isInsertable?: boolean; + isUpdatable?: boolean; + isDeletable?: boolean; singleOutputParameterName?: string; /** For v4 compatibility, what's the name of the actual table. */ pg?: { diff --git a/graphile-build/graphile-build-pg/src/plugins/PgCodecsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgCodecsPlugin.ts index c92969bb23..974d975893 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgCodecsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgCodecsPlugin.ts @@ -21,7 +21,7 @@ import { import { EXPORTABLE, gatherConfig } from "graphile-build"; import type { PgAttribute, PgClass, PgType } from "pg-introspection"; -import { addBehaviorToTags, exportNameHint } from "../utils.js"; +import { exportNameHint } from "../utils.js"; import { version } from "../version.js"; interface State { @@ -160,6 +160,12 @@ declare global { interface PgCodecRelationExtensions { originalName?: string; } + interface PgCodecAttributeExtensions { + /** Checks capabilities of this attribute to see if INSERT is even possible */ + isInsertable?: boolean; + /** Checks capabilities of this attribute to see if UPDATE is even possible */ + isUpdatable?: boolean; + } } } @@ -349,13 +355,13 @@ export const PgCodecsPlugin: GraphileConfig.Plugin = { // Mutate at will! const tags = JSON.parse(JSON.stringify(rawTags)); + const extensions: DataplanPg.PgCodecAttributeExtensions = { + tags, + }; if (attributeAttribute.attidentity === "a") { // Generated ALWAYS so no insert/update - addBehaviorToTags( - tags, - "-attribute:insert -attribute:update", - true, - ); + extensions.isInsertable = false; + extensions.isUpdatable = false; } attributes[attributeAttribute.attname] = { @@ -372,9 +378,7 @@ export const PgCodecsPlugin: GraphileConfig.Plugin = { attributeAttribute.attidentity !== "") || attributeAttribute.getType()?.typdefault != null, // PERF: identicalVia, - extensions: { - tags, - }, + extensions, }; await info.process("pgCodecs_attribute", { serviceName, @@ -1510,5 +1514,21 @@ export const PgCodecsPlugin: GraphileConfig.Plugin = { }, }, }, + + entityBehavior: { + pgCodecAttribute: { + inferred(behavior, [codec, attributeName]) { + const newBehavior = [behavior]; + const attr = codec.attributes[attributeName]; + if (attr.extensions?.isInsertable === false) { + newBehavior.push("-attribute:insert"); + } + if (attr.extensions?.isUpdatable === false) { + newBehavior.push("-attribute:update"); + } + return newBehavior; + }, + }, + }, }, }; diff --git a/graphile-build/graphile-build-pg/src/plugins/PgEnumTablesPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgEnumTablesPlugin.ts index 502d597506..bb4bc0a179 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgEnumTablesPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgEnumTablesPlugin.ts @@ -9,7 +9,6 @@ import type { } from "pg-introspection"; import { sql } from "pg-sql2"; -import { addBehaviorToTags } from "../utils.js"; import { version } from "../version.js"; declare global { @@ -235,11 +234,6 @@ Original error: ${e.message} const isEnumTable = tags.enum === true || typeof tags.enum === "string"; - if (isEnumTable) { - // Prevent the table being recognised as a table - addBehaviorToTags(tags, "-*", true); - } - // By this point, even views should have "fake" constraints we can use // (e.g. `@primaryKey`) const enumConstraints = pgClass @@ -398,4 +392,22 @@ Original error: ${e.message} }, }, }), + schema: { + entityBehavior: { + pgResource: { + inferred: { + // We want to turn off all inferred behaviors on enum tables + after: ["inferred"], + provides: ["postInferred"], + callback(behavior, resource) { + const e = resource.extensions?.tags?.enum; + if (e === true || typeof e === "string") { + return [behavior, "-*"]; + } + return behavior; + }, + }, + }, + }, + }, }; diff --git a/graphile-build/graphile-build-pg/src/plugins/PgIndexBehaviorsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgIndexBehaviorsPlugin.ts index 4922f4ff40..db3486729c 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgIndexBehaviorsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgIndexBehaviorsPlugin.ts @@ -1,11 +1,17 @@ -import { addBehaviorToTags } from "../utils.js"; - declare global { namespace GraphileConfig { interface Plugins { PgIndexBehaviorsPlugin: true; } } + namespace DataplanPg { + interface PgCodecAttributeExtensions { + isIndexed?: boolean; + } + interface PgCodecRelationExtensions { + isIndexed?: boolean; + } + } } export const PgIndexBehaviorsPlugin: GraphileConfig.Plugin = { @@ -50,16 +56,9 @@ export const PgIndexBehaviorsPlugin: GraphileConfig.Plugin = { }); if (!isIndexed) { if (!relation.extensions) { - relation.extensions = { tags: Object.create(null) }; + relation.extensions = Object.create(null); } - if (!relation.extensions.tags) { - relation.extensions.tags = Object.create(null); - } - addBehaviorToTags( - relation.extensions.tags, - "-list -connection -single -manyToMany", - true, - ); + relation.extensions!.isIndexed = false; } } }, @@ -82,16 +81,47 @@ export const PgIndexBehaviorsPlugin: GraphileConfig.Plugin = { if (!attribute.extensions) { attribute.extensions = Object.create(null); } - if (!attribute.extensions!.tags) { - attribute.extensions!.tags = Object.create(null); - } - addBehaviorToTags( - attribute.extensions!.tags!, - "-filterBy -orderBy", - true, - ); + attribute.extensions!.isIndexed = false; } }, }, }, + schema: { + entityBehavior: { + pgCodecAttribute: { + inferred: { + after: ["inferred"], + provides: ["postInferred"], + callback(behavior, [codec, attributeName]) { + const newBehavior = [behavior]; + const attr = codec.attributes[attributeName]; + if (attr.extensions?.isIndexed === false) { + newBehavior.push("-filterBy", "-orderBy"); + } + return newBehavior; + }, + }, + }, + pgCodecRelation: { + inferred: { + after: ["inferred"], + provides: ["postInferred"], + callback(behavior, relation) { + const newBehavior = [behavior]; + if (relation.extensions?.isIndexed === false) { + newBehavior.push( + "-list", + "-connection", + "-single", + + // HACK: this impacts a community plugin and isn't part of core. + "-manyToMany" as GraphileBuild.BehaviorString, + ); + } + return newBehavior; + }, + }, + }, + }, + }, }; diff --git a/graphile-build/graphile-build-pg/src/plugins/PgProceduresPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgProceduresPlugin.ts index eccfdbd79e..219a140e1e 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgProceduresPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgProceduresPlugin.ts @@ -21,7 +21,7 @@ import { EXPORTABLE, gatherConfig } from "graphile-build"; import type { PgProc, PgProcArgument } from "pg-introspection"; import sql from "pg-sql2"; -import { addBehaviorToTags, exportNameHint } from "../utils.js"; +import { exportNameHint } from "../utils.js"; import { version } from "../version.js"; declare global { @@ -425,8 +425,6 @@ export const PgProceduresPlugin: GraphileConfig.Plugin = { [sql, sqlFromArgDigests, sqlIdent], ); - addBehaviorToTags(tags, "-filter -order", true); - const extensions: PgResourceExtensions = { pg: { serviceName, @@ -701,7 +699,12 @@ export const PgProceduresPlugin: GraphileConfig.Plugin = { callback(behavior, resource) { if (resource.parameters) { // Default to no backwards pagination for functions - return ["-resource:connection:backwards", behavior]; + return [ + "-resource:connection:backwards", + "-filter", + "-order", + behavior, + ]; } else { return behavior; } diff --git a/graphile-build/graphile-build-pg/src/plugins/PgRBACPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgRBACPlugin.ts index e742defced..3506fbca37 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgRBACPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgRBACPlugin.ts @@ -3,7 +3,6 @@ import "graphile-config"; import { gatherConfig } from "graphile-build"; import { entityPermissions } from "pg-introspection"; -import { addBehaviorToTags } from "../utils.js"; import { version } from "../version.js"; declare global { @@ -16,6 +15,29 @@ declare global { pgRBAC: Record; } } + + namespace DataplanPg { + interface PgCodecAttributeExtensions { + /** Checks permissions to see if SELECTing this attribute is allowed */ + canSelect?: boolean; + /** Checks permissions to see if INSERTing into this attribute is allowed */ + canInsert?: boolean; + /** Checks permissions to see if UPDATEing this attribute is allowed */ + canUpdate?: boolean; + } + interface PgResourceExtensions { + /** Checks permissions to see if SELECTing this resource is allowed */ + canSelect?: boolean; + /** Checks permissions to see if INSERTing this resource is allowed */ + canInsert?: boolean; + /** Checks permissions to see if UPDATEing this resource is allowed */ + canUpdate?: boolean; + /** Checks permissions to see if DELETEing this resource is allowed */ + canDelete?: boolean; + /** Checks permissions to see if EXECUTEing the function is allowed */ + canExecute?: boolean; + } + } } const EMPTY_OBJECT = Object.freeze({}); @@ -67,36 +89,12 @@ export const PgRBACPlugin: GraphileConfig.Plugin = { attributePermissions.insert || tablePermissions.insert; const canUpdate = attributePermissions.update || tablePermissions.update; - const parts: string[] = []; - if (!canSelect) { - // Only remove `select` privileges if at least one sibling attribute has - // a grant - otherwise assume that this is behind a function or - // similar and all attributes are allowed you just can't select - // directly. - const hasSiblingWithSelect = pgClass - .getAttributes() - .some( - (att) => - att.attnum > 0 && - entityPermissions(introspection, att, introspectionRole, true) - .select, - ); - if (hasSiblingWithSelect) { - parts.push("-select -filterBy -orderBy"); - } - } - if (!canInsert) { - parts.push("-insert"); - } - if (!canUpdate) { - parts.push("-update"); - } - if (parts.length > 0) { - attribute.extensions = attribute.extensions || Object.create(null); - attribute.extensions!.tags = - attribute.extensions!.tags || Object.create(null); - addBehaviorToTags(attribute.extensions!.tags!, parts.join(" ")); - } + attribute.extensions = attribute.extensions || Object.create(null); + Object.assign(attribute.extensions!, { + canSelect, + canInsert, + canUpdate, + }); }, async pgProcedures_PgResourceOptions(info, event) { const { pgProc, serviceName, resourceOptions } = event; @@ -114,16 +112,9 @@ export const PgRBACPlugin: GraphileConfig.Plugin = { introspectionRole, true, ); - if (!permissions.execute) { - resourceOptions.extensions = - resourceOptions.extensions || Object.create(null); - resourceOptions.extensions!.tags = - resourceOptions.extensions!.tags || Object.create(null); - addBehaviorToTags( - resourceOptions.extensions!.tags!, - "-queryField -mutationField -typeField -orderBy -filterBy", - ); - } + resourceOptions.extensions = + resourceOptions.extensions || Object.create(null); + resourceOptions.extensions!.canExecute = permissions.execute ?? true; }, async pgTables_PgResourceOptions(info, event) { const { pgClass, resourceOptions, serviceName } = event; @@ -134,8 +125,6 @@ export const PgRBACPlugin: GraphileConfig.Plugin = { const { introspection } = db; resourceOptions.extensions = resourceOptions.extensions || Object.create(null); - resourceOptions.extensions!.tags = - resourceOptions.extensions!.tags || Object.create(null); const introspectionRole = introspection.getCurrentUser(); if (!introspectionRole) { @@ -168,27 +157,82 @@ export const PgRBACPlugin: GraphileConfig.Plugin = { canUpdate = canUpdate || attributePermission.update; } } - - const parts: string[] = []; - if (!canSelect) { - // TODO: just `-select` should be sufficient, but it's not because we - // don't check it in enough places. Maybe certain behaviors should - // require others? - parts.push("-select -single -list -connection"); - } - if (!canInsert) { - parts.push("-insert"); - } - if (!canUpdate) { - parts.push("-update"); - } - if (!canDelete) { - parts.push("-delete"); - } - if (parts.length > 0) { - addBehaviorToTags(resourceOptions.extensions!.tags!, parts.join(" ")); - } + Object.assign(resourceOptions.extensions!, { + canSelect, + canInsert, + canUpdate, + canDelete, + }); }, }, }), + + schema: { + entityBehavior: { + pgCodecAttribute: { + inferred(behavior, [codec, attributeName]) { + const attr = codec.attributes[attributeName]; + const newBehavior = [behavior]; + if (attr.extensions?.canSelect === false) { + // Only remove `select` privileges if at least one sibling attribute has + // a grant - otherwise assume that this is behind a function or + // similar and all attributes are allowed you just can't select + // directly. + const hasSiblingWithSelect = Object.entries(codec.attributes).some( + ([otherAttrName, otherAttr]) => + otherAttrName !== attributeName && + otherAttr.extensions?.canSelect !== false, + ); + if (hasSiblingWithSelect) { + newBehavior.push("-select", "-filterBy", "-orderBy"); + } + } + if (attr.extensions?.canInsert === false) { + newBehavior.push("-insert"); + } + if (attr.extensions?.canUpdate === false) { + newBehavior.push("-update"); + } + return newBehavior; + }, + }, + pgResource: { + inferred(behavior, resource) { + const newBehavior = [behavior]; + const { + canSelect = true, + canInsert = true, + canUpdate = true, + canDelete = true, + canExecute = true, + } = resource.extensions ?? {}; + if (!canExecute) { + newBehavior.push( + "-queryField", + "-mutationField", + "-typeField", + "-orderBy", + "-filterBy", + ); + } + if (!canSelect) { + // TODO: just `-select` should be sufficient, but it's not because we + // don't check it in enough places. Maybe certain behaviors should + // require others? + newBehavior.push("-select", "-single", "-list", "-connection"); + } + if (!canInsert) { + newBehavior.push("-insert"); + } + if (!canUpdate) { + newBehavior.push("-update"); + } + if (!canDelete) { + newBehavior.push("-delete"); + } + return newBehavior; + }, + }, + }, + }, }; diff --git a/graphile-build/graphile-build-pg/src/plugins/PgRemoveExtensionResourcesPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgRemoveExtensionResourcesPlugin.ts index 6b1a4e75e2..8054d3f767 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgRemoveExtensionResourcesPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgRemoveExtensionResourcesPlugin.ts @@ -2,7 +2,6 @@ import "graphile-config"; import { gatherConfig } from "graphile-build"; -import { addBehaviorToTags } from "../utils.js"; import { version } from "../version.js"; declare global { diff --git a/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts index 9ecbb906a1..46095a9b99 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgTablesPlugin.ts @@ -15,7 +15,7 @@ import { } from "graphile-build"; import type { PgClass, PgConstraint, PgNamespace } from "pg-introspection"; -import { addBehaviorToTags, exportNameHint } from "../utils.js"; +import { exportNameHint } from "../utils.js"; import { version } from "../version.js"; declare global { @@ -213,6 +213,16 @@ declare global { }): Promise | void; } } + namespace DataplanPg { + interface PgResourceExtensions { + /** Checks capabilities of this resource to see if INSERT is even possible */ + isInsertable?: boolean; + /** Checks capabilities of this resource to see if UPDATE is even possible */ + isUpdatable?: boolean; + /** Checks capabilities of this resource to see if DELETE is even possible */ + isDeletable?: boolean; + } + } } interface State { @@ -451,18 +461,9 @@ export const PgTablesPlugin: GraphileConfig.Plugin = { const { tags, description } = pgClass.getTagsAndDescription(); const mask = pgClass.updatable_mask ?? 2 ** 8 - 1; - const isInsertable = mask & (1 << 3); - const isUpdatable = mask & (1 << 2); - const isDeletable = mask & (1 << 4); - if (!isInsertable) { - addBehaviorToTags(tags, "-insert"); - } - if (!isUpdatable) { - addBehaviorToTags(tags, "-update"); - } - if (!isDeletable) { - addBehaviorToTags(tags, "-delete"); - } + const isInsertable = (mask & (1 << 3)) > 0; + const isUpdatable = (mask & (1 << 2)) > 0; + const isDeletable = (mask & (1 << 4)) > 0; const isVirtual = !["r", "v", "m", "f", "p"].includes( pgClass.relkind, @@ -479,6 +480,9 @@ export const PgTablesPlugin: GraphileConfig.Plugin = { } : null), }, + isInsertable, + isUpdatable, + isDeletable, tags: { ...tags, }, @@ -638,20 +642,24 @@ export const PgTablesPlugin: GraphileConfig.Plugin = { before: ["inferred", "override"], callback(behavior, resource) { const isFunction = !!resource.parameters; + const ext = resource.extensions; const isUnloggedOrTemp = - resource.extensions?.pg?.persistence === "u" || - resource.extensions?.pg?.persistence === "t"; + ext?.pg?.persistence === "u" || ext?.pg?.persistence === "t"; return [ - ...((!isFunction && !isUnloggedOrTemp - ? ["resource:select"] - : []) as GraphileBuild.BehaviorString[]), + ...(ext?.isInsertable === false ? ["-resource:insert"] : []), + ...(ext?.isUpdatable === false ? ["-resource:update"] : []), + ...(ext?.isDeletable === false ? ["-resource:delete"] : []), + ...(!isFunction && !isUnloggedOrTemp ? ["resource:select"] : []), behavior, - ...((isUnloggedOrTemp + ...(isUnloggedOrTemp ? [ - "-resource:select -resource:insert -resource:update -resource:delete", + "-resource:select", + "-resource:insert", + "-resource:update", + "-resource:delete", ] - : []) as GraphileBuild.BehaviorString[]), - ]; + : []), + ] as GraphileBuild.BehaviorString[]; }, }, }, diff --git a/graphile-build/graphile-build-pg/src/utils.ts b/graphile-build/graphile-build-pg/src/utils.ts index 99c317ca70..f0b80f7380 100644 --- a/graphile-build/graphile-build-pg/src/utils.ts +++ b/graphile-build/graphile-build-pg/src/utils.ts @@ -1,5 +1,4 @@ import type { PgCodecRefPath, PgCodecRelation, PgResource } from "@dataplan/pg"; -import type { PgSmartTagsDict } from "pg-introspection"; export function tagToString( str: undefined | null | boolean | string | (string | boolean)[], @@ -10,30 +9,6 @@ export function tagToString( return Array.isArray(str) ? str.join("\n") : str === true ? " " : str; } -export function addBehaviorToTags( - tags: Partial, - behavior: string, - prepend = false, -): void { - if (Array.isArray(tags.behavior)) { - if (prepend) { - tags.behavior = [behavior, ...tags.behavior]; - } else { - tags.behavior = [...tags.behavior, behavior]; - } - } else if (typeof tags.behavior === "string") { - tags.behavior = prepend - ? [behavior, tags.behavior] - : [tags.behavior, behavior]; - } else if (!tags.behavior) { - tags.behavior = [behavior]; - } else { - throw new Error( - `Did not understand tags.behavior - it wasn't an array or a string`, - ); - } -} - enum MODE { EXPECT_ARG = 0, ARG = 1, diff --git a/graphile-build/graphile-build/src/global.ts b/graphile-build/graphile-build/src/global.ts index 24269694b5..3f413da17b 100644 --- a/graphile-build/graphile-build/src/global.ts +++ b/graphile-build/graphile-build/src/global.ts @@ -110,6 +110,7 @@ declare global { } interface BehaviorStrings { + "*": true; // Expand me through declaration merging } diff --git a/postgraphile/postgraphile/src/plugins/PgV4SmartTagsPlugin.ts b/postgraphile/postgraphile/src/plugins/PgV4SmartTagsPlugin.ts index 98d585f7a1..7cf46bdf04 100644 --- a/postgraphile/postgraphile/src/plugins/PgV4SmartTagsPlugin.ts +++ b/postgraphile/postgraphile/src/plugins/PgV4SmartTagsPlugin.ts @@ -1,7 +1,7 @@ import "graphile-config"; import { gatherConfig } from "graphile-build"; -import { addBehaviorToTags } from "graphile-build-pg"; +import type { PgSmartTagsDict } from "graphile-build-pg/pg-introspection"; import { inspect } from "util"; declare global { @@ -282,3 +282,27 @@ function processOmit( addBehaviorToTags(tags, behavior.join(" "), true); } + +function addBehaviorToTags( + tags: Partial, + behavior: string, + prepend = false, +): void { + if (Array.isArray(tags.behavior)) { + if (prepend) { + tags.behavior = [behavior, ...tags.behavior]; + } else { + tags.behavior = [...tags.behavior, behavior]; + } + } else if (typeof tags.behavior === "string") { + tags.behavior = prepend + ? [behavior, tags.behavior] + : [tags.behavior, behavior]; + } else if (!tags.behavior) { + tags.behavior = [behavior]; + } else { + throw new Error( + `Did not understand tags.behavior - it wasn't an array or a string`, + ); + } +} From 2dd58e6c5f57ee64ccbe5f89a36afa89900fda8b Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Thu, 26 Sep 2024 12:29:24 +0100 Subject: [PATCH 29/50] Remove from final place --- .../PgRemoveExtensionResourcesPlugin.ts | 54 +++++++++++++++++-- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/graphile-build/graphile-build-pg/src/plugins/PgRemoveExtensionResourcesPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgRemoveExtensionResourcesPlugin.ts index 8054d3f767..a6d43b74b7 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgRemoveExtensionResourcesPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgRemoveExtensionResourcesPlugin.ts @@ -1,6 +1,7 @@ import "graphile-config"; import { gatherConfig } from "graphile-build"; +import type { PgClass, PgProc } from "graphile-build-pg/pg-introspection"; import { version } from "../version.js"; @@ -14,10 +15,20 @@ declare global { pgRemoveExtensionResources: Record; } } + namespace DataplanPg { + interface PgResourceExtensions { + isFromExtension?: boolean; + } + } } const EMPTY_OBJECT = Object.freeze({}); +interface State { + extensionProcs: PgProc[]; + extensionClasses: PgClass[]; +} + export const PgRemoveExtensionResourcesPlugin: GraphileConfig.Plugin = { name: "PgRemoveExtensionResourcesPlugin", description: @@ -29,8 +40,11 @@ export const PgRemoveExtensionResourcesPlugin: GraphileConfig.Plugin = { initialCache() { return EMPTY_OBJECT; }, - initialState() { - return EMPTY_OBJECT; + initialState(): State { + return { + extensionProcs: [], + extensionClasses: [], + }; }, helpers: {}, hooks: { @@ -59,7 +73,7 @@ export const PgRemoveExtensionResourcesPlugin: GraphileConfig.Plugin = { (p) => p._id === procId, ); if (pgProc) { - addBehaviorToTags(pgProc.getTags(), "-*"); + info.state.extensionProcs.push(pgProc); } // ... break; @@ -70,7 +84,7 @@ export const PgRemoveExtensionResourcesPlugin: GraphileConfig.Plugin = { (p) => p._id === relId, ); if (pgClass) { - addBehaviorToTags(pgClass.getTags(), "-*"); + info.state.extensionClasses.push(pgClass); } // ... break; @@ -82,6 +96,38 @@ export const PgRemoveExtensionResourcesPlugin: GraphileConfig.Plugin = { } } }, + async pgProcedures_PgResourceOptions(info, event) { + if (info.state.extensionProcs.includes(event.pgProc)) { + if (!event.resourceOptions.extensions) { + event.resourceOptions.extensions = Object.create(null); + } + event.resourceOptions.extensions!.isFromExtension = true; + } + }, + async pgTables_PgResourceOptions(info, event) { + if (info.state.extensionClasses.includes(event.pgClass)) { + if (!event.resourceOptions.extensions) { + event.resourceOptions.extensions = Object.create(null); + } + event.resourceOptions.extensions!.isFromExtension = true; + } + }, }, }), + schema: { + entityBehavior: { + pgResource: { + inferred: { + after: ["inferred"], + provides: ["postInferred"], + callback(behavior, resource) { + if (resource.extensions?.isFromExtension) { + return [behavior, "-*"]; + } + return behavior; + }, + }, + }, + }, + }, }; From 47fa83732115e68a1c532ecf7a17ae73bc0e1ed3 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Thu, 26 Sep 2024 13:02:48 +0100 Subject: [PATCH 30/50] Must not init build inside createBuild; messes with debug tools --- .../graphile-build/src/SchemaBuilder.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/graphile-build/graphile-build/src/SchemaBuilder.ts b/graphile-build/graphile-build/src/SchemaBuilder.ts index 4fce960772..f5510cbfad 100644 --- a/graphile-build/graphile-build/src/SchemaBuilder.ts +++ b/graphile-build/graphile-build/src/SchemaBuilder.ts @@ -234,13 +234,20 @@ class SchemaBuilder< finalBuild.behavior.freeze(); finalBuild.status.isBuildPhaseComplete = true; + return finalBuild; + } + + initBuild(build: TBuild) { + if (build.status.isInitPhaseComplete) { + return build; + } const initContext: GraphileBuild.ContextInit = { scope: Object.create(null), type: "init", }; - this.applyHooks("init", INIT_OBJECT, finalBuild, initContext); - finalBuild.status.isInitPhaseComplete = true; - return finalBuild; + this.applyHooks("init", INIT_OBJECT, build, initContext); + build.status.isInitPhaseComplete = true; + return build; } /** @@ -248,7 +255,7 @@ class SchemaBuilder< * schema synchronously. */ buildSchema(input: GraphileBuild.BuildInput): GraphQLSchema { - const build = this.createBuild(input); + const build = this.initBuild(this.createBuild(input)); const schemaSpec: Partial = { directives: [...build.graphql.specifiedDirectives], }; From 6a3a5206f890206967b3b7ece1dd670756858e75 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Thu, 26 Sep 2024 14:28:24 +0100 Subject: [PATCH 31/50] @enum should disable the codec too --- .../src/plugins/PgEnumTablesPlugin.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/graphile-build/graphile-build-pg/src/plugins/PgEnumTablesPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgEnumTablesPlugin.ts index bb4bc0a179..28507256db 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgEnumTablesPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgEnumTablesPlugin.ts @@ -394,6 +394,20 @@ Original error: ${e.message} }), schema: { entityBehavior: { + pgCodec: { + inferred: { + // We want to turn off all inferred behaviors on enum tables + after: ["inferred"], + provides: ["postInferred"], + callback(behavior, codec) { + const e = codec.extensions?.tags?.enum; + if (e === true || typeof e === "string") { + return [behavior, "-*"]; + } + return behavior; + }, + }, + }, pgResource: { inferred: { // We want to turn off all inferred behaviors on enum tables From 96aa4378c57ecfa360783a0491abf8f6a2ac423b Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Thu, 26 Sep 2024 15:24:26 +0100 Subject: [PATCH 32/50] Remove more smart tag shenanigans --- .../src/plugins/PgRBACPlugin.ts | 175 +++++++++++------- .../src/plugins/PgV4BehaviorPlugin.ts | 100 +++++----- 2 files changed, 163 insertions(+), 112 deletions(-) diff --git a/graphile-build/graphile-build-pg/src/plugins/PgRBACPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgRBACPlugin.ts index 3506fbca37..ef0d74e9ec 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgRBACPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgRBACPlugin.ts @@ -1,5 +1,6 @@ import "graphile-config"; +import type { PgResource } from "@dataplan/pg"; import { gatherConfig } from "graphile-build"; import { entityPermissions } from "pg-introspection"; @@ -114,7 +115,7 @@ export const PgRBACPlugin: GraphileConfig.Plugin = { ); resourceOptions.extensions = resourceOptions.extensions || Object.create(null); - resourceOptions.extensions!.canExecute = permissions.execute ?? true; + resourceOptions.extensions!.canExecute = permissions.execute ?? false; }, async pgTables_PgResourceOptions(info, event) { const { pgClass, resourceOptions, serviceName } = event; @@ -138,10 +139,10 @@ export const PgRBACPlugin: GraphileConfig.Plugin = { true, ); - let canSelect = tablePermissions.select; - let canInsert = tablePermissions.insert; - let canUpdate = tablePermissions.update; - const canDelete = tablePermissions.delete; + let canSelect = tablePermissions.select ?? false; + let canInsert = tablePermissions.insert ?? false; + let canUpdate = tablePermissions.update ?? false; + const canDelete = tablePermissions.delete ?? false; if (!canInsert || !canUpdate || !canSelect) { // PERF: this is computationally expensive; we should really make this more efficient. // Need to check the attributes @@ -152,9 +153,9 @@ export const PgRBACPlugin: GraphileConfig.Plugin = { entityPermissions(introspection, att, introspectionRole, true), ); for (const attributePermission of attributePermissions) { - canSelect = canSelect || attributePermission.select; - canInsert = canInsert || attributePermission.insert; - canUpdate = canUpdate || attributePermission.update; + canSelect = canSelect || (attributePermission.select ?? false); + canInsert = canInsert || (attributePermission.insert ?? false); + canUpdate = canUpdate || (attributePermission.update ?? false); } } Object.assign(resourceOptions.extensions!, { @@ -170,69 +171,113 @@ export const PgRBACPlugin: GraphileConfig.Plugin = { schema: { entityBehavior: { pgCodecAttribute: { - inferred(behavior, [codec, attributeName]) { - const attr = codec.attributes[attributeName]; - const newBehavior = [behavior]; - if (attr.extensions?.canSelect === false) { - // Only remove `select` privileges if at least one sibling attribute has - // a grant - otherwise assume that this is behind a function or - // similar and all attributes are allowed you just can't select - // directly. - const hasSiblingWithSelect = Object.entries(codec.attributes).some( - ([otherAttrName, otherAttr]) => - otherAttrName !== attributeName && - otherAttr.extensions?.canSelect !== false, - ); - if (hasSiblingWithSelect) { - newBehavior.push("-select", "-filterBy", "-orderBy"); + inferred: { + after: ["inferred"], + provides: ["postInferred"], + callback(behavior, [codec, attributeName]) { + const attr = codec.attributes[attributeName]; + const newBehavior = [behavior]; + if (attr.extensions?.canSelect === false) { + // Only remove `select` privileges if at least one sibling attribute has + // a grant - otherwise assume that this is behind a function or + // similar and all attributes are allowed you just can't select + // directly. + const hasSiblingWithSelect = Object.entries( + codec.attributes, + ).some( + ([otherAttrName, otherAttr]) => + otherAttrName !== attributeName && + otherAttr.extensions?.canSelect !== false, + ); + if (hasSiblingWithSelect) { + newBehavior.push("-select", "-filterBy", "-orderBy"); + } } - } - if (attr.extensions?.canInsert === false) { - newBehavior.push("-insert"); - } - if (attr.extensions?.canUpdate === false) { - newBehavior.push("-update"); - } - return newBehavior; + if (attr.extensions?.canInsert === false) { + newBehavior.push("-insert"); + } + if (attr.extensions?.canUpdate === false) { + newBehavior.push("-update"); + } + return newBehavior; + }, + }, + }, + pgCodecRelation: { + inferred: { + after: ["inferred"], + provides: ["postInferred"], + callback(behavior, relation) { + const resource = relation.remoteResource; + return modBehaviorForResource(behavior, resource); + }, }, }, pgResource: { - inferred(behavior, resource) { - const newBehavior = [behavior]; - const { - canSelect = true, - canInsert = true, - canUpdate = true, - canDelete = true, - canExecute = true, - } = resource.extensions ?? {}; - if (!canExecute) { - newBehavior.push( - "-queryField", - "-mutationField", - "-typeField", - "-orderBy", - "-filterBy", - ); - } - if (!canSelect) { - // TODO: just `-select` should be sufficient, but it's not because we - // don't check it in enough places. Maybe certain behaviors should - // require others? - newBehavior.push("-select", "-single", "-list", "-connection"); - } - if (!canInsert) { - newBehavior.push("-insert"); - } - if (!canUpdate) { - newBehavior.push("-update"); - } - if (!canDelete) { - newBehavior.push("-delete"); - } - return newBehavior; + inferred: { + after: ["inferred"], + provides: ["postInferred"], + callback(behavior, resource) { + return modBehaviorForResource(behavior, resource); + }, + }, + }, + pgResourceUnique: { + inferred: { + after: ["inferred"], + provides: ["postInferred"], + callback(behavior, [resource, _unique]) { + return modBehaviorForResource(behavior, resource); + }, }, }, }, }, }; + +function modBehaviorForResource( + behavior: GraphileBuild.BehaviorString, + resource: PgResource, +): GraphileBuild.BehaviorString[] { + const newBehavior = [behavior]; + const { + canSelect = true, + canInsert = true, + canUpdate = true, + canDelete = true, + canExecute = true, + } = resource.extensions ?? {}; + if (!canExecute) { + newBehavior.push( + "-queryField", + "-mutationField", + "-typeField", + "-orderBy", + "-filterBy", + ); + } + if (!canSelect) { + // TODO: just `-select` should be sufficient, but it's not because we + // don't check it in enough places. Maybe certain behaviors should + // require others? + newBehavior.push( + "-select", + "-single", + "-list", + "-connection", + "-typeField", + "-queryField", + "-mutationField", + ); + } + if (!canInsert) { + newBehavior.push("-insert"); + } + if (!canUpdate) { + newBehavior.push("-update"); + } + if (!canDelete) { + newBehavior.push("-delete"); + } + return newBehavior; +} diff --git a/postgraphile/postgraphile/src/plugins/PgV4BehaviorPlugin.ts b/postgraphile/postgraphile/src/plugins/PgV4BehaviorPlugin.ts index cd934e0393..7434718f5a 100644 --- a/postgraphile/postgraphile/src/plugins/PgV4BehaviorPlugin.ts +++ b/postgraphile/postgraphile/src/plugins/PgV4BehaviorPlugin.ts @@ -1,7 +1,7 @@ import "graphile-config"; import "graphile-build-pg"; -import type { PgResourceOptions } from "@dataplan/pg"; +import type { PgResource, PgResourceOptions } from "@dataplan/pg"; import type { PgProc } from "graphile-build-pg/pg-introspection"; import { inspect } from "util"; @@ -17,7 +17,25 @@ declare global { } } -const v4ComputedAttributeChecks = ( +const v4ComputedAttributeChecks = (s: PgResource): boolean => { + const firstArg = s.parameters![0]; + + // Has to be in same schema + if ( + firstArg.codec.extensions?.pg?.schemaName === s.extensions?.pg?.schemaName + ) { + return false; + } + + // Has to start with the name prefix + if (!firstArg.name?.startsWith(firstArg.codec.extensions?.pg?.name + "_")) { + return false; + } + + return true; +}; + +const v4ComputedAttributeChecks_ = ( _s: PgResourceOptions, pgProc: PgProc, ): boolean => { @@ -43,52 +61,40 @@ export const PgV4BehaviorPlugin: GraphileConfig.Plugin = { "For compatibility with PostGraphile v4 schemas, this plugin updates the default behaviors of certain things.", version: "0.0.0", - gather: { - hooks: { - pgProcedures_PgResourceOptions(info, event) { - const { resourceOptions: s } = event; - // Apply default behavior - const behavior = []; - const firstParameter = s.parameters![0]; - if (s.isMutation && s.parameters) { - behavior.push("-queryField mutationField -typeField"); - } else if ( - s.parameters && - s.parameters?.[0]?.codec?.attributes && - !s.isMutation && - v4ComputedAttributeChecks(s, event.pgProc) - ) { - behavior.push("-queryField -mutationField typeField"); - } else if ( - !s.isMutation && - s.parameters && - // Don't default to this being a queryField if it looks like a computed attribute function - (!firstParameter?.codec?.attributes || - firstParameter?.codec?.extensions?.isTableLike === false) - ) { - behavior.push("queryField -mutationField -typeField"); - } else { - behavior.push("-queryField -mutationField -typeField"); - } + schema: { + entityBehavior: { + pgResource: { + inferred(behavior, resource) { + if (!resource.parameters) { + return behavior; + } + const newBehavior = [behavior]; + const s = resource; + // Apply default behavior + const firstParameter = s.parameters[0]; + if (s.isMutation && s.parameters) { + newBehavior.push("-queryField", "mutationField", "-typeField"); + } else if ( + s.parameters && + s.parameters?.[0]?.codec?.attributes && + !s.isMutation && + v4ComputedAttributeChecks(s) + ) { + newBehavior.push("-queryField", "-mutationField", "typeField"); + } else if ( + !s.isMutation && + s.parameters && + // Don't default to this being a queryField if it looks like a computed attribute function + (!firstParameter?.codec?.attributes || + firstParameter?.codec?.extensions?.isTableLike === false) + ) { + newBehavior.push("queryField", "-mutationField", "-typeField"); + } else { + newBehavior.push("-queryField", "-mutationField", "-typeField"); + } - if (!s.extensions) { - s.extensions = Object.create(null); - } - if (!s.extensions!.tags) { - s.extensions!.tags = Object.create(null); - } - const b = s.extensions!.tags!.behavior; - if (!b) { - s.extensions!.tags!.behavior = behavior; - } else if (typeof b === "string") { - s.extensions!.tags!.behavior = [...behavior, b]; - } else if (Array.isArray(b)) { - s.extensions!.tags!.behavior = [...behavior, ...b]; - } else { - throw new Error( - `${s}.extensions.tags.behavior has unknown shape '${inspect(b)}'`, - ); - } + return newBehavior; + }, }, }, }, From 99e49038c85cda63310d8b9a5755ef39aa81df43 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Thu, 26 Sep 2024 16:12:17 +0100 Subject: [PATCH 33/50] Fix bug in V4 behavior plugin --- .../postgraphile/src/plugins/PgV4BehaviorPlugin.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/postgraphile/postgraphile/src/plugins/PgV4BehaviorPlugin.ts b/postgraphile/postgraphile/src/plugins/PgV4BehaviorPlugin.ts index 7434718f5a..4555b58313 100644 --- a/postgraphile/postgraphile/src/plugins/PgV4BehaviorPlugin.ts +++ b/postgraphile/postgraphile/src/plugins/PgV4BehaviorPlugin.ts @@ -22,13 +22,17 @@ const v4ComputedAttributeChecks = (s: PgResource): boolean => { // Has to be in same schema if ( - firstArg.codec.extensions?.pg?.schemaName === s.extensions?.pg?.schemaName + firstArg.codec.extensions?.pg?.schemaName !== s.extensions?.pg?.schemaName ) { return false; } // Has to start with the name prefix - if (!firstArg.name?.startsWith(firstArg.codec.extensions?.pg?.name + "_")) { + if ( + !s.extensions?.pg?.name?.startsWith( + firstArg.codec.extensions?.pg?.name + "_", + ) + ) { return false; } From ce6efaa7692e12fbf8dfe06e6718e2ba819ec7fa Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Thu, 26 Sep 2024 16:40:35 +0100 Subject: [PATCH 34/50] Reflect new non-behavior-modding approach in schema exports --- .../schema/v4/defaultOptions.1.export.mjs | 610 ++-- .../defaultOptions.inheritence.1.export.mjs | 9 + .../defaultOptions.nested_arrays.1.export.mjs | 7 +- .../defaultOptions.subscriptions.1.export.mjs | 610 ++-- .../schema/v4/enum_tables.1.export.mjs | 55 +- .../foreignKey-smart-tag-autofix.1.export.mjs | 317 +-- .../v4/foreignKey-smart-tag-good.1.export.mjs | 317 +-- ...ash-with-tags-file-workaround.1.export.mjs | 614 ++--- .../schema/v4/function-clash.1.export.mjs | 614 ++--- .../__tests__/schema/v4/geometry.1.export.mjs | 3 + .../__tests__/schema/v4/indexes.1.export.mjs | 1283 ++++----- .../v4/indexes.index_expressions.1.export.mjs | 3 + .../schema/v4/inflect-core.1.export.mjs | 610 ++-- .../schema/v4/js-reserved.1.export.mjs | 55 +- .../__tests__/schema/v4/jwt.1.export.mjs | 103 +- .../schema/v4/network_types.1.export.mjs | 3 + .../v4/network_types.custom.1.export.mjs | 3 + .../schema/v4/noDefaultMutations.1.export.mjs | 317 +-- .../schema/v4/omit-rename.1.export.mjs | 49 +- .../v4/omit-rename.omitcolumns.1.export.mjs | 49 +- ...it-rename.omitcolumns.execute.1.export.mjs | 49 +- ...ename.omitcolumns.loads-title.1.export.mjs | 49 +- ...tcolumns.shows-title-asterisk.1.export.mjs | 49 +- ...ename.omitcolumns.title-order.1.export.mjs | 49 +- ...name.omitcolumns.update-title.1.export.mjs | 49 +- .../v4/omit-rename.omitstuff.1.export.mjs | 49 +- ...-rename.omitstuff.constraints.1.export.mjs | 49 +- ...name.omitstuff.films-asterisk.1.export.mjs | 49 +- ...rename.omitstuff.films-create.1.export.mjs | 49 +- ...rename.omitstuff.films-delete.1.export.mjs | 49 +- ...-rename.omitstuff.films-loads.1.export.mjs | 49 +- ...rename.omitstuff.films-update.1.export.mjs | 49 +- ...-rename.omitstuff.shows-order.1.export.mjs | 49 +- .../schema/v4/partitions.1.export.mjs | 6 + .../__tests__/schema/v4/pg11.1.export.mjs | 18 +- .../schema/v4/pg11.custom.1.export.mjs | 18 +- .../schema/v4/polymorphic.1.export.mjs | 79 +- .../__tests__/schema/v4/rbac.1.export.mjs | 2443 +++++++++-------- .../schema/v4/rbac.ignore.1.export.mjs | 610 ++-- .../__tests__/schema/v4/refs.1.export.mjs | 6 + .../__tests__/schema/v4/relay.1.export.mjs | 49 +- .../__tests__/schema/v4/relay1.1.export.mjs | 317 +-- .../schema/v4/simple-collections.1.export.mjs | 317 +-- ...-collections.omit-pets-simple.1.export.mjs | 8 +- ...-collections.only-people-omit.1.export.mjs | 10 +- .../v4/simple-collections.only.1.export.mjs | 317 +-- ...imple-collections.pets-simple.1.export.mjs | 10 +- .../schema/v4/simplePrint.export.mjs | 610 ++-- .../schema/v4/skipNodePlugin.1.export.mjs | 610 ++-- .../skipNodePlugin.polymorphic.1.export.mjs | 79 +- .../v4/smart_comment_relations.1.export.mjs | 30 +- .../smart_comment_relations.post.1.export.mjs | 30 +- ...t_comment_relations.post_view.1.export.mjs | 30 +- ...ent_relations.post_view_no_pk.1.export.mjs | 30 +- ...nt_relations.view_fake_unique.1.export.mjs | 30 +- ...relations.view_fake_unique_pk.1.export.mjs | 30 +- .../schema/v5/skipNodePlugin.1.export.mjs | 618 ++--- .../skipNodePlugin.polymorphic.1.export.mjs | 79 +- 58 files changed, 5632 insertions(+), 7020 deletions(-) diff --git a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.1.export.mjs index 43fe7e8a97..87880572e4 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.1.export.mjs @@ -3169,6 +3169,9 @@ const registryConfig_pgResources_foreign_key_foreign_key = { schemaName: "a", name: "foreign_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3195,6 +3198,9 @@ const registryConfig_pgResources_unique_foreign_key_unique_foreign_key = { schemaName: "a", name: "unique_foreign_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "create,update,delete,all,order,filter", behavior: spec_uniqueForeignKey.extensions.tags.behavior @@ -3233,6 +3239,9 @@ const registryConfig_pgResources_person_secret_person_secret = { schemaName: "c", name: "person_secret" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { deprecated: "This is deprecated (comment on table c.person_secret)." } @@ -3270,6 +3279,9 @@ const registryConfig_pgResources_compound_key_compound_key = { schemaName: "c", name: "compound_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3331,6 +3343,9 @@ const registryConfig_pgResources_left_arm_left_arm = { schemaName: "c", name: "left_arm" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3351,9 +3366,10 @@ const resourceConfig_jwt_token = { schemaName: "b", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const authenticateFunctionIdentifer = sql.identifier("b", "authenticate"); @@ -3381,6 +3397,9 @@ const registryConfig_pgResources_issue756_issue756 = { schemaName: "c", name: "issue756" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3427,6 +3446,9 @@ const registryConfig_pgResources_post_post = { schemaName: "a", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3447,9 +3469,10 @@ const resourceConfig_compound_type = { schemaName: "c", name: "compound_type" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const compound_type_mutationFunctionIdentifer = sql.identifier("b", "compound_type_mutation"); @@ -3508,6 +3531,9 @@ const registryConfig_pgResources_person_person = { schemaName: "c", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3545,6 +3571,9 @@ const registryConfig_pgResources_types_types = { schemaName: "b", name: "types" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { foreignKey: spec_types.extensions.tags.foreignKey } @@ -3898,9 +3927,7 @@ const registry = makeRegistry({ schemaName: "c", name: "current_user_id" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3922,9 +3949,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3947,9 +3972,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3972,9 +3995,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3996,9 +4017,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4021,9 +4040,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4046,9 +4063,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4070,9 +4085,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4094,9 +4107,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4118,9 +4129,7 @@ const registry = makeRegistry({ schemaName: "a", name: "return_void_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4142,9 +4151,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_set" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4166,9 +4173,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_set" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4190,9 +4195,7 @@ const registry = makeRegistry({ schemaName: "a", name: "static_big_integer" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4219,9 +4222,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4249,9 +4250,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_one_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -4279,9 +4278,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4309,9 +4306,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_one_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -4339,9 +4334,7 @@ const registry = makeRegistry({ schemaName: "a", name: "assert_something" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4370,7 +4363,7 @@ const registry = makeRegistry({ }, tags: { omit: "execute", - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField"] + behavior: ["-queryField -mutationField -typeField"] } }, description: undefined @@ -4398,9 +4391,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4427,9 +4418,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4456,9 +4445,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4485,9 +4472,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4514,9 +4499,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4543,9 +4526,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql_with_default" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4577,9 +4558,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 1 mutation" }, @@ -4611,9 +4590,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 1 query" }, @@ -4645,9 +4622,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 2 mutation" }, @@ -4679,9 +4654,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 2 query" }, @@ -4713,9 +4686,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 3 mutation" }, @@ -4747,9 +4718,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 3 query" }, @@ -4781,9 +4750,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 4 mutation" }, @@ -4815,9 +4782,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation_error" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4849,9 +4814,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 4 query" }, @@ -4883,9 +4846,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_1" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4917,9 +4878,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_2" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4951,9 +4910,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_3" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4985,9 +4942,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_4" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5019,9 +4974,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_inout" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -5044,9 +4997,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5068,9 +5019,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5092,9 +5041,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5126,9 +5073,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_inout" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -5151,9 +5096,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5175,9 +5118,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5199,9 +5140,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5225,7 +5164,7 @@ const registry = makeRegistry({ }, tags: { simpleCollections: "only", - behavior: ["queryField -mutationField -typeField", "-filter -order", "+list -connection"] + behavior: ["+list -connection"] } }, description: undefined @@ -5263,9 +5202,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_1" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5302,9 +5239,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_2" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5341,9 +5276,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_3" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5380,9 +5313,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_4" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5419,9 +5350,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_5" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5443,9 +5372,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5472,9 +5399,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_multi_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5511,9 +5436,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5550,9 +5473,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5574,9 +5495,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5603,9 +5522,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_multi_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5632,9 +5549,7 @@ const registry = makeRegistry({ schemaName: "b", name: "guid_fn" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5656,9 +5571,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5680,9 +5593,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5704,9 +5615,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_text_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5728,9 +5637,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_text_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5750,9 +5657,10 @@ const registry = makeRegistry({ schemaName: "a", name: "non_updatable_view" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, inputs: { @@ -5771,6 +5679,9 @@ const registry = makeRegistry({ schemaName: "a", name: "inputs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5790,6 +5701,9 @@ const registry = makeRegistry({ schemaName: "a", name: "patchs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5809,6 +5723,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5828,6 +5745,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reservedPatchs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5847,6 +5767,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved_input" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5866,6 +5789,9 @@ const registry = makeRegistry({ schemaName: "a", name: "default_value" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5893,6 +5819,9 @@ const registry = makeRegistry({ schemaName: "a", name: "no_primary_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5912,6 +5841,9 @@ const registry = makeRegistry({ schemaName: "a", name: "testview" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5932,6 +5864,9 @@ const registry = makeRegistry({ schemaName: "c", name: "my_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5960,6 +5895,9 @@ const registry = makeRegistry({ name: "unlogged", persistence: "u" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5979,6 +5917,9 @@ const registry = makeRegistry({ schemaName: "a", name: "view_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5999,6 +5940,9 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_1" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6018,6 +5962,9 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_2" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6046,6 +5993,9 @@ const registry = makeRegistry({ schemaName: "b", name: "updatable_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { uniqueKey: "x", unique: "x|@behavior -single -update -delete" @@ -6068,6 +6018,9 @@ const registry = makeRegistry({ schemaName: "c", name: "null_test_record" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6094,9 +6047,7 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case_computed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6116,9 +6067,7 @@ const registry = makeRegistry({ schemaName: "c", name: "return_table_without_grants" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6155,9 +6104,7 @@ const registry = makeRegistry({ schemaName: "b", name: "list_bde_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6177,6 +6124,9 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6197,9 +6147,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_fail" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6234,9 +6182,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6267,8 +6213,7 @@ const registry = makeRegistry({ }, tags: { arg0variant: "base", - resultFieldName: "leftArm", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "leftArm" } }, description: undefined @@ -6289,9 +6234,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6311,9 +6254,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6348,9 +6289,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_many" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6370,9 +6309,11 @@ const registry = makeRegistry({ schemaName: "b", name: "auth_payload" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - foreignKey: "(id) references c.person", - behavior: ["-insert", "-update", "-delete"] + foreignKey: "(id) references c.person" } } }, { @@ -6406,9 +6347,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_payload" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6460,9 +6399,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6514,9 +6451,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6543,9 +6478,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_computed_field" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6572,9 +6505,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_set" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6601,9 +6532,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6630,9 +6559,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_text_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6667,7 +6594,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -6703,7 +6630,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -6731,9 +6658,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_compound_type" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6760,9 +6685,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_compound_type" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6799,9 +6722,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6838,9 +6759,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_no_defaults" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6877,9 +6796,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_strict" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6916,9 +6833,7 @@ const registry = makeRegistry({ schemaName: "c", name: "query_output_two_rows" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6939,9 +6854,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6966,9 +6879,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6993,9 +6904,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7020,9 +6929,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7047,9 +6954,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7074,9 +6979,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7107,8 +7010,7 @@ const registry = makeRegistry({ name: "post_with_suffix" }, tags: { - deprecated: "This is deprecated (comment on function a.post_with_suffix).", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function a.post_with_suffix)." } }, description: undefined @@ -7134,9 +7036,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_compound_type_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7161,9 +7061,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_compound_type_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7188,9 +7086,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7215,9 +7111,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7247,9 +7141,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_compound_type_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7274,9 +7166,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_many" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7307,7 +7197,7 @@ const registry = makeRegistry({ notNull: true, sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] }, singleOutputParameterName: "o1" }, @@ -7338,7 +7228,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: "The first name of the person." @@ -7366,9 +7256,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_out_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7400,9 +7288,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -7435,9 +7321,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7470,8 +7354,7 @@ const registry = makeRegistry({ name: "person_exists" }, tags: { - deprecated: "This is deprecated (comment on function c.person_exists).", - behavior: ["-queryField -mutationField typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.person_exists)." } }, description: undefined @@ -7499,9 +7382,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7533,9 +7414,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7567,9 +7446,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7601,9 +7478,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7635,9 +7510,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7674,9 +7547,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_complex" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7701,9 +7572,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_first_post" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: "The first post by the person." }), @@ -7725,8 +7594,7 @@ const registry = makeRegistry({ name: "badly_behaved_function" }, tags: { - deprecated: "This is deprecated (comment on function c.badly_behaved_function).", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.badly_behaved_function)." } }, description: undefined @@ -7747,9 +7615,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7769,9 +7635,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7791,9 +7655,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7813,9 +7675,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7835,9 +7695,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7860,7 +7718,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["queryField -mutationField -typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -7881,9 +7739,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_query_plpgsql" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7908,9 +7764,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "person" }, description: undefined @@ -7938,7 +7792,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: undefined @@ -7960,9 +7814,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7982,9 +7834,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8009,9 +7859,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8036,9 +7884,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8063,9 +7909,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_connection" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8095,9 +7939,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8117,9 +7959,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8139,9 +7979,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8166,9 +8004,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_list" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }) diff --git a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.inheritence.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.inheritence.1.export.mjs index 70fc97c61b..a485fbe775 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.inheritence.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.inheritence.1.export.mjs @@ -227,6 +227,9 @@ const registryConfig_pgResources_user_user = { schemaName: "inheritence", name: "user" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -254,6 +257,9 @@ const registryConfig_pgResources_user_file_user_file = { schemaName: "inheritence", name: "user_file" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -287,6 +293,9 @@ const registry = makeRegistry({ schemaName: "inheritence", name: "file" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.nested_arrays.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.nested_arrays.1.export.mjs index 692808cf9e..0e0888c507 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.nested_arrays.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.nested_arrays.1.export.mjs @@ -279,9 +279,7 @@ const registry = makeRegistry({ schemaName: "nested_arrays", name: "check_work_hours" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -301,6 +299,9 @@ const registry = makeRegistry({ schemaName: "nested_arrays", name: "t" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } } 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 43fe7e8a97..87880572e4 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.subscriptions.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.subscriptions.1.export.mjs @@ -3169,6 +3169,9 @@ const registryConfig_pgResources_foreign_key_foreign_key = { schemaName: "a", name: "foreign_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3195,6 +3198,9 @@ const registryConfig_pgResources_unique_foreign_key_unique_foreign_key = { schemaName: "a", name: "unique_foreign_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "create,update,delete,all,order,filter", behavior: spec_uniqueForeignKey.extensions.tags.behavior @@ -3233,6 +3239,9 @@ const registryConfig_pgResources_person_secret_person_secret = { schemaName: "c", name: "person_secret" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { deprecated: "This is deprecated (comment on table c.person_secret)." } @@ -3270,6 +3279,9 @@ const registryConfig_pgResources_compound_key_compound_key = { schemaName: "c", name: "compound_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3331,6 +3343,9 @@ const registryConfig_pgResources_left_arm_left_arm = { schemaName: "c", name: "left_arm" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3351,9 +3366,10 @@ const resourceConfig_jwt_token = { schemaName: "b", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const authenticateFunctionIdentifer = sql.identifier("b", "authenticate"); @@ -3381,6 +3397,9 @@ const registryConfig_pgResources_issue756_issue756 = { schemaName: "c", name: "issue756" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3427,6 +3446,9 @@ const registryConfig_pgResources_post_post = { schemaName: "a", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3447,9 +3469,10 @@ const resourceConfig_compound_type = { schemaName: "c", name: "compound_type" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const compound_type_mutationFunctionIdentifer = sql.identifier("b", "compound_type_mutation"); @@ -3508,6 +3531,9 @@ const registryConfig_pgResources_person_person = { schemaName: "c", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3545,6 +3571,9 @@ const registryConfig_pgResources_types_types = { schemaName: "b", name: "types" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { foreignKey: spec_types.extensions.tags.foreignKey } @@ -3898,9 +3927,7 @@ const registry = makeRegistry({ schemaName: "c", name: "current_user_id" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3922,9 +3949,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3947,9 +3972,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3972,9 +3995,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3996,9 +4017,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4021,9 +4040,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4046,9 +4063,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4070,9 +4085,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4094,9 +4107,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4118,9 +4129,7 @@ const registry = makeRegistry({ schemaName: "a", name: "return_void_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4142,9 +4151,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_set" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4166,9 +4173,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_set" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4190,9 +4195,7 @@ const registry = makeRegistry({ schemaName: "a", name: "static_big_integer" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4219,9 +4222,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4249,9 +4250,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_one_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -4279,9 +4278,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4309,9 +4306,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_one_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -4339,9 +4334,7 @@ const registry = makeRegistry({ schemaName: "a", name: "assert_something" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4370,7 +4363,7 @@ const registry = makeRegistry({ }, tags: { omit: "execute", - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField"] + behavior: ["-queryField -mutationField -typeField"] } }, description: undefined @@ -4398,9 +4391,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4427,9 +4418,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4456,9 +4445,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4485,9 +4472,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4514,9 +4499,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4543,9 +4526,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql_with_default" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4577,9 +4558,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 1 mutation" }, @@ -4611,9 +4590,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 1 query" }, @@ -4645,9 +4622,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 2 mutation" }, @@ -4679,9 +4654,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 2 query" }, @@ -4713,9 +4686,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 3 mutation" }, @@ -4747,9 +4718,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 3 query" }, @@ -4781,9 +4750,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 4 mutation" }, @@ -4815,9 +4782,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation_error" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4849,9 +4814,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 4 query" }, @@ -4883,9 +4846,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_1" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4917,9 +4878,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_2" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4951,9 +4910,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_3" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4985,9 +4942,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_4" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5019,9 +4974,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_inout" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -5044,9 +4997,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5068,9 +5019,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5092,9 +5041,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5126,9 +5073,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_inout" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -5151,9 +5096,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5175,9 +5118,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5199,9 +5140,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5225,7 +5164,7 @@ const registry = makeRegistry({ }, tags: { simpleCollections: "only", - behavior: ["queryField -mutationField -typeField", "-filter -order", "+list -connection"] + behavior: ["+list -connection"] } }, description: undefined @@ -5263,9 +5202,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_1" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5302,9 +5239,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_2" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5341,9 +5276,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_3" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5380,9 +5313,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_4" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5419,9 +5350,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_5" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5443,9 +5372,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5472,9 +5399,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_multi_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5511,9 +5436,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5550,9 +5473,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5574,9 +5495,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5603,9 +5522,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_multi_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5632,9 +5549,7 @@ const registry = makeRegistry({ schemaName: "b", name: "guid_fn" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5656,9 +5571,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5680,9 +5593,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5704,9 +5615,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_text_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5728,9 +5637,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_text_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5750,9 +5657,10 @@ const registry = makeRegistry({ schemaName: "a", name: "non_updatable_view" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, inputs: { @@ -5771,6 +5679,9 @@ const registry = makeRegistry({ schemaName: "a", name: "inputs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5790,6 +5701,9 @@ const registry = makeRegistry({ schemaName: "a", name: "patchs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5809,6 +5723,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5828,6 +5745,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reservedPatchs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5847,6 +5767,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved_input" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5866,6 +5789,9 @@ const registry = makeRegistry({ schemaName: "a", name: "default_value" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5893,6 +5819,9 @@ const registry = makeRegistry({ schemaName: "a", name: "no_primary_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5912,6 +5841,9 @@ const registry = makeRegistry({ schemaName: "a", name: "testview" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5932,6 +5864,9 @@ const registry = makeRegistry({ schemaName: "c", name: "my_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5960,6 +5895,9 @@ const registry = makeRegistry({ name: "unlogged", persistence: "u" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5979,6 +5917,9 @@ const registry = makeRegistry({ schemaName: "a", name: "view_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5999,6 +5940,9 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_1" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6018,6 +5962,9 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_2" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6046,6 +5993,9 @@ const registry = makeRegistry({ schemaName: "b", name: "updatable_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { uniqueKey: "x", unique: "x|@behavior -single -update -delete" @@ -6068,6 +6018,9 @@ const registry = makeRegistry({ schemaName: "c", name: "null_test_record" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6094,9 +6047,7 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case_computed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6116,9 +6067,7 @@ const registry = makeRegistry({ schemaName: "c", name: "return_table_without_grants" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6155,9 +6104,7 @@ const registry = makeRegistry({ schemaName: "b", name: "list_bde_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6177,6 +6124,9 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6197,9 +6147,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_fail" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6234,9 +6182,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6267,8 +6213,7 @@ const registry = makeRegistry({ }, tags: { arg0variant: "base", - resultFieldName: "leftArm", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "leftArm" } }, description: undefined @@ -6289,9 +6234,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6311,9 +6254,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6348,9 +6289,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_many" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6370,9 +6309,11 @@ const registry = makeRegistry({ schemaName: "b", name: "auth_payload" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - foreignKey: "(id) references c.person", - behavior: ["-insert", "-update", "-delete"] + foreignKey: "(id) references c.person" } } }, { @@ -6406,9 +6347,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_payload" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6460,9 +6399,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6514,9 +6451,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6543,9 +6478,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_computed_field" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6572,9 +6505,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_set" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6601,9 +6532,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6630,9 +6559,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_text_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6667,7 +6594,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -6703,7 +6630,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -6731,9 +6658,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_compound_type" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6760,9 +6685,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_compound_type" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6799,9 +6722,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6838,9 +6759,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_no_defaults" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6877,9 +6796,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_strict" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6916,9 +6833,7 @@ const registry = makeRegistry({ schemaName: "c", name: "query_output_two_rows" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6939,9 +6854,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6966,9 +6879,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6993,9 +6904,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7020,9 +6929,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7047,9 +6954,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7074,9 +6979,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7107,8 +7010,7 @@ const registry = makeRegistry({ name: "post_with_suffix" }, tags: { - deprecated: "This is deprecated (comment on function a.post_with_suffix).", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function a.post_with_suffix)." } }, description: undefined @@ -7134,9 +7036,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_compound_type_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7161,9 +7061,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_compound_type_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7188,9 +7086,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7215,9 +7111,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7247,9 +7141,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_compound_type_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7274,9 +7166,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_many" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7307,7 +7197,7 @@ const registry = makeRegistry({ notNull: true, sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] }, singleOutputParameterName: "o1" }, @@ -7338,7 +7228,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: "The first name of the person." @@ -7366,9 +7256,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_out_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7400,9 +7288,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -7435,9 +7321,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7470,8 +7354,7 @@ const registry = makeRegistry({ name: "person_exists" }, tags: { - deprecated: "This is deprecated (comment on function c.person_exists).", - behavior: ["-queryField -mutationField typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.person_exists)." } }, description: undefined @@ -7499,9 +7382,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7533,9 +7414,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7567,9 +7446,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7601,9 +7478,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7635,9 +7510,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7674,9 +7547,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_complex" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7701,9 +7572,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_first_post" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: "The first post by the person." }), @@ -7725,8 +7594,7 @@ const registry = makeRegistry({ name: "badly_behaved_function" }, tags: { - deprecated: "This is deprecated (comment on function c.badly_behaved_function).", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.badly_behaved_function)." } }, description: undefined @@ -7747,9 +7615,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7769,9 +7635,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7791,9 +7655,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7813,9 +7675,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7835,9 +7695,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7860,7 +7718,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["queryField -mutationField -typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -7881,9 +7739,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_query_plpgsql" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7908,9 +7764,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "person" }, description: undefined @@ -7938,7 +7792,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: undefined @@ -7960,9 +7814,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7982,9 +7834,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8009,9 +7859,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8036,9 +7884,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8063,9 +7909,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_connection" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8095,9 +7939,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8117,9 +7959,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8139,9 +7979,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8166,9 +8004,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_list" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }) 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 81caa76395..80a0b6d86f 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/enum_tables.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/enum_tables.1.export.mjs @@ -76,7 +76,7 @@ const executor = new PgExecutor({ } }); const abcdIdentifier = sql.identifier("enum_tables", "abcd"); -const spec_abcd = { +const abcdCodec = recordCodec({ name: "abcd", identifier: abcdIdentifier, attributes: Object.assign(Object.create(null), { @@ -111,15 +111,13 @@ const spec_abcd = { }, tags: Object.assign(Object.create(null), { enum: true, - enumName: "LetterAToD", - behavior: ["-*"] + enumName: "LetterAToD" }) }, executor: executor -}; -const abcdCodec = recordCodec(spec_abcd); +}); const abcdViewIdentifier = sql.identifier("enum_tables", "abcd_view"); -const spec_abcdView = { +const abcdViewCodec = recordCodec({ name: "abcdView", identifier: abcdViewIdentifier, attributes: Object.assign(Object.create(null), { @@ -153,15 +151,13 @@ const spec_abcdView = { tags: Object.assign(Object.create(null), { primaryKey: "letter", enum: true, - enumName: "LetterAToDViaView", - behavior: ["-*"] + enumName: "LetterAToDViaView" }) }, executor: executor -}; -const abcdViewCodec = recordCodec(spec_abcdView); +}); const simpleEnumIdentifier = sql.identifier("enum_tables", "simple_enum"); -const spec_simpleEnum = { +const simpleEnumCodec = recordCodec({ name: "simpleEnum", identifier: simpleEnumIdentifier, attributes: Object.assign(Object.create(null), { @@ -193,13 +189,11 @@ const spec_simpleEnum = { name: "simple_enum" }, tags: Object.assign(Object.create(null), { - enum: true, - behavior: ["-*"] + enum: true }) }, executor: executor -}; -const simpleEnumCodec = recordCodec(spec_simpleEnum); +}); const letterDescriptionsIdentifier = sql.identifier("enum_tables", "letter_descriptions"); const spec_letterDescriptions_attributes_letter_codec_LetterAToDEnum = enumCodec({ name: "LetterAToDEnum", @@ -558,10 +552,12 @@ const registryConfig_pgResources_abcd_abcd = { schemaName: "enum_tables", name: "abcd" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { enum: true, - enumName: "LetterAToD", - behavior: spec_abcd.extensions.tags.behavior + enumName: "LetterAToD" } } }; @@ -588,11 +584,13 @@ const registryConfig_pgResources_abcd_view_abcd_view = { schemaName: "enum_tables", name: "abcd_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { primaryKey: "letter", enum: true, - enumName: "LetterAToDViaView", - behavior: spec_abcdView.extensions.tags.behavior + enumName: "LetterAToDViaView" } } }; @@ -619,9 +617,11 @@ const registryConfig_pgResources_simple_enum_simple_enum = { schemaName: "enum_tables", name: "simple_enum" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { - enum: true, - behavior: spec_simpleEnum.extensions.tags.behavior + enum: true } } }; @@ -664,6 +664,9 @@ const registryConfig_pgResources_letter_descriptions_letter_descriptions = { schemaName: "enum_tables", name: "letter_descriptions" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { foreignKey: "(letter_via_view) references enum_tables.abcd_view" } @@ -693,6 +696,9 @@ const registryConfig_pgResources_referencing_table_referencing_table = { schemaName: "enum_tables", name: "referencing_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -757,6 +763,9 @@ const registryConfig_pgResources_lots_of_enums_lots_of_enums = { schemaName: "enum_tables", name: "lots_of_enums" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: true, behavior: spec_lotsOfEnums.extensions.tags.behavior @@ -812,9 +821,7 @@ const registry = makeRegistry({ schemaName: "enum_tables", name: "referencing_table_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, 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 d1787b8bcd..227b15c151 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 @@ -2369,6 +2369,9 @@ const registryConfig_pgResources_person_secret_person_secret = { schemaName: "c", name: "person_secret" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { foreignKey: "(sekrit) references c.person (about)", deprecated: "This is deprecated (comment on table c.person_secret)." @@ -2399,6 +2402,9 @@ const registryConfig_pgResources_compound_key_compound_key = { schemaName: "c", name: "compound_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2443,6 +2449,9 @@ const registryConfig_pgResources_left_arm_left_arm = { schemaName: "c", name: "left_arm" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2471,6 +2480,9 @@ const registryConfig_pgResources_issue756_issue756 = { schemaName: "c", name: "issue756" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2537,6 +2549,9 @@ const registryConfig_pgResources_person_person = { schemaName: "c", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2687,9 +2702,7 @@ const registry = makeRegistry({ schemaName: "c", name: "current_user_id" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2711,9 +2724,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2736,9 +2747,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2761,9 +2770,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2785,9 +2792,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2810,9 +2815,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2835,9 +2838,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2859,9 +2860,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2883,9 +2882,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2912,9 +2909,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2942,9 +2937,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_one_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -2972,9 +2965,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3002,9 +2993,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_one_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -3032,9 +3021,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3061,9 +3048,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3090,9 +3075,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3119,9 +3102,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3148,9 +3129,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3177,9 +3156,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql_with_default" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3211,9 +3188,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_inout" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -3236,9 +3211,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3260,9 +3233,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3284,9 +3255,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3318,9 +3287,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_inout" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -3343,9 +3310,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3367,9 +3332,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3391,9 +3354,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3415,9 +3376,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3444,9 +3403,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_multi_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3483,9 +3440,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3522,9 +3477,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3546,9 +3499,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3575,9 +3526,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_multi_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3601,7 +3550,7 @@ const registry = makeRegistry({ }, tags: { simpleCollections: "only", - behavior: ["queryField -mutationField -typeField", "-filter -order", "+list -connection"] + behavior: ["+list -connection"] } }, description: undefined @@ -3622,6 +3571,9 @@ const registry = makeRegistry({ schemaName: "c", name: "my_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3650,6 +3602,9 @@ const registry = makeRegistry({ name: "unlogged", persistence: "u" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3670,6 +3625,9 @@ const registry = makeRegistry({ schemaName: "c", name: "null_test_record" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3696,9 +3654,7 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case_computed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3718,9 +3674,7 @@ const registry = makeRegistry({ schemaName: "c", name: "return_table_without_grants" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -3740,6 +3694,9 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3770,8 +3727,7 @@ const registry = makeRegistry({ }, tags: { arg0variant: "base", - resultFieldName: "leftArm", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "leftArm" } }, description: undefined @@ -3793,9 +3749,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -3815,9 +3769,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -3869,9 +3821,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3923,9 +3873,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3952,9 +3900,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_computed_field" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3981,9 +3927,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_compound_type" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4010,9 +3954,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_compound_type" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4049,9 +3991,7 @@ const registry = makeRegistry({ schemaName: "c", name: "query_output_two_rows" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4071,9 +4011,10 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "compound_type_set_query", @@ -4091,9 +4032,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4121,9 +4060,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4151,9 +4088,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4184,7 +4119,7 @@ const registry = makeRegistry({ notNull: true, sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] }, singleOutputParameterName: "o1" }, @@ -4215,7 +4150,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: "The first name of the person." @@ -4243,9 +4178,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_out_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4277,9 +4210,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -4312,9 +4243,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4347,8 +4276,7 @@ const registry = makeRegistry({ name: "person_exists" }, tags: { - deprecated: "This is deprecated (comment on function c.person_exists).", - behavior: ["-queryField -mutationField typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.person_exists)." } }, description: undefined @@ -4376,9 +4304,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4410,9 +4336,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4444,9 +4368,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4478,9 +4400,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4512,9 +4432,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4551,9 +4469,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_complex" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4582,9 +4498,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_first_post" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: "The first post by the person." }), @@ -4605,8 +4519,7 @@ const registry = makeRegistry({ name: "badly_behaved_function" }, tags: { - deprecated: "This is deprecated (comment on function c.badly_behaved_function).", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.badly_behaved_function)." } }, description: undefined @@ -4627,9 +4540,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4649,9 +4560,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4671,9 +4580,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4693,9 +4600,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4715,9 +4620,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4740,7 +4643,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["queryField -mutationField -typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -4761,9 +4664,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_query_plpgsql" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4788,9 +4689,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "person" }, description: undefined @@ -4818,7 +4717,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: undefined @@ -4847,9 +4746,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_connection" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4882,9 +4779,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4912,9 +4807,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_list" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }) 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 8dd2e12a0f..5327d8ce8c 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 @@ -2369,6 +2369,9 @@ const registryConfig_pgResources_person_secret_person_secret = { schemaName: "c", name: "person_secret" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { foreignKey: "(sekrit) references c.person (about)", deprecated: "This is deprecated (comment on table c.person_secret)." @@ -2399,6 +2402,9 @@ const registryConfig_pgResources_compound_key_compound_key = { schemaName: "c", name: "compound_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2443,6 +2449,9 @@ const registryConfig_pgResources_left_arm_left_arm = { schemaName: "c", name: "left_arm" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2471,6 +2480,9 @@ const registryConfig_pgResources_issue756_issue756 = { schemaName: "c", name: "issue756" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2535,6 +2547,9 @@ const registryConfig_pgResources_person_person = { schemaName: "c", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2685,9 +2700,7 @@ const registry = makeRegistry({ schemaName: "c", name: "current_user_id" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2709,9 +2722,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2734,9 +2745,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2759,9 +2768,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2783,9 +2790,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2808,9 +2813,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2833,9 +2836,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2857,9 +2858,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2881,9 +2880,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2910,9 +2907,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2940,9 +2935,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_one_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -2970,9 +2963,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3000,9 +2991,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_one_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -3030,9 +3019,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3059,9 +3046,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3088,9 +3073,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3117,9 +3100,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3146,9 +3127,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3175,9 +3154,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql_with_default" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3209,9 +3186,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_inout" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -3234,9 +3209,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3258,9 +3231,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3282,9 +3253,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3316,9 +3285,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_inout" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -3341,9 +3308,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3365,9 +3330,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3389,9 +3352,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3413,9 +3374,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3442,9 +3401,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_multi_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3481,9 +3438,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3520,9 +3475,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3544,9 +3497,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3573,9 +3524,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_multi_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3599,7 +3548,7 @@ const registry = makeRegistry({ }, tags: { simpleCollections: "only", - behavior: ["queryField -mutationField -typeField", "-filter -order", "+list -connection"] + behavior: ["+list -connection"] } }, description: undefined @@ -3620,6 +3569,9 @@ const registry = makeRegistry({ schemaName: "c", name: "my_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3648,6 +3600,9 @@ const registry = makeRegistry({ name: "unlogged", persistence: "u" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3668,6 +3623,9 @@ const registry = makeRegistry({ schemaName: "c", name: "null_test_record" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3694,9 +3652,7 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case_computed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3716,9 +3672,7 @@ const registry = makeRegistry({ schemaName: "c", name: "return_table_without_grants" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -3738,6 +3692,9 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3768,8 +3725,7 @@ const registry = makeRegistry({ }, tags: { arg0variant: "base", - resultFieldName: "leftArm", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "leftArm" } }, description: undefined @@ -3791,9 +3747,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -3813,9 +3767,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -3867,9 +3819,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3921,9 +3871,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3950,9 +3898,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_computed_field" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3979,9 +3925,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_compound_type" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4008,9 +3952,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_compound_type" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4047,9 +3989,7 @@ const registry = makeRegistry({ schemaName: "c", name: "query_output_two_rows" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4069,9 +4009,10 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "compound_type_set_query", @@ -4089,9 +4030,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4119,9 +4058,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4149,9 +4086,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4182,7 +4117,7 @@ const registry = makeRegistry({ notNull: true, sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] }, singleOutputParameterName: "o1" }, @@ -4213,7 +4148,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: "The first name of the person." @@ -4241,9 +4176,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_out_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4275,9 +4208,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -4310,9 +4241,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4345,8 +4274,7 @@ const registry = makeRegistry({ name: "person_exists" }, tags: { - deprecated: "This is deprecated (comment on function c.person_exists).", - behavior: ["-queryField -mutationField typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.person_exists)." } }, description: undefined @@ -4374,9 +4302,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4408,9 +4334,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4442,9 +4366,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4476,9 +4398,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4510,9 +4430,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4549,9 +4467,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_complex" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4580,9 +4496,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_first_post" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: "The first post by the person." }), @@ -4603,8 +4517,7 @@ const registry = makeRegistry({ name: "badly_behaved_function" }, tags: { - deprecated: "This is deprecated (comment on function c.badly_behaved_function).", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.badly_behaved_function)." } }, description: undefined @@ -4625,9 +4538,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4647,9 +4558,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4669,9 +4578,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4691,9 +4598,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4713,9 +4618,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4738,7 +4641,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["queryField -mutationField -typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -4759,9 +4662,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_query_plpgsql" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4786,9 +4687,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "person" }, description: undefined @@ -4816,7 +4715,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: undefined @@ -4845,9 +4744,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_connection" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4880,9 +4777,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4910,9 +4805,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_list" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }) 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 ce6fbc7f3d..6662395369 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 @@ -3172,6 +3172,9 @@ const registryConfig_pgResources_foreign_key_foreign_key = { schemaName: "a", name: "foreign_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3198,6 +3201,9 @@ const registryConfig_pgResources_unique_foreign_key_unique_foreign_key = { schemaName: "a", name: "unique_foreign_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "create,update,delete,all,order,filter", behavior: spec_uniqueForeignKey.extensions.tags.behavior @@ -3236,6 +3242,9 @@ const registryConfig_pgResources_person_secret_person_secret = { schemaName: "c", name: "person_secret" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { deprecated: "This is deprecated (comment on table c.person_secret)." } @@ -3273,6 +3282,9 @@ const registryConfig_pgResources_compound_key_compound_key = { schemaName: "c", name: "compound_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3334,6 +3346,9 @@ const registryConfig_pgResources_left_arm_left_arm = { schemaName: "c", name: "left_arm" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3354,9 +3369,10 @@ const resourceConfig_jwt_token = { schemaName: "b", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const authenticateFunctionIdentifer = sql.identifier("b", "authenticate"); @@ -3384,6 +3400,9 @@ const registryConfig_pgResources_issue756_issue756 = { schemaName: "c", name: "issue756" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3430,6 +3449,9 @@ const registryConfig_pgResources_post_post = { schemaName: "a", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "create", behavior: spec_post.extensions.tags.behavior @@ -3453,9 +3475,10 @@ const resourceConfig_compound_type = { schemaName: "c", name: "compound_type" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const compound_type_mutationFunctionIdentifer = sql.identifier("b", "compound_type_mutation"); @@ -3515,6 +3538,9 @@ const registryConfig_pgResources_person_person = { schemaName: "c", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3552,6 +3578,9 @@ const registryConfig_pgResources_types_types = { schemaName: "b", name: "types" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { foreignKey: spec_types.extensions.tags.foreignKey } @@ -3905,9 +3934,7 @@ const registry = makeRegistry({ schemaName: "c", name: "current_user_id" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3929,9 +3956,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3954,9 +3979,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3979,9 +4002,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4003,9 +4024,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4028,9 +4047,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4053,9 +4070,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4077,9 +4092,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4101,9 +4114,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4125,9 +4136,7 @@ const registry = makeRegistry({ schemaName: "a", name: "return_void_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4149,9 +4158,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_set" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4173,9 +4180,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_set" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4197,9 +4202,7 @@ const registry = makeRegistry({ schemaName: "a", name: "static_big_integer" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4226,9 +4229,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4256,9 +4257,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_one_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -4286,9 +4285,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4316,9 +4313,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_one_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -4346,9 +4341,7 @@ const registry = makeRegistry({ schemaName: "a", name: "assert_something" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4377,7 +4370,7 @@ const registry = makeRegistry({ }, tags: { omit: "execute", - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField"] + behavior: ["-queryField -mutationField -typeField"] } }, description: undefined @@ -4405,9 +4398,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4434,9 +4425,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4463,9 +4452,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4492,9 +4479,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4521,9 +4506,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4550,9 +4533,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql_with_default" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4584,9 +4565,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 1 mutation" }, @@ -4618,9 +4597,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 1 query" }, @@ -4652,9 +4629,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 2 mutation" }, @@ -4686,9 +4661,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 2 query" }, @@ -4720,9 +4693,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 3 mutation" }, @@ -4754,9 +4725,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 3 query" }, @@ -4788,9 +4757,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 4 mutation" }, @@ -4822,9 +4789,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation_error" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4856,9 +4821,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 4 query" }, @@ -4890,9 +4853,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_1" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4924,9 +4885,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_2" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4958,9 +4917,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_3" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4992,9 +4949,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_4" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5026,9 +4981,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_inout" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -5051,9 +5004,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5075,9 +5026,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5099,9 +5048,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5133,9 +5080,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_inout" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -5158,9 +5103,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5182,9 +5125,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5206,9 +5147,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5232,7 +5171,7 @@ const registry = makeRegistry({ }, tags: { simpleCollections: "only", - behavior: ["queryField -mutationField -typeField", "-filter -order", "+list -connection"] + behavior: ["+list -connection"] } }, description: undefined @@ -5270,9 +5209,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_1" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5309,9 +5246,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_2" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5348,9 +5283,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_3" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5387,9 +5320,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_4" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5426,9 +5357,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_5" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5450,9 +5379,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5479,9 +5406,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_multi_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5518,9 +5443,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5557,9 +5480,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5581,9 +5502,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5610,9 +5529,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_multi_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5639,9 +5556,7 @@ const registry = makeRegistry({ schemaName: "b", name: "guid_fn" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5663,9 +5578,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5687,9 +5600,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5711,9 +5622,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_text_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5735,9 +5644,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_text_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5757,9 +5664,10 @@ const registry = makeRegistry({ schemaName: "a", name: "non_updatable_view" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, inputs: { @@ -5778,6 +5686,9 @@ const registry = makeRegistry({ schemaName: "a", name: "inputs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5797,6 +5708,9 @@ const registry = makeRegistry({ schemaName: "a", name: "patchs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5816,6 +5730,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5835,6 +5752,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reservedPatchs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5854,6 +5774,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved_input" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5873,6 +5796,9 @@ const registry = makeRegistry({ schemaName: "a", name: "default_value" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5900,6 +5826,9 @@ const registry = makeRegistry({ schemaName: "a", name: "no_primary_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5919,6 +5848,9 @@ const registry = makeRegistry({ schemaName: "a", name: "testview" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5939,6 +5871,9 @@ const registry = makeRegistry({ schemaName: "c", name: "my_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5967,6 +5902,9 @@ const registry = makeRegistry({ name: "unlogged", persistence: "u" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5986,6 +5924,9 @@ const registry = makeRegistry({ schemaName: "a", name: "view_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6006,6 +5947,9 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_1" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6025,6 +5969,9 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_2" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6053,6 +6000,9 @@ const registry = makeRegistry({ schemaName: "b", name: "updatable_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { uniqueKey: "x", unique: "x|@behavior -single -update -delete" @@ -6075,6 +6025,9 @@ const registry = makeRegistry({ schemaName: "c", name: "null_test_record" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6101,9 +6054,7 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case_computed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6123,9 +6074,7 @@ const registry = makeRegistry({ schemaName: "c", name: "return_table_without_grants" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6162,9 +6111,7 @@ const registry = makeRegistry({ schemaName: "b", name: "list_bde_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6184,6 +6131,9 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6204,9 +6154,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_fail" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6241,9 +6189,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6274,8 +6220,7 @@ const registry = makeRegistry({ }, tags: { arg0variant: "base", - resultFieldName: "leftArm", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "leftArm" } }, description: undefined @@ -6296,9 +6241,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6318,9 +6261,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6355,9 +6296,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_many" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6377,9 +6316,11 @@ const registry = makeRegistry({ schemaName: "b", name: "auth_payload" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - foreignKey: "(id) references c.person", - behavior: ["-insert", "-update", "-delete"] + foreignKey: "(id) references c.person" } } }, { @@ -6413,9 +6354,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_payload" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6467,9 +6406,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6521,9 +6458,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6550,9 +6485,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_computed_field" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6579,9 +6512,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_set" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6608,9 +6539,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6637,9 +6566,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_text_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6674,7 +6601,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -6710,7 +6637,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -6738,9 +6665,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_compound_type" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6767,9 +6692,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_compound_type" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6806,9 +6729,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6845,9 +6766,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_no_defaults" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6884,9 +6803,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_strict" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6923,9 +6840,7 @@ const registry = makeRegistry({ schemaName: "c", name: "query_output_two_rows" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6946,9 +6861,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6973,9 +6886,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7000,9 +6911,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7027,9 +6936,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7054,9 +6961,7 @@ const registry = makeRegistry({ schemaName: "a", name: "create_post" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7081,9 +6986,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7108,9 +7011,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7141,8 +7042,7 @@ const registry = makeRegistry({ name: "post_with_suffix" }, tags: { - deprecated: "This is deprecated (comment on function a.post_with_suffix).", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function a.post_with_suffix)." } }, description: undefined @@ -7168,9 +7068,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_compound_type_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7195,9 +7093,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_compound_type_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7222,9 +7118,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7249,9 +7143,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7281,9 +7173,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_compound_type_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7308,9 +7198,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_many" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7341,7 +7229,7 @@ const registry = makeRegistry({ notNull: true, sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] }, singleOutputParameterName: "o1" }, @@ -7372,7 +7260,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: "The first name of the person." @@ -7400,9 +7288,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_out_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7434,9 +7320,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -7469,9 +7353,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7504,8 +7386,7 @@ const registry = makeRegistry({ name: "person_exists" }, tags: { - deprecated: "This is deprecated (comment on function c.person_exists).", - behavior: ["-queryField -mutationField typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.person_exists)." } }, description: undefined @@ -7533,9 +7414,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7567,9 +7446,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7601,9 +7478,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7635,9 +7510,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7669,9 +7542,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7708,9 +7579,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_complex" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7735,9 +7604,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_first_post" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: "The first post by the person." }), @@ -7759,8 +7626,7 @@ const registry = makeRegistry({ name: "badly_behaved_function" }, tags: { - deprecated: "This is deprecated (comment on function c.badly_behaved_function).", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.badly_behaved_function)." } }, description: undefined @@ -7781,9 +7647,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7803,9 +7667,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7825,9 +7687,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7847,9 +7707,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7869,9 +7727,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7894,7 +7750,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["queryField -mutationField -typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -7915,9 +7771,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_query_plpgsql" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7942,9 +7796,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "person" }, description: undefined @@ -7972,7 +7824,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: undefined @@ -7994,9 +7846,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8016,9 +7866,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8043,9 +7891,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8070,9 +7916,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8097,9 +7941,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_connection" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8129,9 +7971,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8151,9 +7991,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8173,9 +8011,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8200,9 +8036,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_list" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }) 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 4b722d7830..fe612d2cc5 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/function-clash.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/function-clash.1.export.mjs @@ -3169,6 +3169,9 @@ const registryConfig_pgResources_foreign_key_foreign_key = { schemaName: "a", name: "foreign_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3195,6 +3198,9 @@ const registryConfig_pgResources_unique_foreign_key_unique_foreign_key = { schemaName: "a", name: "unique_foreign_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "create,update,delete,all,order,filter", behavior: spec_uniqueForeignKey.extensions.tags.behavior @@ -3233,6 +3239,9 @@ const registryConfig_pgResources_person_secret_person_secret = { schemaName: "c", name: "person_secret" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { deprecated: "This is deprecated (comment on table c.person_secret)." } @@ -3270,6 +3279,9 @@ const registryConfig_pgResources_compound_key_compound_key = { schemaName: "c", name: "compound_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3331,6 +3343,9 @@ const registryConfig_pgResources_left_arm_left_arm = { schemaName: "c", name: "left_arm" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3351,9 +3366,10 @@ const resourceConfig_jwt_token = { schemaName: "b", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const authenticateFunctionIdentifer = sql.identifier("b", "authenticate"); @@ -3381,6 +3397,9 @@ const registryConfig_pgResources_issue756_issue756 = { schemaName: "c", name: "issue756" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3427,6 +3446,9 @@ const registryConfig_pgResources_post_post = { schemaName: "a", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3447,9 +3469,10 @@ const resourceConfig_compound_type = { schemaName: "c", name: "compound_type" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const compound_type_mutationFunctionIdentifer = sql.identifier("b", "compound_type_mutation"); @@ -3509,6 +3532,9 @@ const registryConfig_pgResources_person_person = { schemaName: "c", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3546,6 +3572,9 @@ const registryConfig_pgResources_types_types = { schemaName: "b", name: "types" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { foreignKey: spec_types.extensions.tags.foreignKey } @@ -3899,9 +3928,7 @@ const registry = makeRegistry({ schemaName: "c", name: "current_user_id" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3923,9 +3950,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3948,9 +3973,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3973,9 +3996,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3997,9 +4018,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4022,9 +4041,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4047,9 +4064,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4071,9 +4086,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4095,9 +4108,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4119,9 +4130,7 @@ const registry = makeRegistry({ schemaName: "a", name: "return_void_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4143,9 +4152,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_set" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4167,9 +4174,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_set" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4191,9 +4196,7 @@ const registry = makeRegistry({ schemaName: "a", name: "static_big_integer" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4220,9 +4223,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4250,9 +4251,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_one_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -4280,9 +4279,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4310,9 +4307,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_one_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -4340,9 +4335,7 @@ const registry = makeRegistry({ schemaName: "a", name: "assert_something" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4371,7 +4364,7 @@ const registry = makeRegistry({ }, tags: { omit: "execute", - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField"] + behavior: ["-queryField -mutationField -typeField"] } }, description: undefined @@ -4399,9 +4392,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4428,9 +4419,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4457,9 +4446,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4486,9 +4473,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4515,9 +4500,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4544,9 +4527,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql_with_default" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4578,9 +4559,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 1 mutation" }, @@ -4612,9 +4591,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 1 query" }, @@ -4646,9 +4623,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 2 mutation" }, @@ -4680,9 +4655,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 2 query" }, @@ -4714,9 +4687,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 3 mutation" }, @@ -4748,9 +4719,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 3 query" }, @@ -4782,9 +4751,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 4 mutation" }, @@ -4816,9 +4783,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation_error" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4850,9 +4815,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 4 query" }, @@ -4884,9 +4847,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_1" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4918,9 +4879,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_2" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4952,9 +4911,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_3" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4986,9 +4943,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_4" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5020,9 +4975,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_inout" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -5045,9 +4998,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5069,9 +5020,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5093,9 +5042,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5127,9 +5074,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_inout" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -5152,9 +5097,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5176,9 +5119,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5200,9 +5141,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5226,7 +5165,7 @@ const registry = makeRegistry({ }, tags: { simpleCollections: "only", - behavior: ["queryField -mutationField -typeField", "-filter -order", "+list -connection"] + behavior: ["+list -connection"] } }, description: undefined @@ -5264,9 +5203,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_1" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5303,9 +5240,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_2" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5342,9 +5277,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_3" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5381,9 +5314,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_4" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5420,9 +5351,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_5" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5444,9 +5373,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5473,9 +5400,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_multi_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5512,9 +5437,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5551,9 +5474,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5575,9 +5496,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5604,9 +5523,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_multi_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5633,9 +5550,7 @@ const registry = makeRegistry({ schemaName: "b", name: "guid_fn" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5657,9 +5572,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5681,9 +5594,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5705,9 +5616,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_text_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5729,9 +5638,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_text_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5751,9 +5658,10 @@ const registry = makeRegistry({ schemaName: "a", name: "non_updatable_view" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, inputs: { @@ -5772,6 +5680,9 @@ const registry = makeRegistry({ schemaName: "a", name: "inputs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5791,6 +5702,9 @@ const registry = makeRegistry({ schemaName: "a", name: "patchs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5810,6 +5724,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5829,6 +5746,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reservedPatchs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5848,6 +5768,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved_input" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5867,6 +5790,9 @@ const registry = makeRegistry({ schemaName: "a", name: "default_value" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5894,6 +5820,9 @@ const registry = makeRegistry({ schemaName: "a", name: "no_primary_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5913,6 +5842,9 @@ const registry = makeRegistry({ schemaName: "a", name: "testview" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5933,6 +5865,9 @@ const registry = makeRegistry({ schemaName: "c", name: "my_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5961,6 +5896,9 @@ const registry = makeRegistry({ name: "unlogged", persistence: "u" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5980,6 +5918,9 @@ const registry = makeRegistry({ schemaName: "a", name: "view_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6000,6 +5941,9 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_1" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6019,6 +5963,9 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_2" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6047,6 +5994,9 @@ const registry = makeRegistry({ schemaName: "b", name: "updatable_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { uniqueKey: "x", unique: "x|@behavior -single -update -delete" @@ -6069,6 +6019,9 @@ const registry = makeRegistry({ schemaName: "c", name: "null_test_record" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6095,9 +6048,7 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case_computed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6117,9 +6068,7 @@ const registry = makeRegistry({ schemaName: "c", name: "return_table_without_grants" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6156,9 +6105,7 @@ const registry = makeRegistry({ schemaName: "b", name: "list_bde_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6178,6 +6125,9 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6198,9 +6148,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_fail" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6235,9 +6183,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6268,8 +6214,7 @@ const registry = makeRegistry({ }, tags: { arg0variant: "base", - resultFieldName: "leftArm", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "leftArm" } }, description: undefined @@ -6290,9 +6235,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6312,9 +6255,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6349,9 +6290,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_many" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6371,9 +6310,11 @@ const registry = makeRegistry({ schemaName: "b", name: "auth_payload" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - foreignKey: "(id) references c.person", - behavior: ["-insert", "-update", "-delete"] + foreignKey: "(id) references c.person" } } }, { @@ -6407,9 +6348,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_payload" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6461,9 +6400,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6515,9 +6452,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6544,9 +6479,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_computed_field" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6573,9 +6506,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_set" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6602,9 +6533,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6631,9 +6560,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_text_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6668,7 +6595,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -6704,7 +6631,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -6732,9 +6659,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_compound_type" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6761,9 +6686,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_compound_type" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6800,9 +6723,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6839,9 +6760,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_no_defaults" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6878,9 +6797,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_strict" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6917,9 +6834,7 @@ const registry = makeRegistry({ schemaName: "c", name: "query_output_two_rows" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6940,9 +6855,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6967,9 +6880,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6994,9 +6905,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7021,9 +6930,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7048,9 +6955,7 @@ const registry = makeRegistry({ schemaName: "a", name: "create_post" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7075,9 +6980,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7102,9 +7005,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7135,8 +7036,7 @@ const registry = makeRegistry({ name: "post_with_suffix" }, tags: { - deprecated: "This is deprecated (comment on function a.post_with_suffix).", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function a.post_with_suffix)." } }, description: undefined @@ -7162,9 +7062,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_compound_type_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7189,9 +7087,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_compound_type_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7216,9 +7112,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7243,9 +7137,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7275,9 +7167,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_compound_type_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7302,9 +7192,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_many" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7335,7 +7223,7 @@ const registry = makeRegistry({ notNull: true, sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] }, singleOutputParameterName: "o1" }, @@ -7366,7 +7254,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: "The first name of the person." @@ -7394,9 +7282,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_out_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7428,9 +7314,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -7463,9 +7347,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7498,8 +7380,7 @@ const registry = makeRegistry({ name: "person_exists" }, tags: { - deprecated: "This is deprecated (comment on function c.person_exists).", - behavior: ["-queryField -mutationField typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.person_exists)." } }, description: undefined @@ -7527,9 +7408,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7561,9 +7440,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7595,9 +7472,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7629,9 +7504,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7663,9 +7536,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7702,9 +7573,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_complex" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7729,9 +7598,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_first_post" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: "The first post by the person." }), @@ -7753,8 +7620,7 @@ const registry = makeRegistry({ name: "badly_behaved_function" }, tags: { - deprecated: "This is deprecated (comment on function c.badly_behaved_function).", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.badly_behaved_function)." } }, description: undefined @@ -7775,9 +7641,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7797,9 +7661,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7819,9 +7681,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7841,9 +7701,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7863,9 +7721,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7888,7 +7744,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["queryField -mutationField -typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -7909,9 +7765,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_query_plpgsql" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7936,9 +7790,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "person" }, description: undefined @@ -7966,7 +7818,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: undefined @@ -7988,9 +7840,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8010,9 +7860,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8037,9 +7885,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8064,9 +7910,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8091,9 +7935,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_connection" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8123,9 +7965,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8145,9 +7985,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8167,9 +8005,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8194,9 +8030,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_list" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }) diff --git a/postgraphile/postgraphile/__tests__/schema/v4/geometry.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/geometry.1.export.mjs index 12572febe1..91b36a229d 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/geometry.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/geometry.1.export.mjs @@ -218,6 +218,9 @@ const pgResource_geomPgResource = makeRegistry({ schemaName: "geometry", name: "geom" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/indexes.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/indexes.1.export.mjs index 7777b7d614..8696c7ddbc 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/indexes.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/indexes.1.export.mjs @@ -470,9 +470,8 @@ const nonUpdatableViewCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -648,9 +647,8 @@ const spec_defaultValue = { notNull: false, hasDefault: true, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -678,9 +676,8 @@ const foreignKeyCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, compound_key_1: { @@ -689,9 +686,8 @@ const foreignKeyCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, compound_key_2: { @@ -700,9 +696,8 @@ const foreignKeyCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -738,9 +733,8 @@ const spec_noPrimaryKey = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -768,9 +762,8 @@ const testviewCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, col1: { @@ -779,9 +772,8 @@ const testviewCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, col2: { @@ -790,9 +782,8 @@ const testviewCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -828,9 +819,8 @@ const spec_uniqueForeignKey = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -870,9 +860,8 @@ const spec_myTable = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -910,9 +899,9 @@ const spec_personSecret = { hasDefault: false, extensions: { tags: { - name: "secret", - behavior: ["-filterBy -orderBy"] - } + name: "secret" + }, + isIndexed: false } } }), @@ -951,9 +940,8 @@ const unloggedCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -990,9 +978,8 @@ const spec_viewTable = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, col2: { @@ -1001,9 +988,8 @@ const spec_viewTable = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -1031,9 +1017,8 @@ const spec_compoundKey = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, person_id_1: { @@ -1051,9 +1036,8 @@ const spec_compoundKey = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -1090,9 +1074,8 @@ const spec_similarTable1 = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, col2: { @@ -1101,9 +1084,8 @@ const spec_similarTable1 = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, col3: { @@ -1112,9 +1094,8 @@ const spec_similarTable1 = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -1151,9 +1132,8 @@ const spec_similarTable2 = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, col4: { @@ -1162,9 +1142,8 @@ const spec_similarTable2 = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, col5: { @@ -1173,9 +1152,8 @@ const spec_similarTable2 = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -1203,9 +1181,8 @@ const updatableViewCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, name: { @@ -1214,9 +1191,8 @@ const updatableViewCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, description: { @@ -1225,9 +1201,8 @@ const updatableViewCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, constant: { @@ -1236,9 +1211,8 @@ const updatableViewCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -1277,9 +1251,8 @@ const spec_nullTestRecord = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, nullable_int: { @@ -1288,9 +1261,8 @@ const spec_nullTestRecord = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, non_null_text: { @@ -1299,9 +1271,8 @@ const spec_nullTestRecord = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -1342,9 +1313,8 @@ const edgeCaseCodec = recordCodec({ notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, wont_cast_easy: { @@ -1353,9 +1323,8 @@ const edgeCaseCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, row_id: { @@ -1364,9 +1333,8 @@ const edgeCaseCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -1411,9 +1379,8 @@ const spec_leftArm = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, mood: { @@ -1422,9 +1389,8 @@ const spec_leftArm = { notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -1452,9 +1418,8 @@ const jwtTokenCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, exp: { @@ -1463,9 +1428,8 @@ const jwtTokenCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, a: { @@ -1474,9 +1438,8 @@ const jwtTokenCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, b: { @@ -1485,9 +1448,8 @@ const jwtTokenCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, c: { @@ -1496,9 +1458,8 @@ const jwtTokenCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -1546,9 +1507,8 @@ const spec_issue756 = { notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -1576,9 +1536,8 @@ const authPayloadCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, id: { @@ -1587,9 +1546,8 @@ const authPayloadCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, admin: { @@ -1598,9 +1556,8 @@ const authPayloadCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -1671,9 +1628,8 @@ const compoundTypeCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, b: { @@ -1682,9 +1638,8 @@ const compoundTypeCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, c: { @@ -1693,9 +1648,8 @@ const compoundTypeCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, d: { @@ -1704,9 +1658,8 @@ const compoundTypeCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, e: { @@ -1715,9 +1668,8 @@ const compoundTypeCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, f: { @@ -1726,9 +1678,8 @@ const compoundTypeCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, g: { @@ -1737,9 +1688,8 @@ const compoundTypeCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, foo_bar: { @@ -1748,9 +1698,8 @@ const compoundTypeCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -1864,9 +1813,8 @@ const comptypeCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, is_optimised: { @@ -1875,9 +1823,8 @@ const comptypeCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -1925,9 +1872,8 @@ const spec_post = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, body: { @@ -1936,9 +1882,8 @@ const spec_post = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, author_id: { @@ -1956,9 +1901,8 @@ const spec_post = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, comptypes: { @@ -1967,9 +1911,8 @@ const spec_post = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -2119,9 +2062,8 @@ const wrappedUrlCodec = recordCodec({ notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -2157,9 +2099,9 @@ const spec_person = { hasDefault: false, extensions: { tags: { - name: "name", - behavior: ["-filterBy -orderBy"] - } + name: "name" + }, + isIndexed: false } }, aliases: { @@ -2168,9 +2110,8 @@ const spec_person = { notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, about: { @@ -2179,9 +2120,8 @@ const spec_person = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, email: { @@ -2200,9 +2140,9 @@ const spec_person = { hasDefault: false, extensions: { tags: { - deprecated: "Don\u2019t use me", - behavior: ["-filterBy -orderBy"] - } + deprecated: "Don\u2019t use me" + }, + isIndexed: false } }, config: { @@ -2211,9 +2151,8 @@ const spec_person = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, last_login_from_ip: { @@ -2222,9 +2161,8 @@ const spec_person = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, last_login_from_subnet: { @@ -2233,9 +2171,8 @@ const spec_person = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, user_mac: { @@ -2244,9 +2181,8 @@ const spec_person = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, created_at: { @@ -2255,9 +2191,8 @@ const spec_person = { notNull: false, hasDefault: true, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -2575,9 +2510,8 @@ const nestedCompoundTypeCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, b: { @@ -2586,9 +2520,8 @@ const nestedCompoundTypeCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, baz_buz: { @@ -2597,9 +2530,8 @@ const nestedCompoundTypeCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -2697,9 +2629,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, bigint: { @@ -2708,9 +2639,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, numeric: { @@ -2719,9 +2649,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, decimal: { @@ -2730,9 +2659,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, boolean: { @@ -2741,9 +2669,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, varchar: { @@ -2752,9 +2679,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, enum: { @@ -2763,9 +2689,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, enum_array: { @@ -2774,9 +2699,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, domain: { @@ -2785,9 +2709,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, domain2: { @@ -2796,9 +2719,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, text_array: { @@ -2807,9 +2729,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, json: { @@ -2818,9 +2739,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, jsonb: { @@ -2829,9 +2749,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, nullable_range: { @@ -2840,9 +2759,8 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, numrange: { @@ -2851,9 +2769,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, daterange: { @@ -2862,9 +2779,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, an_int_range: { @@ -2873,9 +2789,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, timestamp: { @@ -2884,9 +2799,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, timestamptz: { @@ -2895,9 +2809,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, date: { @@ -2906,9 +2819,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, time: { @@ -2917,9 +2829,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, timetz: { @@ -2928,9 +2839,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, interval: { @@ -2939,9 +2849,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, interval_array: { @@ -2950,9 +2859,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, money: { @@ -2961,9 +2869,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, compound_type: { @@ -2972,9 +2879,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, nested_compound_type: { @@ -2983,9 +2889,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, nullable_compound_type: { @@ -2994,9 +2899,8 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, nullable_nested_compound_type: { @@ -3005,9 +2909,8 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, point: { @@ -3016,9 +2919,8 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, nullablePoint: { @@ -3027,9 +2929,8 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, inet: { @@ -3038,9 +2939,8 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, cidr: { @@ -3049,9 +2949,8 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, macaddr: { @@ -3060,9 +2959,8 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, regproc: { @@ -3071,9 +2969,8 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, regprocedure: { @@ -3082,9 +2979,8 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, regoper: { @@ -3093,9 +2989,8 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, regoperator: { @@ -3104,9 +2999,8 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, regclass: { @@ -3115,9 +3009,8 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, regtype: { @@ -3126,9 +3019,8 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, regconfig: { @@ -3137,9 +3029,8 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, regdictionary: { @@ -3148,9 +3039,8 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, text_array_domain: { @@ -3159,9 +3049,8 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, int8_array_domain: { @@ -3170,9 +3059,8 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, bytea: { @@ -3181,9 +3069,8 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, bytea_array: { @@ -3192,9 +3079,8 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, ltree: { @@ -3203,9 +3089,8 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, ltree_array: { @@ -3214,9 +3099,8 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -3399,6 +3283,9 @@ const registryConfig_pgResources_foreign_key_foreign_key = { schemaName: "a", name: "foreign_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3425,6 +3312,9 @@ const registryConfig_pgResources_unique_foreign_key_unique_foreign_key = { schemaName: "a", name: "unique_foreign_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "create,update,delete,all,order,filter", behavior: spec_uniqueForeignKey.extensions.tags.behavior @@ -3463,6 +3353,9 @@ const registryConfig_pgResources_person_secret_person_secret = { schemaName: "c", name: "person_secret" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { deprecated: "This is deprecated (comment on table c.person_secret)." } @@ -3500,6 +3393,9 @@ const registryConfig_pgResources_compound_key_compound_key = { schemaName: "c", name: "compound_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3561,6 +3457,9 @@ const registryConfig_pgResources_left_arm_left_arm = { schemaName: "c", name: "left_arm" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3581,9 +3480,10 @@ const resourceConfig_jwt_token = { schemaName: "b", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const authenticateFunctionIdentifer = sql.identifier("b", "authenticate"); @@ -3611,6 +3511,9 @@ const registryConfig_pgResources_issue756_issue756 = { schemaName: "c", name: "issue756" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3657,6 +3560,9 @@ const registryConfig_pgResources_post_post = { schemaName: "a", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3677,9 +3583,10 @@ const resourceConfig_compound_type = { schemaName: "c", name: "compound_type" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const compound_type_mutationFunctionIdentifer = sql.identifier("b", "compound_type_mutation"); @@ -3738,6 +3645,9 @@ const registryConfig_pgResources_person_person = { schemaName: "c", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3775,6 +3685,9 @@ const registryConfig_pgResources_types_types = { schemaName: "b", name: "types" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { foreignKey: spec_types.extensions.tags.foreignKey } @@ -3959,9 +3872,8 @@ const registry = makeRegistry({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, category_1: { @@ -3970,9 +3882,8 @@ const registry = makeRegistry({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, category_2: { @@ -3981,9 +3892,8 @@ const registry = makeRegistry({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -4009,9 +3919,8 @@ const registry = makeRegistry({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, category_1: { @@ -4020,9 +3929,8 @@ const registry = makeRegistry({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, category_2: { @@ -4031,9 +3939,8 @@ const registry = makeRegistry({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, category_3: { @@ -4042,9 +3949,8 @@ const registry = makeRegistry({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -4070,9 +3976,8 @@ const registry = makeRegistry({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, category_1: { @@ -4081,9 +3986,8 @@ const registry = makeRegistry({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, category_2: { @@ -4092,9 +3996,8 @@ const registry = makeRegistry({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, category_3: { @@ -4103,9 +4006,8 @@ const registry = makeRegistry({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } }, category_4: { @@ -4114,9 +4016,8 @@ const registry = makeRegistry({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-filterBy -orderBy"] - } + tags: {}, + isIndexed: false } } }), @@ -4152,9 +4053,7 @@ const registry = makeRegistry({ schemaName: "c", name: "current_user_id" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4176,9 +4075,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4201,9 +4098,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4226,9 +4121,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4250,9 +4143,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4275,9 +4166,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4300,9 +4189,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4324,9 +4211,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4348,9 +4233,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4372,9 +4255,7 @@ const registry = makeRegistry({ schemaName: "a", name: "return_void_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4396,9 +4277,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_set" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4420,9 +4299,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_set" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4444,9 +4321,7 @@ const registry = makeRegistry({ schemaName: "a", name: "static_big_integer" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4473,9 +4348,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4503,9 +4376,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_one_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -4533,9 +4404,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4563,9 +4432,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_one_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -4593,9 +4460,7 @@ const registry = makeRegistry({ schemaName: "a", name: "assert_something" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4624,7 +4489,7 @@ const registry = makeRegistry({ }, tags: { omit: "execute", - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField"] + behavior: ["-queryField -mutationField -typeField"] } }, description: undefined @@ -4652,9 +4517,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4681,9 +4544,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4710,9 +4571,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4739,9 +4598,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4768,9 +4625,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4797,9 +4652,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql_with_default" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4831,9 +4684,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 1 mutation" }, @@ -4865,9 +4716,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 1 query" }, @@ -4899,9 +4748,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 2 mutation" }, @@ -4933,9 +4780,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 2 query" }, @@ -4967,9 +4812,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 3 mutation" }, @@ -5001,9 +4844,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 3 query" }, @@ -5035,9 +4876,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 4 mutation" }, @@ -5069,9 +4908,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation_error" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5103,9 +4940,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 4 query" }, @@ -5137,9 +4972,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_1" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5171,9 +5004,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_2" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5205,9 +5036,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_3" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5239,9 +5068,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_4" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5273,9 +5100,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_inout" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -5298,9 +5123,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5322,9 +5145,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5346,9 +5167,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5380,9 +5199,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_inout" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -5405,9 +5222,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5429,9 +5244,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5453,9 +5266,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5479,7 +5290,7 @@ const registry = makeRegistry({ }, tags: { simpleCollections: "only", - behavior: ["queryField -mutationField -typeField", "-filter -order", "+list -connection"] + behavior: ["+list -connection"] } }, description: undefined @@ -5517,9 +5328,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_1" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5556,9 +5365,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_2" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5595,9 +5402,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_3" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5634,9 +5439,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_4" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5673,9 +5476,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_5" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5697,9 +5498,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5726,9 +5525,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_multi_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5765,9 +5562,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5804,9 +5599,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5828,9 +5621,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5857,9 +5648,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_multi_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5886,9 +5675,7 @@ const registry = makeRegistry({ schemaName: "b", name: "guid_fn" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5910,9 +5697,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5934,9 +5719,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5958,9 +5741,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_text_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5982,9 +5763,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_text_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6004,9 +5783,10 @@ const registry = makeRegistry({ schemaName: "a", name: "non_updatable_view" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, inputs: { @@ -6025,6 +5805,9 @@ const registry = makeRegistry({ schemaName: "a", name: "inputs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6044,6 +5827,9 @@ const registry = makeRegistry({ schemaName: "a", name: "patchs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6063,6 +5849,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6082,6 +5871,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reservedPatchs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6101,6 +5893,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved_input" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6120,6 +5915,9 @@ const registry = makeRegistry({ schemaName: "a", name: "default_value" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6147,6 +5945,9 @@ const registry = makeRegistry({ schemaName: "a", name: "no_primary_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6166,6 +5967,9 @@ const registry = makeRegistry({ schemaName: "a", name: "testview" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6186,6 +5990,9 @@ const registry = makeRegistry({ schemaName: "c", name: "my_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6214,6 +6021,9 @@ const registry = makeRegistry({ name: "unlogged", persistence: "u" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6233,6 +6043,9 @@ const registry = makeRegistry({ schemaName: "a", name: "view_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6253,6 +6066,9 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_1" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6272,6 +6088,9 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_2" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6300,6 +6119,9 @@ const registry = makeRegistry({ schemaName: "b", name: "updatable_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { uniqueKey: "x", unique: "x|@behavior -single -update -delete" @@ -6322,6 +6144,9 @@ const registry = makeRegistry({ schemaName: "c", name: "null_test_record" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6348,9 +6173,7 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case_computed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6370,9 +6193,7 @@ const registry = makeRegistry({ schemaName: "c", name: "return_table_without_grants" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6409,9 +6230,7 @@ const registry = makeRegistry({ schemaName: "b", name: "list_bde_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6431,6 +6250,9 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6451,9 +6273,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_fail" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6488,9 +6308,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6521,8 +6339,7 @@ const registry = makeRegistry({ }, tags: { arg0variant: "base", - resultFieldName: "leftArm", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "leftArm" } }, description: undefined @@ -6543,9 +6360,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6565,9 +6380,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6602,9 +6415,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_many" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6624,9 +6435,11 @@ const registry = makeRegistry({ schemaName: "b", name: "auth_payload" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - foreignKey: "(id) references c.person", - behavior: ["-insert", "-update", "-delete"] + foreignKey: "(id) references c.person" } } }, { @@ -6660,9 +6473,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_payload" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6714,9 +6525,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6768,9 +6577,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6797,9 +6604,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_computed_field" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6826,9 +6631,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_set" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6855,9 +6658,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6884,9 +6685,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_text_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6921,7 +6720,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -6957,7 +6756,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -6985,9 +6784,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_compound_type" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7014,9 +6811,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_compound_type" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7053,9 +6848,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7092,9 +6885,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_no_defaults" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7131,9 +6922,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_strict" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7170,9 +6959,7 @@ const registry = makeRegistry({ schemaName: "c", name: "query_output_two_rows" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7193,9 +6980,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7220,9 +7005,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7247,9 +7030,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7274,9 +7055,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7301,9 +7080,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7328,9 +7105,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7361,8 +7136,7 @@ const registry = makeRegistry({ name: "post_with_suffix" }, tags: { - deprecated: "This is deprecated (comment on function a.post_with_suffix).", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function a.post_with_suffix)." } }, description: undefined @@ -7388,9 +7162,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_compound_type_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7415,9 +7187,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_compound_type_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7442,9 +7212,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7469,9 +7237,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7501,9 +7267,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_compound_type_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7528,9 +7292,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_many" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7561,7 +7323,7 @@ const registry = makeRegistry({ notNull: true, sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] }, singleOutputParameterName: "o1" }, @@ -7592,7 +7354,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: "The first name of the person." @@ -7620,9 +7382,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_out_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7654,9 +7414,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -7689,9 +7447,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7724,8 +7480,7 @@ const registry = makeRegistry({ name: "person_exists" }, tags: { - deprecated: "This is deprecated (comment on function c.person_exists).", - behavior: ["-queryField -mutationField typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.person_exists)." } }, description: undefined @@ -7753,9 +7508,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7787,9 +7540,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7821,9 +7572,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7855,9 +7604,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7889,9 +7636,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7928,9 +7673,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_complex" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7955,9 +7698,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_first_post" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: "The first post by the person." }), @@ -7979,8 +7720,7 @@ const registry = makeRegistry({ name: "badly_behaved_function" }, tags: { - deprecated: "This is deprecated (comment on function c.badly_behaved_function).", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.badly_behaved_function)." } }, description: undefined @@ -8001,9 +7741,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8023,9 +7761,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8045,9 +7781,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8067,9 +7801,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8089,9 +7821,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8114,7 +7844,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["queryField -mutationField -typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -8135,9 +7865,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_query_plpgsql" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8162,9 +7890,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "person" }, description: undefined @@ -8192,7 +7918,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: undefined @@ -8214,9 +7940,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8236,9 +7960,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8263,9 +7985,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8290,9 +8010,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8317,9 +8035,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_connection" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8349,9 +8065,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8371,9 +8085,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8393,9 +8105,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8420,9 +8130,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_list" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }) @@ -8615,8 +8323,9 @@ const registry = makeRegistry({ description: undefined, extensions: { tags: { - behavior: ["-list -connection -single -manyToMany"] - } + behavior: [] + }, + isIndexed: false } }, uniqueForeignKeyByTheirCompoundKey1AndCompoundKey2: { @@ -8679,8 +8388,9 @@ const registry = makeRegistry({ description: undefined, extensions: { tags: { - behavior: ["-list -connection -single -manyToMany"] - } + behavior: [] + }, + isIndexed: false } }, personSecretByTheirPersonId: { @@ -8741,8 +8451,9 @@ const registry = makeRegistry({ description: undefined, extensions: { tags: { - behavior: ["-list -connection -single -manyToMany"] - } + behavior: [] + }, + isIndexed: false } } }), diff --git a/postgraphile/postgraphile/__tests__/schema/v4/indexes.index_expressions.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/indexes.index_expressions.1.export.mjs index 36814d9585..47f55d311d 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/indexes.index_expressions.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/indexes.index_expressions.1.export.mjs @@ -157,6 +157,9 @@ const pgResource_employeePgResource = makeRegistry({ schemaName: "index_expressions", name: "employee" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } } 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 f36edaf50c..0dd86eaf4e 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/inflect-core.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/inflect-core.1.export.mjs @@ -3169,6 +3169,9 @@ const registryConfig_pgResources_foreign_key_foreign_key = { schemaName: "a", name: "foreign_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3195,6 +3198,9 @@ const registryConfig_pgResources_unique_foreign_key_unique_foreign_key = { schemaName: "a", name: "unique_foreign_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "create,update,delete,all,order,filter", behavior: spec_uniqueForeignKey.extensions.tags.behavior @@ -3233,6 +3239,9 @@ const registryConfig_pgResources_person_secret_person_secret = { schemaName: "c", name: "person_secret" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { deprecated: "This is deprecated (comment on table c.person_secret)." } @@ -3270,6 +3279,9 @@ const registryConfig_pgResources_compound_key_compound_key = { schemaName: "c", name: "compound_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3331,6 +3343,9 @@ const registryConfig_pgResources_left_arm_left_arm = { schemaName: "c", name: "left_arm" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3351,9 +3366,10 @@ const resourceConfig_jwt_token = { schemaName: "b", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const authenticateFunctionIdentifer = sql.identifier("b", "authenticate"); @@ -3381,6 +3397,9 @@ const registryConfig_pgResources_issue756_issue756 = { schemaName: "c", name: "issue756" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3427,6 +3446,9 @@ const registryConfig_pgResources_post_post = { schemaName: "a", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3447,9 +3469,10 @@ const resourceConfig_compound_type = { schemaName: "c", name: "compound_type" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const compound_type_mutationFunctionIdentifer = sql.identifier("b", "compound_type_mutation"); @@ -3508,6 +3531,9 @@ const registryConfig_pgResources_person_person = { schemaName: "c", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3545,6 +3571,9 @@ const registryConfig_pgResources_types_types = { schemaName: "b", name: "types" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { foreignKey: spec_types.extensions.tags.foreignKey } @@ -3898,9 +3927,7 @@ const registry = makeRegistry({ schemaName: "c", name: "current_user_id" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3922,9 +3949,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3947,9 +3972,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3972,9 +3995,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3996,9 +4017,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4021,9 +4040,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4046,9 +4063,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4070,9 +4085,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4094,9 +4107,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4118,9 +4129,7 @@ const registry = makeRegistry({ schemaName: "a", name: "return_void_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4142,9 +4151,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_set" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4166,9 +4173,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_set" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4190,9 +4195,7 @@ const registry = makeRegistry({ schemaName: "a", name: "static_big_integer" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4219,9 +4222,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4249,9 +4250,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_one_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -4279,9 +4278,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4309,9 +4306,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_one_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -4339,9 +4334,7 @@ const registry = makeRegistry({ schemaName: "a", name: "assert_something" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4370,7 +4363,7 @@ const registry = makeRegistry({ }, tags: { omit: "execute", - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField"] + behavior: ["-queryField -mutationField -typeField"] } }, description: undefined @@ -4398,9 +4391,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4427,9 +4418,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4456,9 +4445,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4485,9 +4472,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4514,9 +4499,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4543,9 +4526,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql_with_default" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4577,9 +4558,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 1 mutation" }, @@ -4611,9 +4590,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 1 query" }, @@ -4645,9 +4622,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 2 mutation" }, @@ -4679,9 +4654,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 2 query" }, @@ -4713,9 +4686,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 3 mutation" }, @@ -4747,9 +4718,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 3 query" }, @@ -4781,9 +4750,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 4 mutation" }, @@ -4815,9 +4782,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation_error" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4849,9 +4814,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 4 query" }, @@ -4883,9 +4846,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_1" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4917,9 +4878,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_2" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4951,9 +4910,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_3" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4985,9 +4942,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_4" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5019,9 +4974,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_inout" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -5044,9 +4997,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5068,9 +5019,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5092,9 +5041,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5126,9 +5073,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_inout" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -5151,9 +5096,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5175,9 +5118,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5199,9 +5140,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5225,7 +5164,7 @@ const registry = makeRegistry({ }, tags: { simpleCollections: "only", - behavior: ["queryField -mutationField -typeField", "-filter -order", "+list -connection"] + behavior: ["+list -connection"] } }, description: undefined @@ -5263,9 +5202,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_1" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5302,9 +5239,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_2" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5341,9 +5276,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_3" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5380,9 +5313,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_4" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5419,9 +5350,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_5" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5443,9 +5372,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5472,9 +5399,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_multi_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5511,9 +5436,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5550,9 +5473,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5574,9 +5495,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5603,9 +5522,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_multi_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5632,9 +5549,7 @@ const registry = makeRegistry({ schemaName: "b", name: "guid_fn" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5656,9 +5571,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5680,9 +5593,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5704,9 +5615,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_text_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5728,9 +5637,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_text_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5750,9 +5657,10 @@ const registry = makeRegistry({ schemaName: "a", name: "non_updatable_view" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, inputs: { @@ -5771,6 +5679,9 @@ const registry = makeRegistry({ schemaName: "a", name: "inputs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5790,6 +5701,9 @@ const registry = makeRegistry({ schemaName: "a", name: "patchs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5809,6 +5723,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5828,6 +5745,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reservedPatchs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5847,6 +5767,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved_input" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5866,6 +5789,9 @@ const registry = makeRegistry({ schemaName: "a", name: "default_value" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5893,6 +5819,9 @@ const registry = makeRegistry({ schemaName: "a", name: "no_primary_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5912,6 +5841,9 @@ const registry = makeRegistry({ schemaName: "a", name: "testview" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5932,6 +5864,9 @@ const registry = makeRegistry({ schemaName: "c", name: "my_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5960,6 +5895,9 @@ const registry = makeRegistry({ name: "unlogged", persistence: "u" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5979,6 +5917,9 @@ const registry = makeRegistry({ schemaName: "a", name: "view_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5999,6 +5940,9 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_1" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6018,6 +5962,9 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_2" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6046,6 +5993,9 @@ const registry = makeRegistry({ schemaName: "b", name: "updatable_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { uniqueKey: "x", unique: "x|@behavior -single -update -delete" @@ -6068,6 +6018,9 @@ const registry = makeRegistry({ schemaName: "c", name: "null_test_record" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6094,9 +6047,7 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case_computed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6116,9 +6067,7 @@ const registry = makeRegistry({ schemaName: "c", name: "return_table_without_grants" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6155,9 +6104,7 @@ const registry = makeRegistry({ schemaName: "b", name: "list_bde_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6177,6 +6124,9 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6197,9 +6147,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_fail" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6234,9 +6182,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6267,8 +6213,7 @@ const registry = makeRegistry({ }, tags: { arg0variant: "base", - resultFieldName: "leftArm", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "leftArm" } }, description: undefined @@ -6289,9 +6234,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6311,9 +6254,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6348,9 +6289,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_many" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6370,9 +6309,11 @@ const registry = makeRegistry({ schemaName: "b", name: "auth_payload" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - foreignKey: "(id) references c.person", - behavior: ["-insert", "-update", "-delete"] + foreignKey: "(id) references c.person" } } }, { @@ -6406,9 +6347,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_payload" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6460,9 +6399,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6514,9 +6451,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6543,9 +6478,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_computed_field" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6572,9 +6505,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_set" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6601,9 +6532,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6630,9 +6559,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_text_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6667,7 +6594,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -6703,7 +6630,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -6731,9 +6658,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_compound_type" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6760,9 +6685,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_compound_type" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6799,9 +6722,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6838,9 +6759,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_no_defaults" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6877,9 +6796,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_strict" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6916,9 +6833,7 @@ const registry = makeRegistry({ schemaName: "c", name: "query_output_two_rows" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6939,9 +6854,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6966,9 +6879,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6993,9 +6904,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7020,9 +6929,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7047,9 +6954,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7074,9 +6979,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7107,8 +7010,7 @@ const registry = makeRegistry({ name: "post_with_suffix" }, tags: { - deprecated: "This is deprecated (comment on function a.post_with_suffix).", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function a.post_with_suffix)." } }, description: undefined @@ -7134,9 +7036,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_compound_type_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7161,9 +7061,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_compound_type_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7188,9 +7086,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7215,9 +7111,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7247,9 +7141,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_compound_type_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7274,9 +7166,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_many" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7307,7 +7197,7 @@ const registry = makeRegistry({ notNull: true, sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] }, singleOutputParameterName: "o1" }, @@ -7338,7 +7228,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: "The first name of the person." @@ -7366,9 +7256,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_out_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7400,9 +7288,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -7435,9 +7321,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7470,8 +7354,7 @@ const registry = makeRegistry({ name: "person_exists" }, tags: { - deprecated: "This is deprecated (comment on function c.person_exists).", - behavior: ["-queryField -mutationField typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.person_exists)." } }, description: undefined @@ -7499,9 +7382,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7533,9 +7414,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7567,9 +7446,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7601,9 +7478,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7635,9 +7510,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7674,9 +7547,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_complex" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7701,9 +7572,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_first_post" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: "The first post by the person." }), @@ -7725,8 +7594,7 @@ const registry = makeRegistry({ name: "badly_behaved_function" }, tags: { - deprecated: "This is deprecated (comment on function c.badly_behaved_function).", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.badly_behaved_function)." } }, description: undefined @@ -7747,9 +7615,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7769,9 +7635,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7791,9 +7655,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7813,9 +7675,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7835,9 +7695,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7860,7 +7718,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["queryField -mutationField -typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -7881,9 +7739,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_query_plpgsql" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7908,9 +7764,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "person" }, description: undefined @@ -7938,7 +7792,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: undefined @@ -7960,9 +7814,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7982,9 +7834,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8009,9 +7859,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8036,9 +7884,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8063,9 +7909,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_connection" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8095,9 +7939,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8117,9 +7959,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8139,9 +7979,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8166,9 +8004,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_list" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }) diff --git a/postgraphile/postgraphile/__tests__/schema/v4/js-reserved.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/js-reserved.1.export.mjs index dba6f3ba5a..def66b1031 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/js-reserved.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/js-reserved.1.export.mjs @@ -733,6 +733,9 @@ const registryConfig_pgResources_relational_topics_relational_topics = { schemaName: "js_reserved", name: "relational_topics" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -782,6 +785,9 @@ const registryConfig_pgResources_building_building = { schemaName: "js_reserved", name: "building" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -846,6 +852,9 @@ const registryConfig_pgResources_machine_machine = { schemaName: "js_reserved", name: "machine" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -932,6 +941,9 @@ const registryConfig_pgResources_relational_status_relational_status = { schemaName: "js_reserved", name: "relational_status" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -1003,6 +1015,9 @@ const registryConfig_pgResources_relational_items_relational_items = { schemaName: "js_reserved", name: "relational_items" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { interface: "mode:relational type:type", type: spec_relationalItems.extensions.tags.type @@ -1052,9 +1067,7 @@ const registryConfig = { schemaName: "js_reserved", name: "await" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }], ["case", { @@ -1095,9 +1108,7 @@ const registryConfig = { schemaName: "js_reserved", name: "case" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }], ["valueOf", { @@ -1138,9 +1149,7 @@ const registryConfig = { schemaName: "js_reserved", name: "valueOf" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }], ["null_yield", { @@ -1186,9 +1195,7 @@ const registryConfig = { schemaName: "js_reserved", name: "null_yield" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }], ["relational_topics", registryConfig_pgResources_relational_topics_relational_topics], ["__proto__", { @@ -1207,6 +1214,9 @@ const registryConfig = { schemaName: "js_reserved", name: "__proto__" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }], ["building", registryConfig_pgResources_building_building], ["constructor", { @@ -1225,6 +1235,9 @@ const registryConfig = { schemaName: "js_reserved", name: "constructor" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }], ["crop", { @@ -1243,6 +1256,9 @@ const registryConfig = { schemaName: "js_reserved", name: "crop" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }], ["machine", registryConfig_pgResources_machine_machine], ["material", { @@ -1261,6 +1277,9 @@ const registryConfig = { schemaName: "js_reserved", name: "material" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }], ["null", { @@ -1279,6 +1298,9 @@ const registryConfig = { schemaName: "js_reserved", name: "null" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }], ["project", { @@ -1297,6 +1319,9 @@ const registryConfig = { schemaName: "js_reserved", name: "project" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }], ["relational_status", registryConfig_pgResources_relational_status_relational_status], ["yield", { @@ -1315,6 +1340,9 @@ const registryConfig = { schemaName: "js_reserved", name: "yield" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }], ["reserved", { @@ -1333,6 +1361,9 @@ const registryConfig = { schemaName: "js_reserved", name: "reserved" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }], ["relational_items", registryConfig_pgResources_relational_items_relational_items]]), diff --git a/postgraphile/postgraphile/__tests__/schema/v4/jwt.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/jwt.1.export.mjs index 4dc0f67b2f..ca91f8577a 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/jwt.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/jwt.1.export.mjs @@ -1101,9 +1101,10 @@ const resourceConfig_jwt_token = { schemaName: "b", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const authenticateFunctionIdentifer = sql.identifier("b", "authenticate"); @@ -1139,6 +1140,9 @@ const registryConfig_pgResources_types_types = { schemaName: "b", name: "types" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { foreignKey: spec_types.extensions.tags.foreignKey } @@ -1307,9 +1311,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_1" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -1341,9 +1343,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_2" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -1375,9 +1375,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_3" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -1409,9 +1407,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_4" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -1438,9 +1434,7 @@ const registry = makeRegistry({ schemaName: "b", name: "guid_fn" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -1469,6 +1463,9 @@ const registry = makeRegistry({ schemaName: "b", name: "updatable_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { uniqueKey: "x", unique: "x|@behavior -single -update -delete" @@ -1491,9 +1488,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_fail" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -1528,9 +1523,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -1567,9 +1560,7 @@ const registry = makeRegistry({ schemaName: "b", name: "list_bde_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -1604,9 +1595,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_many" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -1626,9 +1615,11 @@ const registry = makeRegistry({ schemaName: "b", name: "auth_payload" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - foreignKey: "(id) references c.person", - behavior: ["-insert", "-update", "-delete"] + foreignKey: "(id) references c.person" } } }, { @@ -1662,9 +1653,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_payload" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -1692,9 +1681,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -1722,9 +1709,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -1752,9 +1737,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -1782,9 +1765,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -1812,9 +1793,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -1835,9 +1814,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -1857,9 +1834,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -1884,9 +1859,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -1911,9 +1884,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -1933,9 +1904,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -1955,9 +1924,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }) diff --git a/postgraphile/postgraphile/__tests__/schema/v4/network_types.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/network_types.1.export.mjs index ad7d5f219a..697b963fd9 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/network_types.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/network_types.1.export.mjs @@ -169,6 +169,9 @@ const pgResource_networkPgResource = makeRegistry({ schemaName: "network_types", name: "network" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/network_types.custom.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/network_types.custom.1.export.mjs index 9d4a3b7145..c070b46ebc 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/network_types.custom.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/network_types.custom.1.export.mjs @@ -169,6 +169,9 @@ const pgResource_networkPgResource = makeRegistry({ schemaName: "network_types", name: "network" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/noDefaultMutations.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/noDefaultMutations.1.export.mjs index 6509653171..c2c3eb4a87 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/noDefaultMutations.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/noDefaultMutations.1.export.mjs @@ -2368,6 +2368,9 @@ const registryConfig_pgResources_person_secret_person_secret = { schemaName: "c", name: "person_secret" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { deprecated: "This is deprecated (comment on table c.person_secret)." } @@ -2397,6 +2400,9 @@ const registryConfig_pgResources_compound_key_compound_key = { schemaName: "c", name: "compound_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2441,6 +2447,9 @@ const registryConfig_pgResources_left_arm_left_arm = { schemaName: "c", name: "left_arm" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2469,6 +2478,9 @@ const registryConfig_pgResources_issue756_issue756 = { schemaName: "c", name: "issue756" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2526,6 +2538,9 @@ const registryConfig_pgResources_person_person = { schemaName: "c", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2676,9 +2691,7 @@ const registry = makeRegistry({ schemaName: "c", name: "current_user_id" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2700,9 +2713,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2725,9 +2736,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2750,9 +2759,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2774,9 +2781,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2799,9 +2804,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2824,9 +2827,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2848,9 +2849,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2872,9 +2871,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2901,9 +2898,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2931,9 +2926,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_one_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -2961,9 +2954,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2991,9 +2982,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_one_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -3021,9 +3010,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3050,9 +3037,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3079,9 +3064,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3108,9 +3091,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3137,9 +3118,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3166,9 +3145,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql_with_default" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3200,9 +3177,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_inout" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -3225,9 +3200,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3249,9 +3222,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3273,9 +3244,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3307,9 +3276,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_inout" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -3332,9 +3299,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3356,9 +3321,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3380,9 +3343,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3404,9 +3365,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3433,9 +3392,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_multi_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3472,9 +3429,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3511,9 +3466,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3535,9 +3488,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3564,9 +3515,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_multi_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3590,7 +3539,7 @@ const registry = makeRegistry({ }, tags: { simpleCollections: "only", - behavior: ["queryField -mutationField -typeField", "-filter -order", "+list -connection"] + behavior: ["+list -connection"] } }, description: undefined @@ -3611,6 +3560,9 @@ const registry = makeRegistry({ schemaName: "c", name: "my_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3639,6 +3591,9 @@ const registry = makeRegistry({ name: "unlogged", persistence: "u" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3659,6 +3614,9 @@ const registry = makeRegistry({ schemaName: "c", name: "null_test_record" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3685,9 +3643,7 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case_computed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3707,9 +3663,7 @@ const registry = makeRegistry({ schemaName: "c", name: "return_table_without_grants" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -3729,6 +3683,9 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3759,8 +3716,7 @@ const registry = makeRegistry({ }, tags: { arg0variant: "base", - resultFieldName: "leftArm", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "leftArm" } }, description: undefined @@ -3782,9 +3738,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -3804,9 +3758,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -3858,9 +3810,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3912,9 +3862,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3941,9 +3889,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_computed_field" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3970,9 +3916,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_compound_type" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3999,9 +3943,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_compound_type" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4038,9 +3980,7 @@ const registry = makeRegistry({ schemaName: "c", name: "query_output_two_rows" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4060,9 +4000,10 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "compound_type_set_query", @@ -4080,9 +4021,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4110,9 +4049,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4140,9 +4077,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4173,7 +4108,7 @@ const registry = makeRegistry({ notNull: true, sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] }, singleOutputParameterName: "o1" }, @@ -4204,7 +4139,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: "The first name of the person." @@ -4232,9 +4167,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_out_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4266,9 +4199,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -4301,9 +4232,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4336,8 +4265,7 @@ const registry = makeRegistry({ name: "person_exists" }, tags: { - deprecated: "This is deprecated (comment on function c.person_exists).", - behavior: ["-queryField -mutationField typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.person_exists)." } }, description: undefined @@ -4365,9 +4293,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4399,9 +4325,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4433,9 +4357,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4467,9 +4389,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4501,9 +4421,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4540,9 +4458,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_complex" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4571,9 +4487,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_first_post" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: "The first post by the person." }), @@ -4594,8 +4508,7 @@ const registry = makeRegistry({ name: "badly_behaved_function" }, tags: { - deprecated: "This is deprecated (comment on function c.badly_behaved_function).", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.badly_behaved_function)." } }, description: undefined @@ -4616,9 +4529,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4638,9 +4549,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4660,9 +4569,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4682,9 +4589,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4704,9 +4609,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4729,7 +4632,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["queryField -mutationField -typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -4750,9 +4653,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_query_plpgsql" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4777,9 +4678,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "person" }, description: undefined @@ -4807,7 +4706,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: undefined @@ -4836,9 +4735,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_connection" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4871,9 +4768,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4901,9 +4796,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_list" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }) 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 c68fdb5b58..6ba72dbe47 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.1.export.mjs @@ -557,6 +557,9 @@ const registryConfig_pgResources_studios_studios = { schemaName: "d", name: "studios" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -584,6 +587,9 @@ const registryConfig_pgResources_post_post = { schemaName: "d", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -611,6 +617,9 @@ const registryConfig_pgResources_tv_episodes_tv_episodes = { schemaName: "d", name: "tv_episodes" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -638,6 +647,9 @@ const registryConfig_pgResources_tv_shows_tv_shows = { schemaName: "d", name: "tv_shows" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -670,6 +682,9 @@ const registryConfig_pgResources_person_person = { schemaName: "d", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -712,8 +727,7 @@ const registry = makeRegistry({ name: "original_function" }, tags: { - name: "renamed_function", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "renamed_function" } }, description: undefined @@ -734,9 +748,11 @@ const registry = makeRegistry({ schemaName: "d", name: "flibble" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - name: "flamble", - behavior: ["-insert", "-update", "-delete"] + name: "flamble" } } }, { @@ -755,9 +771,7 @@ const registry = makeRegistry({ schemaName: "d", name: "getflamble" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -777,6 +791,9 @@ const registry = makeRegistry({ schemaName: "d", name: "original_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "renamed_table" } @@ -798,6 +815,9 @@ const registry = makeRegistry({ schemaName: "d", name: "films" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -821,9 +841,10 @@ const registry = makeRegistry({ schemaName: "d", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "login", @@ -848,8 +869,7 @@ const registry = makeRegistry({ }, tags: { name: "login", - resultFieldName: "token", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "token" } }, description: undefined @@ -882,7 +902,7 @@ const registry = makeRegistry({ }, tags: { fieldName: "name", - behavior: ["-queryField -mutationField typeField", "-filter -order", "+queryField"], + behavior: "+queryField", arg0variant: "nodeId" } }, @@ -910,8 +930,7 @@ const registry = makeRegistry({ name: "search_posts" }, tags: { - name: "returnPostsMatching", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "returnPostsMatching" } }, description: undefined 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 4b23846b2c..0d9abf6662 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 @@ -560,6 +560,9 @@ const registryConfig_pgResources_studios_studios = { schemaName: "d", name: "studios" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -587,6 +590,9 @@ const registryConfig_pgResources_post_post = { schemaName: "d", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -614,6 +620,9 @@ const registryConfig_pgResources_tv_episodes_tv_episodes = { schemaName: "d", name: "tv_episodes" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -641,6 +650,9 @@ const registryConfig_pgResources_tv_shows_tv_shows = { schemaName: "d", name: "tv_shows" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -673,6 +685,9 @@ const registryConfig_pgResources_person_person = { schemaName: "d", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -715,8 +730,7 @@ const registry = makeRegistry({ name: "original_function" }, tags: { - name: "renamed_function", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "renamed_function" } }, description: undefined @@ -737,9 +751,11 @@ const registry = makeRegistry({ schemaName: "d", name: "flibble" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - name: "flamble", - behavior: ["-insert", "-update", "-delete"] + name: "flamble" } } }, { @@ -758,9 +774,7 @@ const registry = makeRegistry({ schemaName: "d", name: "getflamble" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -780,6 +794,9 @@ const registry = makeRegistry({ schemaName: "d", name: "original_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "renamed_table" } @@ -801,6 +818,9 @@ const registry = makeRegistry({ schemaName: "d", name: "films" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -824,9 +844,10 @@ const registry = makeRegistry({ schemaName: "d", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "login", @@ -851,8 +872,7 @@ const registry = makeRegistry({ }, tags: { name: "login", - resultFieldName: "token", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "token" } }, description: undefined @@ -885,7 +905,7 @@ const registry = makeRegistry({ }, tags: { fieldName: "name", - behavior: ["-queryField -mutationField typeField", "-filter -order", "+queryField"], + behavior: "+queryField", arg0variant: "nodeId" } }, @@ -913,8 +933,7 @@ const registry = makeRegistry({ name: "search_posts" }, tags: { - name: "returnPostsMatching", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "returnPostsMatching" } }, description: undefined 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 b75ce153d5..2b7063db63 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 @@ -557,6 +557,9 @@ const registryConfig_pgResources_studios_studios = { schemaName: "d", name: "studios" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -584,6 +587,9 @@ const registryConfig_pgResources_post_post = { schemaName: "d", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -611,6 +617,9 @@ const registryConfig_pgResources_tv_episodes_tv_episodes = { schemaName: "d", name: "tv_episodes" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -638,6 +647,9 @@ const registryConfig_pgResources_tv_shows_tv_shows = { schemaName: "d", name: "tv_shows" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -670,6 +682,9 @@ const registryConfig_pgResources_person_person = { schemaName: "d", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -712,8 +727,7 @@ const registry = makeRegistry({ name: "original_function" }, tags: { - name: "renamed_function", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "renamed_function" } }, description: undefined @@ -734,9 +748,11 @@ const registry = makeRegistry({ schemaName: "d", name: "flibble" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - name: "flamble", - behavior: ["-insert", "-update", "-delete"] + name: "flamble" } } }, { @@ -755,9 +771,7 @@ const registry = makeRegistry({ schemaName: "d", name: "getflamble" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -777,6 +791,9 @@ const registry = makeRegistry({ schemaName: "d", name: "original_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "renamed_table" } @@ -798,6 +815,9 @@ const registry = makeRegistry({ schemaName: "d", name: "films" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -821,9 +841,10 @@ const registry = makeRegistry({ schemaName: "d", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "login", @@ -848,8 +869,7 @@ const registry = makeRegistry({ }, tags: { name: "login", - resultFieldName: "token", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "token" } }, description: undefined @@ -879,7 +899,7 @@ const registry = makeRegistry({ }, tags: { omit: "execute", - behavior: ["-queryField -mutationField typeField", "-filter -order", "-queryField -mutationField -typeField"] + behavior: ["-queryField -mutationField -typeField"] } }, description: undefined @@ -906,8 +926,7 @@ const registry = makeRegistry({ name: "search_posts" }, tags: { - name: "returnPostsMatching", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "returnPostsMatching" } }, description: undefined 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 7d3a532f0c..659c66f971 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 @@ -560,6 +560,9 @@ const registryConfig_pgResources_studios_studios = { schemaName: "d", name: "studios" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -587,6 +590,9 @@ const registryConfig_pgResources_post_post = { schemaName: "d", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -614,6 +620,9 @@ const registryConfig_pgResources_tv_episodes_tv_episodes = { schemaName: "d", name: "tv_episodes" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -641,6 +650,9 @@ const registryConfig_pgResources_tv_shows_tv_shows = { schemaName: "d", name: "tv_shows" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -673,6 +685,9 @@ const registryConfig_pgResources_person_person = { schemaName: "d", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -715,8 +730,7 @@ const registry = makeRegistry({ name: "original_function" }, tags: { - name: "renamed_function", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "renamed_function" } }, description: undefined @@ -737,9 +751,11 @@ const registry = makeRegistry({ schemaName: "d", name: "flibble" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - name: "flamble", - behavior: ["-insert", "-update", "-delete"] + name: "flamble" } } }, { @@ -758,9 +774,7 @@ const registry = makeRegistry({ schemaName: "d", name: "getflamble" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -780,6 +794,9 @@ const registry = makeRegistry({ schemaName: "d", name: "original_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "renamed_table" } @@ -801,6 +818,9 @@ const registry = makeRegistry({ schemaName: "d", name: "films" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -824,9 +844,10 @@ const registry = makeRegistry({ schemaName: "d", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "login", @@ -851,8 +872,7 @@ const registry = makeRegistry({ }, tags: { name: "login", - resultFieldName: "token", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "token" } }, description: undefined @@ -885,7 +905,7 @@ const registry = makeRegistry({ }, tags: { fieldName: "name", - behavior: ["-queryField -mutationField typeField", "-filter -order", "+queryField"], + behavior: "+queryField", arg0variant: "nodeId" } }, @@ -913,8 +933,7 @@ const registry = makeRegistry({ name: "search_posts" }, tags: { - name: "returnPostsMatching", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "returnPostsMatching" } }, description: undefined 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 e2f90e0699..ab1bcbbb77 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 @@ -563,6 +563,9 @@ const registryConfig_pgResources_studios_studios = { schemaName: "d", name: "studios" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -590,6 +593,9 @@ const registryConfig_pgResources_post_post = { schemaName: "d", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -617,6 +623,9 @@ const registryConfig_pgResources_tv_episodes_tv_episodes = { schemaName: "d", name: "tv_episodes" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -644,6 +653,9 @@ const registryConfig_pgResources_tv_shows_tv_shows = { schemaName: "d", name: "tv_shows" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -676,6 +688,9 @@ const registryConfig_pgResources_person_person = { schemaName: "d", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -718,8 +733,7 @@ const registry = makeRegistry({ name: "original_function" }, tags: { - name: "renamed_function", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "renamed_function" } }, description: undefined @@ -740,9 +754,11 @@ const registry = makeRegistry({ schemaName: "d", name: "flibble" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - name: "flamble", - behavior: ["-insert", "-update", "-delete"] + name: "flamble" } } }, { @@ -761,9 +777,7 @@ const registry = makeRegistry({ schemaName: "d", name: "getflamble" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -783,6 +797,9 @@ const registry = makeRegistry({ schemaName: "d", name: "original_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "renamed_table" } @@ -804,6 +821,9 @@ const registry = makeRegistry({ schemaName: "d", name: "films" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -827,9 +847,10 @@ const registry = makeRegistry({ schemaName: "d", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "login", @@ -854,8 +875,7 @@ const registry = makeRegistry({ }, tags: { name: "login", - resultFieldName: "token", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "token" } }, description: undefined @@ -888,7 +908,7 @@ const registry = makeRegistry({ }, tags: { fieldName: "name", - behavior: ["-queryField -mutationField typeField", "-filter -order", "+queryField"], + behavior: "+queryField", arg0variant: "nodeId" } }, @@ -916,8 +936,7 @@ const registry = makeRegistry({ name: "search_posts" }, tags: { - name: "returnPostsMatching", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "returnPostsMatching" } }, description: undefined 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 9d0200626c..66d266b727 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 @@ -560,6 +560,9 @@ const registryConfig_pgResources_studios_studios = { schemaName: "d", name: "studios" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -587,6 +590,9 @@ const registryConfig_pgResources_post_post = { schemaName: "d", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -614,6 +620,9 @@ const registryConfig_pgResources_tv_episodes_tv_episodes = { schemaName: "d", name: "tv_episodes" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -641,6 +650,9 @@ const registryConfig_pgResources_tv_shows_tv_shows = { schemaName: "d", name: "tv_shows" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -673,6 +685,9 @@ const registryConfig_pgResources_person_person = { schemaName: "d", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -715,8 +730,7 @@ const registry = makeRegistry({ name: "original_function" }, tags: { - name: "renamed_function", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "renamed_function" } }, description: undefined @@ -737,9 +751,11 @@ const registry = makeRegistry({ schemaName: "d", name: "flibble" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - name: "flamble", - behavior: ["-insert", "-update", "-delete"] + name: "flamble" } } }, { @@ -758,9 +774,7 @@ const registry = makeRegistry({ schemaName: "d", name: "getflamble" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -780,6 +794,9 @@ const registry = makeRegistry({ schemaName: "d", name: "original_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "renamed_table" } @@ -801,6 +818,9 @@ const registry = makeRegistry({ schemaName: "d", name: "films" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -824,9 +844,10 @@ const registry = makeRegistry({ schemaName: "d", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "login", @@ -851,8 +872,7 @@ const registry = makeRegistry({ }, tags: { name: "login", - resultFieldName: "token", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "token" } }, description: undefined @@ -885,7 +905,7 @@ const registry = makeRegistry({ }, tags: { fieldName: "name", - behavior: ["-queryField -mutationField typeField", "-filter -order", "+queryField"], + behavior: "+queryField", arg0variant: "nodeId" } }, @@ -913,8 +933,7 @@ const registry = makeRegistry({ name: "search_posts" }, tags: { - name: "returnPostsMatching", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "returnPostsMatching" } }, description: undefined 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 ca0288f4db..df33b2099f 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 @@ -560,6 +560,9 @@ const registryConfig_pgResources_studios_studios = { schemaName: "d", name: "studios" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -587,6 +590,9 @@ const registryConfig_pgResources_post_post = { schemaName: "d", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -614,6 +620,9 @@ const registryConfig_pgResources_tv_episodes_tv_episodes = { schemaName: "d", name: "tv_episodes" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -641,6 +650,9 @@ const registryConfig_pgResources_tv_shows_tv_shows = { schemaName: "d", name: "tv_shows" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -673,6 +685,9 @@ const registryConfig_pgResources_person_person = { schemaName: "d", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -715,8 +730,7 @@ const registry = makeRegistry({ name: "original_function" }, tags: { - name: "renamed_function", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "renamed_function" } }, description: undefined @@ -737,9 +751,11 @@ const registry = makeRegistry({ schemaName: "d", name: "flibble" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - name: "flamble", - behavior: ["-insert", "-update", "-delete"] + name: "flamble" } } }, { @@ -758,9 +774,7 @@ const registry = makeRegistry({ schemaName: "d", name: "getflamble" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -780,6 +794,9 @@ const registry = makeRegistry({ schemaName: "d", name: "original_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "renamed_table" } @@ -801,6 +818,9 @@ const registry = makeRegistry({ schemaName: "d", name: "films" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -824,9 +844,10 @@ const registry = makeRegistry({ schemaName: "d", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "login", @@ -851,8 +872,7 @@ const registry = makeRegistry({ }, tags: { name: "login", - resultFieldName: "token", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "token" } }, description: undefined @@ -885,7 +905,7 @@ const registry = makeRegistry({ }, tags: { fieldName: "name", - behavior: ["-queryField -mutationField typeField", "-filter -order", "+queryField"], + behavior: "+queryField", arg0variant: "nodeId" } }, @@ -913,8 +933,7 @@ const registry = makeRegistry({ name: "search_posts" }, tags: { - name: "returnPostsMatching", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "returnPostsMatching" } }, description: undefined 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 89aee1fbfc..0c65164886 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 @@ -560,6 +560,9 @@ const registryConfig_pgResources_studios_studios = { schemaName: "d", name: "studios" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -587,6 +590,9 @@ const registryConfig_pgResources_post_post = { schemaName: "d", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -614,6 +620,9 @@ const registryConfig_pgResources_tv_episodes_tv_episodes = { schemaName: "d", name: "tv_episodes" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -641,6 +650,9 @@ const registryConfig_pgResources_tv_shows_tv_shows = { schemaName: "d", name: "tv_shows" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -673,6 +685,9 @@ const registryConfig_pgResources_person_person = { schemaName: "d", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -715,8 +730,7 @@ const registry = makeRegistry({ name: "original_function" }, tags: { - name: "renamed_function", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "renamed_function" } }, description: undefined @@ -737,9 +751,11 @@ const registry = makeRegistry({ schemaName: "d", name: "flibble" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - name: "flamble", - behavior: ["-insert", "-update", "-delete"] + name: "flamble" } } }, { @@ -758,9 +774,7 @@ const registry = makeRegistry({ schemaName: "d", name: "getflamble" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -780,6 +794,9 @@ const registry = makeRegistry({ schemaName: "d", name: "original_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "renamed_table" } @@ -801,6 +818,9 @@ const registry = makeRegistry({ schemaName: "d", name: "films" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "create,update,delete", behavior: spec_films.extensions.tags.behavior @@ -827,9 +847,10 @@ const registry = makeRegistry({ schemaName: "d", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "login", @@ -854,8 +875,7 @@ const registry = makeRegistry({ }, tags: { name: "login", - resultFieldName: "token", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "token" } }, description: undefined @@ -888,7 +908,7 @@ const registry = makeRegistry({ }, tags: { fieldName: "name", - behavior: ["-queryField -mutationField typeField", "-filter -order", "+queryField"], + behavior: "+queryField", arg0variant: "nodeId" } }, @@ -916,8 +936,7 @@ const registry = makeRegistry({ name: "search_posts" }, tags: { - name: "returnPostsMatching", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "returnPostsMatching" } }, description: undefined 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 a100f44e7b..80fa57ce3e 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 @@ -560,6 +560,9 @@ const registryConfig_pgResources_studios_studios = { schemaName: "d", name: "studios" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -587,6 +590,9 @@ const registryConfig_pgResources_post_post = { schemaName: "d", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -614,6 +620,9 @@ const registryConfig_pgResources_tv_episodes_tv_episodes = { schemaName: "d", name: "tv_episodes" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "many", behavior: spec_tvEpisodes.extensions.tags.behavior @@ -644,6 +653,9 @@ const registryConfig_pgResources_tv_shows_tv_shows = { schemaName: "d", name: "tv_shows" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -676,6 +688,9 @@ const registryConfig_pgResources_person_person = { schemaName: "d", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -718,8 +733,7 @@ const registry = makeRegistry({ name: "original_function" }, tags: { - name: "renamed_function", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "renamed_function" } }, description: undefined @@ -740,9 +754,11 @@ const registry = makeRegistry({ schemaName: "d", name: "flibble" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - name: "flamble", - behavior: ["-insert", "-update", "-delete"] + name: "flamble" } } }, { @@ -761,9 +777,7 @@ const registry = makeRegistry({ schemaName: "d", name: "getflamble" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -783,6 +797,9 @@ const registry = makeRegistry({ schemaName: "d", name: "original_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "renamed_table" } @@ -804,6 +821,9 @@ const registry = makeRegistry({ schemaName: "d", name: "films" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -827,9 +847,10 @@ const registry = makeRegistry({ schemaName: "d", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "login", @@ -854,8 +875,7 @@ const registry = makeRegistry({ }, tags: { name: "login", - resultFieldName: "token", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "token" } }, description: undefined @@ -888,7 +908,7 @@ const registry = makeRegistry({ }, tags: { fieldName: "name", - behavior: ["-queryField -mutationField typeField", "-filter -order", "+queryField"], + behavior: "+queryField", arg0variant: "nodeId" } }, @@ -916,8 +936,7 @@ const registry = makeRegistry({ name: "search_posts" }, tags: { - name: "returnPostsMatching", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "returnPostsMatching" } }, description: undefined 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 6074ae540e..176983f0a5 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 @@ -555,6 +555,9 @@ const registryConfig_pgResources_studios_studios = { schemaName: "d", name: "studios" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -582,6 +585,9 @@ const registryConfig_pgResources_post_post = { schemaName: "d", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -609,6 +615,9 @@ const registryConfig_pgResources_tv_episodes_tv_episodes = { schemaName: "d", name: "tv_episodes" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -635,6 +644,9 @@ const registryConfig_pgResources_tv_shows_tv_shows = { schemaName: "d", name: "tv_shows" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: true, behavior: spec_tvShows.extensions.tags.behavior @@ -670,6 +682,9 @@ const registryConfig_pgResources_person_person = { schemaName: "d", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -712,8 +727,7 @@ const registry = makeRegistry({ name: "original_function" }, tags: { - name: "renamed_function", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "renamed_function" } }, description: undefined @@ -734,9 +748,11 @@ const registry = makeRegistry({ schemaName: "d", name: "flibble" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - name: "flamble", - behavior: ["-insert", "-update", "-delete"] + name: "flamble" } } }, { @@ -755,9 +771,7 @@ const registry = makeRegistry({ schemaName: "d", name: "getflamble" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -777,6 +791,9 @@ const registry = makeRegistry({ schemaName: "d", name: "original_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "renamed_table" } @@ -805,6 +822,9 @@ const registry = makeRegistry({ schemaName: "d", name: "films" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "*", behavior: spec_films.extensions.tags.behavior @@ -831,9 +851,10 @@ const registry = makeRegistry({ schemaName: "d", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "login", @@ -858,8 +879,7 @@ const registry = makeRegistry({ }, tags: { name: "login", - resultFieldName: "token", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "token" } }, description: undefined @@ -892,7 +912,7 @@ const registry = makeRegistry({ }, tags: { fieldName: "name", - behavior: ["-queryField -mutationField typeField", "-filter -order", "+queryField"], + behavior: "+queryField", arg0variant: "nodeId" } }, @@ -920,8 +940,7 @@ const registry = makeRegistry({ name: "search_posts" }, tags: { - name: "returnPostsMatching", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "returnPostsMatching" } }, description: undefined 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 2b1bc44774..f40afd84e4 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 @@ -560,6 +560,9 @@ const registryConfig_pgResources_studios_studios = { schemaName: "d", name: "studios" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -587,6 +590,9 @@ const registryConfig_pgResources_post_post = { schemaName: "d", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -614,6 +620,9 @@ const registryConfig_pgResources_tv_episodes_tv_episodes = { schemaName: "d", name: "tv_episodes" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -641,6 +650,9 @@ const registryConfig_pgResources_tv_shows_tv_shows = { schemaName: "d", name: "tv_shows" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -673,6 +685,9 @@ const registryConfig_pgResources_person_person = { schemaName: "d", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -715,8 +730,7 @@ const registry = makeRegistry({ name: "original_function" }, tags: { - name: "renamed_function", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "renamed_function" } }, description: undefined @@ -737,9 +751,11 @@ const registry = makeRegistry({ schemaName: "d", name: "flibble" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - name: "flamble", - behavior: ["-insert", "-update", "-delete"] + name: "flamble" } } }, { @@ -758,9 +774,7 @@ const registry = makeRegistry({ schemaName: "d", name: "getflamble" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -780,6 +794,9 @@ const registry = makeRegistry({ schemaName: "d", name: "original_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "renamed_table" } @@ -801,6 +818,9 @@ const registry = makeRegistry({ schemaName: "d", name: "films" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "create", behavior: spec_films.extensions.tags.behavior @@ -827,9 +847,10 @@ const registry = makeRegistry({ schemaName: "d", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "login", @@ -854,8 +875,7 @@ const registry = makeRegistry({ }, tags: { name: "login", - resultFieldName: "token", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "token" } }, description: undefined @@ -888,7 +908,7 @@ const registry = makeRegistry({ }, tags: { fieldName: "name", - behavior: ["-queryField -mutationField typeField", "-filter -order", "+queryField"], + behavior: "+queryField", arg0variant: "nodeId" } }, @@ -916,8 +936,7 @@ const registry = makeRegistry({ name: "search_posts" }, tags: { - name: "returnPostsMatching", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "returnPostsMatching" } }, description: undefined 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 1c92389a41..642bdf57d1 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 @@ -560,6 +560,9 @@ const registryConfig_pgResources_studios_studios = { schemaName: "d", name: "studios" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -587,6 +590,9 @@ const registryConfig_pgResources_post_post = { schemaName: "d", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -614,6 +620,9 @@ const registryConfig_pgResources_tv_episodes_tv_episodes = { schemaName: "d", name: "tv_episodes" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -641,6 +650,9 @@ const registryConfig_pgResources_tv_shows_tv_shows = { schemaName: "d", name: "tv_shows" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -673,6 +685,9 @@ const registryConfig_pgResources_person_person = { schemaName: "d", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -715,8 +730,7 @@ const registry = makeRegistry({ name: "original_function" }, tags: { - name: "renamed_function", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "renamed_function" } }, description: undefined @@ -737,9 +751,11 @@ const registry = makeRegistry({ schemaName: "d", name: "flibble" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - name: "flamble", - behavior: ["-insert", "-update", "-delete"] + name: "flamble" } } }, { @@ -758,9 +774,7 @@ const registry = makeRegistry({ schemaName: "d", name: "getflamble" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -780,6 +794,9 @@ const registry = makeRegistry({ schemaName: "d", name: "original_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "renamed_table" } @@ -801,6 +818,9 @@ const registry = makeRegistry({ schemaName: "d", name: "films" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "delete", behavior: spec_films.extensions.tags.behavior @@ -827,9 +847,10 @@ const registry = makeRegistry({ schemaName: "d", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "login", @@ -854,8 +875,7 @@ const registry = makeRegistry({ }, tags: { name: "login", - resultFieldName: "token", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "token" } }, description: undefined @@ -888,7 +908,7 @@ const registry = makeRegistry({ }, tags: { fieldName: "name", - behavior: ["-queryField -mutationField typeField", "-filter -order", "+queryField"], + behavior: "+queryField", arg0variant: "nodeId" } }, @@ -916,8 +936,7 @@ const registry = makeRegistry({ name: "search_posts" }, tags: { - name: "returnPostsMatching", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "returnPostsMatching" } }, description: undefined 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 590639f91b..505dd0a390 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 @@ -552,6 +552,9 @@ const registryConfig_pgResources_studios_studios = { schemaName: "d", name: "studios" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -579,6 +582,9 @@ const registryConfig_pgResources_post_post = { schemaName: "d", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -606,6 +612,9 @@ const registryConfig_pgResources_tv_episodes_tv_episodes = { schemaName: "d", name: "tv_episodes" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -633,6 +642,9 @@ const registryConfig_pgResources_tv_shows_tv_shows = { schemaName: "d", name: "tv_shows" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -665,6 +677,9 @@ const registryConfig_pgResources_person_person = { schemaName: "d", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -707,8 +722,7 @@ const registry = makeRegistry({ name: "original_function" }, tags: { - name: "renamed_function", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "renamed_function" } }, description: undefined @@ -729,9 +743,11 @@ const registry = makeRegistry({ schemaName: "d", name: "flibble" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - name: "flamble", - behavior: ["-insert", "-update", "-delete"] + name: "flamble" } } }, { @@ -750,9 +766,7 @@ const registry = makeRegistry({ schemaName: "d", name: "getflamble" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -772,6 +786,9 @@ const registry = makeRegistry({ schemaName: "d", name: "original_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "renamed_table" } @@ -800,6 +817,9 @@ const registry = makeRegistry({ schemaName: "d", name: "films" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "read,all,update,create,delete,many", behavior: spec_films.extensions.tags.behavior @@ -826,9 +846,10 @@ const registry = makeRegistry({ schemaName: "d", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "login", @@ -853,8 +874,7 @@ const registry = makeRegistry({ }, tags: { name: "login", - resultFieldName: "token", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "token" } }, description: undefined @@ -887,7 +907,7 @@ const registry = makeRegistry({ }, tags: { fieldName: "name", - behavior: ["-queryField -mutationField typeField", "-filter -order", "+queryField"], + behavior: "+queryField", arg0variant: "nodeId" } }, @@ -915,8 +935,7 @@ const registry = makeRegistry({ name: "search_posts" }, tags: { - name: "returnPostsMatching", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "returnPostsMatching" } }, description: undefined 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 f04ff33f80..b5f8717448 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 @@ -560,6 +560,9 @@ const registryConfig_pgResources_studios_studios = { schemaName: "d", name: "studios" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -587,6 +590,9 @@ const registryConfig_pgResources_post_post = { schemaName: "d", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -614,6 +620,9 @@ const registryConfig_pgResources_tv_episodes_tv_episodes = { schemaName: "d", name: "tv_episodes" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -641,6 +650,9 @@ const registryConfig_pgResources_tv_shows_tv_shows = { schemaName: "d", name: "tv_shows" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -673,6 +685,9 @@ const registryConfig_pgResources_person_person = { schemaName: "d", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -715,8 +730,7 @@ const registry = makeRegistry({ name: "original_function" }, tags: { - name: "renamed_function", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "renamed_function" } }, description: undefined @@ -737,9 +751,11 @@ const registry = makeRegistry({ schemaName: "d", name: "flibble" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - name: "flamble", - behavior: ["-insert", "-update", "-delete"] + name: "flamble" } } }, { @@ -758,9 +774,7 @@ const registry = makeRegistry({ schemaName: "d", name: "getflamble" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -780,6 +794,9 @@ const registry = makeRegistry({ schemaName: "d", name: "original_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "renamed_table" } @@ -801,6 +818,9 @@ const registry = makeRegistry({ schemaName: "d", name: "films" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "update", behavior: spec_films.extensions.tags.behavior @@ -827,9 +847,10 @@ const registry = makeRegistry({ schemaName: "d", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "login", @@ -854,8 +875,7 @@ const registry = makeRegistry({ }, tags: { name: "login", - resultFieldName: "token", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "token" } }, description: undefined @@ -888,7 +908,7 @@ const registry = makeRegistry({ }, tags: { fieldName: "name", - behavior: ["-queryField -mutationField typeField", "-filter -order", "+queryField"], + behavior: "+queryField", arg0variant: "nodeId" } }, @@ -916,8 +936,7 @@ const registry = makeRegistry({ name: "search_posts" }, tags: { - name: "returnPostsMatching", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "returnPostsMatching" } }, description: undefined 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 532ec30684..3bb3cecf28 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 @@ -560,6 +560,9 @@ const registryConfig_pgResources_studios_studios = { schemaName: "d", name: "studios" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -587,6 +590,9 @@ const registryConfig_pgResources_post_post = { schemaName: "d", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -614,6 +620,9 @@ const registryConfig_pgResources_tv_episodes_tv_episodes = { schemaName: "d", name: "tv_episodes" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -640,6 +649,9 @@ const registryConfig_pgResources_tv_shows_tv_shows = { schemaName: "d", name: "tv_shows" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "order", behavior: spec_tvShows.extensions.tags.behavior @@ -675,6 +687,9 @@ const registryConfig_pgResources_person_person = { schemaName: "d", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -717,8 +732,7 @@ const registry = makeRegistry({ name: "original_function" }, tags: { - name: "renamed_function", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "renamed_function" } }, description: undefined @@ -739,9 +753,11 @@ const registry = makeRegistry({ schemaName: "d", name: "flibble" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - name: "flamble", - behavior: ["-insert", "-update", "-delete"] + name: "flamble" } } }, { @@ -760,9 +776,7 @@ const registry = makeRegistry({ schemaName: "d", name: "getflamble" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -782,6 +796,9 @@ const registry = makeRegistry({ schemaName: "d", name: "original_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "renamed_table" } @@ -803,6 +820,9 @@ const registry = makeRegistry({ schemaName: "d", name: "films" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -826,9 +846,10 @@ const registry = makeRegistry({ schemaName: "d", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "login", @@ -853,8 +874,7 @@ const registry = makeRegistry({ }, tags: { name: "login", - resultFieldName: "token", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "token" } }, description: undefined @@ -887,7 +907,7 @@ const registry = makeRegistry({ }, tags: { fieldName: "name", - behavior: ["-queryField -mutationField typeField", "-filter -order", "+queryField"], + behavior: "+queryField", arg0variant: "nodeId" } }, @@ -915,8 +935,7 @@ const registry = makeRegistry({ name: "search_posts" }, tags: { - name: "returnPostsMatching", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "returnPostsMatching" } }, description: undefined diff --git a/postgraphile/postgraphile/__tests__/schema/v4/partitions.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/partitions.1.export.mjs index fbdc5856c3..39981f2fe5 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/partitions.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/partitions.1.export.mjs @@ -191,6 +191,9 @@ const registryConfig_pgResources_users_users = { schemaName: "partitions", name: "users" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -218,6 +221,9 @@ const registryConfig_pgResources_measurements_measurements = { schemaName: "partitions", name: "measurements" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; diff --git a/postgraphile/postgraphile/__tests__/schema/v4/pg11.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/pg11.1.export.mjs index 7cf7779813..32d3aaeef5 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/pg11.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/pg11.1.export.mjs @@ -86,9 +86,9 @@ const spec_alwaysAsIdentity = { notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-attribute:insert -attribute:update"] - } + tags: {}, + isInsertable: false, + isUpdatable: false } }, t: { @@ -539,6 +539,9 @@ const registry = makeRegistry({ schemaName: "pg11", name: "always_as_identity" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -558,6 +561,9 @@ const registry = makeRegistry({ schemaName: "pg11", name: "by_default_as_identity" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -577,6 +583,9 @@ const registry = makeRegistry({ schemaName: "pg11", name: "network" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -596,6 +605,9 @@ const registry = makeRegistry({ schemaName: "pg11", name: "types" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/pg11.custom.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/pg11.custom.1.export.mjs index 625f668140..e3a58b9bd9 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/pg11.custom.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/pg11.custom.1.export.mjs @@ -86,9 +86,9 @@ const spec_alwaysAsIdentity = { notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-attribute:insert -attribute:update"] - } + tags: {}, + isInsertable: false, + isUpdatable: false } }, t: { @@ -539,6 +539,9 @@ const registry = makeRegistry({ schemaName: "pg11", name: "always_as_identity" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -558,6 +561,9 @@ const registry = makeRegistry({ schemaName: "pg11", name: "by_default_as_identity" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -577,6 +583,9 @@ const registry = makeRegistry({ schemaName: "pg11", name: "network" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -596,6 +605,9 @@ const registry = makeRegistry({ schemaName: "pg11", name: "types" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/polymorphic.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/polymorphic.1.export.mjs index 9d40bf4637..74cd99272e 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/polymorphic.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/polymorphic.1.export.mjs @@ -2341,6 +2341,9 @@ const registryConfig_pgResources_aws_application_first_party_vulnerabilities_aws schemaName: "polymorphic", name: "aws_application_first_party_vulnerabilities" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: true, behavior: spec_awsApplicationFirstPartyVulnerabilities.extensions.tags.behavior @@ -2370,6 +2373,9 @@ const registryConfig_pgResources_aws_application_third_party_vulnerabilities_aws schemaName: "polymorphic", name: "aws_application_third_party_vulnerabilities" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: true, behavior: spec_awsApplicationThirdPartyVulnerabilities.extensions.tags.behavior @@ -2399,6 +2405,9 @@ const registryConfig_pgResources_gcp_application_first_party_vulnerabilities_gcp schemaName: "polymorphic", name: "gcp_application_first_party_vulnerabilities" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: true, behavior: spec_gcpApplicationFirstPartyVulnerabilities.extensions.tags.behavior @@ -2428,6 +2437,9 @@ const registryConfig_pgResources_gcp_application_third_party_vulnerabilities_gcp schemaName: "polymorphic", name: "gcp_application_third_party_vulnerabilities" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: true, behavior: spec_gcpApplicationThirdPartyVulnerabilities.extensions.tags.behavior @@ -2465,6 +2477,9 @@ const registryConfig_pgResources_organizations_organizations = { schemaName: "polymorphic", name: "organizations" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { unionMember: "PersonOrOrganization" } @@ -2501,6 +2516,9 @@ const registryConfig_pgResources_people_people = { schemaName: "polymorphic", name: "people" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { unionMember: "PersonOrOrganization", ref: "applications to:Application", @@ -2531,6 +2549,9 @@ const registryConfig_pgResources_priorities_priorities = { schemaName: "polymorphic", name: "priorities" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "create,update,delete,filter,order", behavior: spec_priorities.extensions.tags.behavior @@ -2561,6 +2582,9 @@ const registryConfig_pgResources_relational_checklists_relational_checklists = { schemaName: "polymorphic", name: "relational_checklists" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2588,6 +2612,9 @@ const registryConfig_pgResources_relational_item_relation_composite_pks_relation schemaName: "polymorphic", name: "relational_item_relation_composite_pks" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2615,6 +2642,9 @@ const registryConfig_pgResources_relational_topics_relational_topics = { schemaName: "polymorphic", name: "relational_topics" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2642,6 +2672,9 @@ const registryConfig_pgResources_single_table_item_relation_composite_pks_single schemaName: "polymorphic", name: "single_table_item_relation_composite_pks" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2669,6 +2702,9 @@ const registryConfig_pgResources_relational_checklist_items_relational_checklist schemaName: "polymorphic", name: "relational_checklist_items" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2696,6 +2732,9 @@ const registryConfig_pgResources_relational_dividers_relational_dividers = { schemaName: "polymorphic", name: "relational_dividers" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2730,6 +2769,9 @@ const registryConfig_pgResources_relational_item_relations_relational_item_relat schemaName: "polymorphic", name: "relational_item_relations" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2764,6 +2806,9 @@ const registryConfig_pgResources_single_table_item_relations_single_table_item_r schemaName: "polymorphic", name: "single_table_item_relations" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2791,6 +2836,9 @@ const registryConfig_pgResources_log_entries_log_entries = { schemaName: "polymorphic", name: "log_entries" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { ref: "author to:PersonOrOrganization singular", refVia: spec_logEntries.extensions.tags.refVia @@ -2821,6 +2869,9 @@ const registryConfig_pgResources_relational_posts_relational_posts = { schemaName: "polymorphic", name: "relational_posts" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2848,6 +2899,9 @@ const registryConfig_pgResources_first_party_vulnerabilities_first_party_vulnera schemaName: "polymorphic", name: "first_party_vulnerabilities" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { implements: "Vulnerability", ref: spec_firstPartyVulnerabilities.extensions.tags.ref, @@ -2879,6 +2933,9 @@ const registryConfig_pgResources_third_party_vulnerabilities_third_party_vulnera schemaName: "polymorphic", name: "third_party_vulnerabilities" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { implements: "Vulnerability", ref: spec_thirdPartyVulnerabilities.extensions.tags.ref, @@ -2910,6 +2967,9 @@ const registryConfig_pgResources_aws_applications_aws_applications = { schemaName: "polymorphic", name: "aws_applications" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { implements: "Application", ref: spec_awsApplications.extensions.tags.ref, @@ -2941,6 +3001,9 @@ const registryConfig_pgResources_gcp_applications_gcp_applications = { schemaName: "polymorphic", name: "gcp_applications" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { implements: "Application", ref: spec_gcpApplications.extensions.tags.ref, @@ -2973,6 +3036,9 @@ const registryConfig_pgResources_single_table_items_single_table_items = { schemaName: "polymorphic", name: "single_table_items" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { interface: "mode:single type:type", type: spec_singleTableItems.extensions.tags.type, @@ -3006,6 +3072,9 @@ const registryConfig_pgResources_relational_items_relational_items = { schemaName: "polymorphic", name: "relational_items" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { interface: "mode:relational", type: spec_relationalItems.extensions.tags.type @@ -3102,8 +3171,7 @@ const registryConfig = { name: "custom_delete_relational_item" }, tags: { - arg0variant: "nodeId", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + arg0variant: "nodeId" } }, description: undefined @@ -3125,9 +3193,7 @@ const registryConfig = { schemaName: "polymorphic", name: "all_single_tables" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -3153,8 +3219,7 @@ const registryConfig = { name: "get_single_table_topic_by_id" }, tags: { - returnType: "SingleTableTopic", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + returnType: "SingleTableTopic" } }, description: undefined diff --git a/postgraphile/postgraphile/__tests__/schema/v4/rbac.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/rbac.1.export.mjs index d975e7341f..7c9ad0e757 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/rbac.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/rbac.1.export.mjs @@ -470,9 +470,10 @@ const nonUpdatableViewCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -499,9 +500,10 @@ const inputsCodec = recordCodec({ notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -528,9 +530,10 @@ const patchsCodec = recordCodec({ notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -557,9 +560,10 @@ const reservedCodec = recordCodec({ notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -586,9 +590,10 @@ const reservedPatchsCodec = recordCodec({ notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -615,9 +620,10 @@ const reservedInputCodec = recordCodec({ notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -644,9 +650,10 @@ const defaultValueCodec = recordCodec({ notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, null_value: { @@ -655,9 +662,10 @@ const defaultValueCodec = recordCodec({ notNull: false, hasDefault: true, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -684,9 +692,10 @@ const noPrimaryKeyCodec = recordCodec({ notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, str: { @@ -695,9 +704,10 @@ const noPrimaryKeyCodec = recordCodec({ notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -714,7 +724,7 @@ const noPrimaryKeyCodec = recordCodec({ executor: executor }); const uniqueForeignKeyIdentifier = sql.identifier("a", "unique_foreign_key"); -const uniqueForeignKeyCodec = recordCodec({ +const spec_uniqueForeignKey = { name: "uniqueForeignKey", identifier: uniqueForeignKeyIdentifier, attributes: Object.assign(Object.create(null), { @@ -724,9 +734,10 @@ const uniqueForeignKeyCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, compound_key_2: { @@ -735,9 +746,10 @@ const uniqueForeignKeyCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -755,7 +767,8 @@ const uniqueForeignKeyCodec = recordCodec({ }) }, executor: executor -}); +}; +const uniqueForeignKeyCodec = recordCodec(spec_uniqueForeignKey); const myTableIdentifier = sql.identifier("c", "my_table"); const myTableCodec = recordCodec({ name: "myTable", @@ -767,9 +780,10 @@ const myTableCodec = recordCodec({ notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, json_data: { @@ -778,9 +792,10 @@ const myTableCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -807,9 +822,10 @@ const spec_personSecret = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: true, + canInsert: false, + canUpdate: false } }, sekrit: { @@ -819,9 +835,11 @@ const spec_personSecret = { hasDefault: false, extensions: { tags: { - name: "secret", - behavior: ["-update"] - } + name: "secret" + }, + canSelect: true, + canInsert: true, + canUpdate: false } } }), @@ -851,9 +869,10 @@ const unloggedCodec = recordCodec({ notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, nonsense: { @@ -862,9 +881,10 @@ const unloggedCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -892,9 +912,10 @@ const foreignKeyCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, compound_key_1: { @@ -903,9 +924,10 @@ const foreignKeyCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, compound_key_2: { @@ -914,9 +936,10 @@ const foreignKeyCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -943,9 +966,10 @@ const testviewCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, col1: { @@ -954,9 +978,10 @@ const testviewCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, col2: { @@ -965,9 +990,10 @@ const testviewCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -983,6 +1009,19 @@ const testviewCodec = recordCodec({ }, executor: executor }); +const uuidArrayCodec = listOfCodec(TYPES.uuid, { + extensions: { + pg: { + serviceName: "main", + schemaName: "pg_catalog", + name: "_uuid" + }, + tags: Object.create(null) + }, + typeDelim: ",", + description: undefined, + name: "uuidArray" +}); const viewTableIdentifier = sql.identifier("a", "view_table"); const viewTableCodec = recordCodec({ name: "viewTable", @@ -994,9 +1033,10 @@ const viewTableCodec = recordCodec({ notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, col1: { @@ -1005,9 +1045,10 @@ const viewTableCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, col2: { @@ -1016,9 +1057,10 @@ const viewTableCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -1045,9 +1087,10 @@ const compoundKeyCodec = recordCodec({ notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, person_id_1: { @@ -1056,9 +1099,10 @@ const compoundKeyCodec = recordCodec({ notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, extra: { @@ -1067,9 +1111,10 @@ const compoundKeyCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -1085,19 +1130,6 @@ const compoundKeyCodec = recordCodec({ }, executor: executor }); -const uuidArrayCodec = listOfCodec(TYPES.uuid, { - extensions: { - pg: { - serviceName: "main", - schemaName: "pg_catalog", - name: "_uuid" - }, - tags: Object.create(null) - }, - typeDelim: ",", - description: undefined, - name: "uuidArray" -}); const similarTable1Identifier = sql.identifier("a", "similar_table_1"); const similarTable1Codec = recordCodec({ name: "similarTable1", @@ -1109,9 +1141,10 @@ const similarTable1Codec = recordCodec({ notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, col1: { @@ -1120,9 +1153,10 @@ const similarTable1Codec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, col2: { @@ -1131,9 +1165,10 @@ const similarTable1Codec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, col3: { @@ -1142,9 +1177,10 @@ const similarTable1Codec = recordCodec({ notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -1171,9 +1207,10 @@ const similarTable2Codec = recordCodec({ notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, col3: { @@ -1182,9 +1219,10 @@ const similarTable2Codec = recordCodec({ notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, col4: { @@ -1193,9 +1231,10 @@ const similarTable2Codec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, col5: { @@ -1204,9 +1243,10 @@ const similarTable2Codec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -1233,9 +1273,10 @@ const updatableViewCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, name: { @@ -1244,9 +1285,10 @@ const updatableViewCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, description: { @@ -1255,9 +1297,10 @@ const updatableViewCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, constant: { @@ -1266,9 +1309,10 @@ const updatableViewCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -1298,9 +1342,10 @@ const nullTestRecordCodec = recordCodec({ notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, nullable_text: { @@ -1309,9 +1354,10 @@ const nullTestRecordCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, nullable_int: { @@ -1320,9 +1366,10 @@ const nullTestRecordCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, non_null_text: { @@ -1331,9 +1378,10 @@ const nullTestRecordCodec = recordCodec({ notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -1360,9 +1408,10 @@ const edgeCaseCodec = recordCodec({ notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, wont_cast_easy: { @@ -1371,9 +1420,10 @@ const edgeCaseCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, row_id: { @@ -1382,9 +1432,10 @@ const edgeCaseCodec = recordCodec({ notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -1400,6 +1451,60 @@ const edgeCaseCodec = recordCodec({ }, executor: executor }); +const issue756Identifier = sql.identifier("c", "issue756"); +const notNullTimestampCodec = domainOfCodec(TYPES.timestamptz, "notNullTimestamp", sql.identifier("c", "not_null_timestamp"), { + description: undefined, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "not_null_timestamp" + }, + tags: Object.create(null) + }, + notNull: true +}); +const issue756Codec = recordCodec({ + name: "issue756", + identifier: issue756Identifier, + attributes: Object.assign(Object.create(null), { + id: { + description: undefined, + codec: TYPES.int, + notNull: true, + hasDefault: true, + extensions: { + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false + } + }, + ts: { + description: undefined, + codec: notNullTimestampCodec, + notNull: true, + hasDefault: true, + extensions: { + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false + } + } + }), + description: undefined, + extensions: { + isTableLike: true, + pg: { + serviceName: "main", + schemaName: "c", + name: "issue756" + }, + tags: Object.create(null) + }, + executor: executor +}); const jwtTokenIdentifier = sql.identifier("b", "jwt_token"); const jwtTokenCodec = recordCodec({ name: "jwtToken", @@ -1463,58 +1568,6 @@ const jwtTokenCodec = recordCodec({ }, executor: executor }); -const issue756Identifier = sql.identifier("c", "issue756"); -const notNullTimestampCodec = domainOfCodec(TYPES.timestamptz, "notNullTimestamp", sql.identifier("c", "not_null_timestamp"), { - description: undefined, - extensions: { - pg: { - serviceName: "main", - schemaName: "c", - name: "not_null_timestamp" - }, - tags: Object.create(null) - }, - notNull: true -}); -const issue756Codec = recordCodec({ - name: "issue756", - identifier: issue756Identifier, - attributes: Object.assign(Object.create(null), { - id: { - description: undefined, - codec: TYPES.int, - notNull: true, - hasDefault: true, - extensions: { - tags: { - behavior: ["-insert -update"] - } - } - }, - ts: { - description: undefined, - codec: notNullTimestampCodec, - notNull: true, - hasDefault: true, - extensions: { - tags: { - behavior: ["-insert -update"] - } - } - } - }), - description: undefined, - extensions: { - isTableLike: true, - pg: { - serviceName: "main", - schemaName: "c", - name: "issue756" - }, - tags: Object.create(null) - }, - executor: executor -}); const leftArmIdentifier = sql.identifier("c", "left_arm"); const spec_leftArm = { name: "leftArm", @@ -1526,9 +1579,10 @@ const spec_leftArm = { notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: true, + canInsert: false, + canUpdate: false } }, person_id: { @@ -1537,9 +1591,10 @@ const spec_leftArm = { notNull: false, hasDefault: true, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: true, + canInsert: false, + canUpdate: false } }, length_in_metres: { @@ -1548,9 +1603,10 @@ const spec_leftArm = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-update"] - } + tags: {}, + canSelect: true, + canInsert: true, + canUpdate: false } }, mood: { @@ -1559,9 +1615,10 @@ const spec_leftArm = { notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-insert"] - } + tags: {}, + canSelect: true, + canInsert: false, + canUpdate: true } } }), @@ -1903,9 +1960,10 @@ const spec_post = { notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: true, + canInsert: false, + canUpdate: false } }, headline: { @@ -1914,9 +1972,10 @@ const spec_post = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: true, + canInsert: false, + canUpdate: false } }, body: { @@ -1925,9 +1984,10 @@ const spec_post = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: true, + canInsert: false, + canUpdate: false } }, author_id: { @@ -1936,9 +1996,10 @@ const spec_post = { notNull: false, hasDefault: true, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: true, + canInsert: false, + canUpdate: false } }, enums: { @@ -1947,9 +2008,10 @@ const spec_post = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-select -filterBy -orderBy -insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, comptypes: { @@ -1958,9 +2020,10 @@ const spec_post = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-select -filterBy -orderBy -insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -2136,9 +2199,10 @@ const spec_person = { notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: true, + canInsert: false, + canUpdate: false } }, person_full_name: { @@ -2149,7 +2213,10 @@ const spec_person = { extensions: { tags: { name: "name" - } + }, + canSelect: true, + canInsert: true, + canUpdate: true } }, aliases: { @@ -2158,7 +2225,10 @@ const spec_person = { notNull: true, hasDefault: true, extensions: { - tags: {} + tags: {}, + canSelect: true, + canInsert: true, + canUpdate: true } }, about: { @@ -2167,7 +2237,10 @@ const spec_person = { notNull: false, hasDefault: false, extensions: { - tags: {} + tags: {}, + canSelect: true, + canInsert: true, + canUpdate: true } }, email: { @@ -2176,7 +2249,10 @@ const spec_person = { notNull: true, hasDefault: false, extensions: { - tags: {} + tags: {}, + canSelect: true, + canInsert: true, + canUpdate: true } }, site: { @@ -2187,7 +2263,10 @@ const spec_person = { extensions: { tags: { deprecated: "Don\u2019t use me" - } + }, + canSelect: true, + canInsert: true, + canUpdate: true } }, config: { @@ -2196,9 +2275,10 @@ const spec_person = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: true, + canInsert: false, + canUpdate: false } }, last_login_from_ip: { @@ -2207,9 +2287,10 @@ const spec_person = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: true, + canInsert: false, + canUpdate: false } }, last_login_from_subnet: { @@ -2218,9 +2299,10 @@ const spec_person = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: true, + canInsert: false, + canUpdate: false } }, user_mac: { @@ -2229,9 +2311,10 @@ const spec_person = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: true, + canInsert: false, + canUpdate: false } }, created_at: { @@ -2240,9 +2323,10 @@ const spec_person = { notNull: false, hasDefault: true, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: true, + canInsert: false, + canUpdate: false } } }), @@ -2667,9 +2751,10 @@ const spec_types = { notNull: true, hasDefault: true, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, smallint: { @@ -2678,9 +2763,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, bigint: { @@ -2689,9 +2775,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, numeric: { @@ -2700,9 +2787,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, decimal: { @@ -2711,9 +2799,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, boolean: { @@ -2722,9 +2811,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, varchar: { @@ -2733,9 +2823,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, enum: { @@ -2744,9 +2835,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, enum_array: { @@ -2755,9 +2847,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, domain: { @@ -2766,9 +2859,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, domain2: { @@ -2777,9 +2871,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, text_array: { @@ -2788,9 +2883,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, json: { @@ -2799,9 +2895,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, jsonb: { @@ -2810,9 +2907,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, nullable_range: { @@ -2821,9 +2919,10 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, numrange: { @@ -2832,9 +2931,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, daterange: { @@ -2843,9 +2943,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, an_int_range: { @@ -2854,9 +2955,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, timestamp: { @@ -2865,9 +2967,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, timestamptz: { @@ -2876,9 +2979,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, date: { @@ -2887,9 +2991,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, time: { @@ -2898,9 +3003,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, timetz: { @@ -2909,9 +3015,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, interval: { @@ -2920,9 +3027,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, interval_array: { @@ -2931,9 +3039,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, money: { @@ -2942,9 +3051,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, compound_type: { @@ -2953,9 +3063,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, nested_compound_type: { @@ -2964,9 +3075,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, nullable_compound_type: { @@ -2975,9 +3087,10 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, nullable_nested_compound_type: { @@ -2986,9 +3099,10 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, point: { @@ -2997,9 +3111,10 @@ const spec_types = { notNull: true, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, nullablePoint: { @@ -3008,9 +3123,10 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, inet: { @@ -3019,9 +3135,10 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, cidr: { @@ -3030,9 +3147,10 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, macaddr: { @@ -3041,9 +3159,10 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, regproc: { @@ -3052,9 +3171,10 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, regprocedure: { @@ -3063,9 +3183,10 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, regoper: { @@ -3074,9 +3195,10 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, regoperator: { @@ -3085,9 +3207,10 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, regclass: { @@ -3096,9 +3219,10 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, regtype: { @@ -3107,9 +3231,10 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, regconfig: { @@ -3118,9 +3243,10 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, regdictionary: { @@ -3129,9 +3255,10 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, text_array_domain: { @@ -3140,9 +3267,10 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, int8_array_domain: { @@ -3151,9 +3279,10 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, bytea: { @@ -3162,9 +3291,10 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, bytea_array: { @@ -3173,9 +3303,10 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, ltree: { @@ -3184,9 +3315,10 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } }, ltree_array: { @@ -3195,9 +3327,10 @@ const spec_types = { notNull: false, hasDefault: false, extensions: { - tags: { - behavior: ["-insert -update"] - } + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false } } }), @@ -3339,10 +3472,17 @@ const registryConfig_pgResources_unique_foreign_key_unique_foreign_key = { schemaName: "a", name: "unique_foreign_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "create,update,delete,all,order,filter", - behavior: ["-insert -update -delete -query:resource:list -query:resource:connection -order -orderBy -filter -filterBy", "-select -single -list -connection -insert -update -delete"] - } + behavior: spec_uniqueForeignKey.extensions.tags.behavior + }, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false } }; const person_secretUniques = [{ @@ -3369,10 +3509,16 @@ const registryConfig_pgResources_person_secret_person_secret = { schemaName: "c", name: "person_secret" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { - deprecated: "This is deprecated (comment on table c.person_secret).", - behavior: ["-update"] - } + deprecated: "This is deprecated (comment on table c.person_secret)." + }, + canSelect: true, + canInsert: true, + canUpdate: false, + canDelete: true } }; const registryConfig_pgResources_foreign_key_foreign_key = { @@ -3391,11 +3537,17 @@ const registryConfig_pgResources_foreign_key_foreign_key = { schemaName: "a", name: "foreign_key" }, - tags: { - behavior: ["-select -single -list -connection -insert -update -delete"] - } + isInsertable: true, + isUpdatable: true, + isDeletable: true, + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false } }; +const list_bde_mutationFunctionIdentifer = sql.identifier("b", "list_bde_mutation"); const registryConfig_pgResources_compound_key_compound_key = { executor: executor, name: "compound_key", @@ -3419,37 +3571,18 @@ const registryConfig_pgResources_compound_key_compound_key = { schemaName: "c", name: "compound_key" }, - tags: { - behavior: ["-select -single -list -connection -insert -update -delete"] - } + isInsertable: true, + isUpdatable: true, + isDeletable: true, + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false } }; -const list_bde_mutationFunctionIdentifer = sql.identifier("b", "list_bde_mutation"); const edge_case_computedFunctionIdentifer = sql.identifier("c", "edge_case_computed"); const return_table_without_grantsFunctionIdentifer = sql.identifier("c", "return_table_without_grants"); -const authenticate_failFunctionIdentifer = sql.identifier("b", "authenticate_fail"); -const resourceConfig_jwt_token = { - executor: executor, - name: "jwt_token", - identifier: "main.b.jwt_token", - from: jwtTokenIdentifier, - codec: jwtTokenCodec, - uniques: [], - isVirtual: true, - description: undefined, - extensions: { - description: undefined, - pg: { - serviceName: "main", - schemaName: "b", - name: "jwt_token" - }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } - } -}; -const authenticateFunctionIdentifer = sql.identifier("b", "authenticate"); const registryConfig_pgResources_issue756_issue756 = { executor: executor, name: "issue756", @@ -3473,11 +3606,40 @@ const registryConfig_pgResources_issue756_issue756 = { schemaName: "c", name: "issue756" }, - tags: { - behavior: ["-select -single -list -connection -insert -update -delete"] - } + isInsertable: true, + isUpdatable: true, + isDeletable: true, + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false + } +}; +const authenticate_failFunctionIdentifer = sql.identifier("b", "authenticate_fail"); +const resourceConfig_jwt_token = { + executor: executor, + name: "jwt_token", + identifier: "main.b.jwt_token", + from: jwtTokenIdentifier, + codec: jwtTokenCodec, + uniques: [], + isVirtual: true, + description: undefined, + extensions: { + description: undefined, + pg: { + serviceName: "main", + schemaName: "b", + name: "jwt_token" + }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; +const authenticateFunctionIdentifer = sql.identifier("b", "authenticate"); const left_armUniques = [{ isPrimary: true, attributes: ["id"], @@ -3509,16 +3671,23 @@ const registryConfig_pgResources_left_arm_left_arm = { schemaName: "c", name: "left_arm" }, - tags: {} + isInsertable: true, + isUpdatable: true, + isDeletable: true, + tags: {}, + canSelect: true, + canInsert: true, + canUpdate: true, + canDelete: true } }; const authenticate_manyFunctionIdentifer = sql.identifier("b", "authenticate_many"); const issue756_mutationFunctionIdentifer = sql.identifier("c", "issue756_mutation"); const issue756_set_mutationFunctionIdentifer = sql.identifier("c", "issue756_set_mutation"); const left_arm_identityFunctionIdentifer = sql.identifier("c", "left_arm_identity"); -const authenticate_payloadFunctionIdentifer = sql.identifier("b", "authenticate_payload"); const types_mutationFunctionIdentifer = sql.identifier("c", "types_mutation"); const types_queryFunctionIdentifer = sql.identifier("c", "types_query"); +const authenticate_payloadFunctionIdentifer = sql.identifier("b", "authenticate_payload"); const compound_type_computed_fieldFunctionIdentifer = sql.identifier("c", "compound_type_computed_field"); const func_out_out_compound_typeFunctionIdentifer = sql.identifier("c", "func_out_out_compound_type"); const mutation_out_out_compound_typeFunctionIdentifer = sql.identifier("c", "mutation_out_out_compound_type"); @@ -3530,6 +3699,7 @@ const post_computed_with_required_argFunctionIdentifer = sql.identifier("a", "po const post_headline_trimmedFunctionIdentifer = sql.identifier("a", "post_headline_trimmed"); const post_headline_trimmed_no_defaultsFunctionIdentifer = sql.identifier("a", "post_headline_trimmed_no_defaults"); const post_headline_trimmed_strictFunctionIdentifer = sql.identifier("a", "post_headline_trimmed_strict"); +const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); const compound_type_set_queryFunctionIdentifer = sql.identifier("c", "compound_type_set_query"); const resourceConfig_compound_type = { executor: executor, @@ -3547,15 +3717,15 @@ const resourceConfig_compound_type = { schemaName: "c", name: "compound_type" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const compound_type_mutationFunctionIdentifer = sql.identifier("b", "compound_type_mutation"); const compound_type_queryFunctionIdentifer = sql.identifier("b", "compound_type_query"); const compound_type_set_mutationFunctionIdentifer = sql.identifier("b", "compound_type_set_mutation"); -const query_output_two_rowsFunctionIdentifer = sql.identifier("c", "query_output_two_rows"); const mutation_compound_type_arrayFunctionIdentifer = sql.identifier("a", "mutation_compound_type_array"); const query_compound_type_arrayFunctionIdentifer = sql.identifier("a", "query_compound_type_array"); const compound_type_array_mutationFunctionIdentifer = sql.identifier("b", "compound_type_array_mutation"); @@ -3584,9 +3754,14 @@ const registryConfig_pgResources_post_post = { schemaName: "a", name: "post" }, - tags: { - behavior: ["-insert -update -delete"] - } + isInsertable: true, + isUpdatable: true, + isDeletable: true, + tags: {}, + canSelect: true, + canInsert: false, + canUpdate: false, + canDelete: false } }; const post_computed_compound_type_arrayFunctionIdentifer = sql.identifier("a", "post_computed_compound_type_array"); @@ -3606,6 +3781,7 @@ const func_out_complex_setofFunctionIdentifer = sql.identifier("c", "func_out_co const mutation_out_complexFunctionIdentifer = sql.identifier("c", "mutation_out_complex"); const mutation_out_complex_setofFunctionIdentifer = sql.identifier("c", "mutation_out_complex_setof"); const person_computed_complexFunctionIdentifer = sql.identifier("c", "person_computed_complex"); +const person_first_postFunctionIdentifer = sql.identifier("c", "person_first_post"); const personUniques = [{ isPrimary: true, attributes: ["id"], @@ -3637,10 +3813,16 @@ const registryConfig_pgResources_person_person = { schemaName: "c", name: "person" }, - tags: {} + isInsertable: true, + isUpdatable: true, + isDeletable: true, + tags: {}, + canSelect: true, + canInsert: true, + canUpdate: true, + canDelete: true } }; -const person_first_postFunctionIdentifer = sql.identifier("c", "person_first_post"); const badly_behaved_functionFunctionIdentifer = sql.identifier("c", "badly_behaved_function"); const func_out_tableFunctionIdentifer = sql.identifier("c", "func_out_table"); const func_out_table_setofFunctionIdentifer = sql.identifier("c", "func_out_table_setof"); @@ -3674,10 +3856,16 @@ const registryConfig_pgResources_types_types = { schemaName: "b", name: "types" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { - foreignKey: spec_types.extensions.tags.foreignKey, - behavior: ["-select -single -list -connection -insert -update -delete"] - } + foreignKey: spec_types.extensions.tags.foreignKey + }, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false } }; const type_function_connectionFunctionIdentifer = sql.identifier("b", "type_function_connection"); @@ -3730,22 +3918,22 @@ const registry = makeRegistry({ unlogged: unloggedCodec, foreignKey: foreignKeyCodec, testview: testviewCodec, + uuidArray: uuidArrayCodec, + uuid: TYPES.uuid, viewTable: viewTableCodec, compoundKey: compoundKeyCodec, bool: TYPES.boolean, - uuidArray: uuidArrayCodec, - uuid: TYPES.uuid, similarTable1: similarTable1Codec, similarTable2: similarTable2Codec, updatableView: updatableViewCodec, nullTestRecord: nullTestRecordCodec, edgeCase: edgeCaseCodec, int2: TYPES.int2, - jwtToken: jwtTokenCodec, - numeric: TYPES.numeric, issue756: issue756Codec, notNullTimestamp: notNullTimestampCodec, timestamptz: TYPES.timestamptz, + jwtToken: jwtTokenCodec, + numeric: TYPES.numeric, leftArm: leftArmCodec, float8: TYPES.float, authPayload: authPayloadCodec, @@ -4028,9 +4216,8 @@ const registry = makeRegistry({ schemaName: "c", name: "current_user_id" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {}, + canExecute: true }, description: undefined }, @@ -4052,10 +4239,9 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - }, - singleOutputParameterName: "o" + tags: {}, + singleOutputParameterName: "o", + canExecute: false }, description: undefined }, @@ -4077,10 +4263,9 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - }, - singleOutputParameterName: "o" + tags: {}, + singleOutputParameterName: "o", + canExecute: false }, description: undefined }, @@ -4102,9 +4287,8 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -4126,10 +4310,9 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - }, - singleOutputParameterName: "o" + tags: {}, + singleOutputParameterName: "o", + canExecute: false }, description: undefined }, @@ -4151,10 +4334,9 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - }, - singleOutputParameterName: "o" + tags: {}, + singleOutputParameterName: "o", + canExecute: false }, description: undefined }, @@ -4176,9 +4358,8 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -4200,9 +4381,8 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -4224,9 +4404,8 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -4248,9 +4427,8 @@ const registry = makeRegistry({ schemaName: "a", name: "return_void_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -4272,9 +4450,8 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_set" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -4296,9 +4473,8 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_set" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -4320,9 +4496,8 @@ const registry = makeRegistry({ schemaName: "a", name: "static_big_integer" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -4349,10 +4524,9 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - }, - singleOutputParameterName: "o" + tags: {}, + singleOutputParameterName: "o", + canExecute: false }, description: undefined }, @@ -4379,10 +4553,9 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_one_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - }, - singleOutputParameterName: "col1" + tags: {}, + singleOutputParameterName: "col1", + canExecute: false }, description: undefined }, @@ -4409,10 +4582,9 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - }, - singleOutputParameterName: "o" + tags: {}, + singleOutputParameterName: "o", + canExecute: false }, description: undefined }, @@ -4439,10 +4611,9 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_one_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - }, - singleOutputParameterName: "col1" + tags: {}, + singleOutputParameterName: "col1", + canExecute: false }, description: undefined }, @@ -4469,9 +4640,8 @@ const registry = makeRegistry({ schemaName: "a", name: "assert_something" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -4500,8 +4670,9 @@ const registry = makeRegistry({ }, tags: { omit: "execute", - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + behavior: ["-queryField -mutationField -typeField"] + }, + canExecute: false }, description: undefined }, @@ -4528,9 +4699,8 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -4557,9 +4727,8 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -4586,9 +4755,8 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -4615,9 +4783,8 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -4644,9 +4811,8 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -4673,9 +4839,8 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql_with_default" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -4707,9 +4872,8 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: "lol, add some stuff 1 mutation" }, @@ -4741,9 +4905,8 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: "lol, add some stuff 1 query" }, @@ -4775,9 +4938,8 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: "lol, add some stuff 2 mutation" }, @@ -4809,9 +4971,8 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: "lol, add some stuff 2 query" }, @@ -4843,9 +5004,8 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: "lol, add some stuff 3 mutation" }, @@ -4877,9 +5037,8 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: "lol, add some stuff 3 query" }, @@ -4911,9 +5070,8 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: "lol, add some stuff 4 mutation" }, @@ -4945,9 +5103,8 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation_error" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -4979,9 +5136,8 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: "lol, add some stuff 4 query" }, @@ -5013,9 +5169,8 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_1" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5047,9 +5202,8 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_2" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5081,9 +5235,8 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_3" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5115,9 +5268,8 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_4" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5149,10 +5301,9 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_inout" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - }, - singleOutputParameterName: "ino" + tags: {}, + singleOutputParameterName: "ino", + canExecute: false }, description: undefined }, @@ -5174,9 +5325,8 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5198,9 +5348,8 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5222,9 +5371,8 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5256,10 +5404,9 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_inout" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - }, - singleOutputParameterName: "ino" + tags: {}, + singleOutputParameterName: "ino", + canExecute: false }, description: undefined }, @@ -5281,9 +5428,8 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5305,9 +5451,8 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5329,9 +5474,8 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5355,8 +5499,9 @@ const registry = makeRegistry({ }, tags: { simpleCollections: "only", - behavior: ["queryField -mutationField -typeField", "-filter -order", "+list -connection", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + behavior: ["+list -connection"] + }, + canExecute: false }, description: undefined }, @@ -5393,9 +5538,8 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_1" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5432,9 +5576,8 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_2" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5471,9 +5614,8 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_3" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5510,9 +5652,8 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_4" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5549,9 +5690,8 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_5" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5573,9 +5713,8 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5602,9 +5741,8 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_multi_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5641,9 +5779,8 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5680,9 +5817,8 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5704,9 +5840,8 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5733,9 +5868,8 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_multi_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5762,9 +5896,8 @@ const registry = makeRegistry({ schemaName: "b", name: "guid_fn" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5786,9 +5919,8 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5810,9 +5942,8 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5834,9 +5965,8 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_text_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5858,9 +5988,8 @@ const registry = makeRegistry({ schemaName: "a", name: "query_text_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -5880,9 +6009,14 @@ const registry = makeRegistry({ schemaName: "a", name: "non_updatable_view" }, - tags: { - behavior: ["-insert", "-update", "-delete", "-select -single -list -connection -insert -update -delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false } }, inputs: { @@ -5908,9 +6042,14 @@ const registry = makeRegistry({ schemaName: "a", name: "inputs" }, - tags: { - behavior: ["-select -single -list -connection -insert -update -delete"] - } + isInsertable: true, + isUpdatable: true, + isDeletable: true, + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false } }, patchs: { @@ -5936,9 +6075,14 @@ const registry = makeRegistry({ schemaName: "a", name: "patchs" }, - tags: { - behavior: ["-select -single -list -connection -insert -update -delete"] - } + isInsertable: true, + isUpdatable: true, + isDeletable: true, + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false } }, reserved: { @@ -5964,9 +6108,14 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved" }, - tags: { - behavior: ["-select -single -list -connection -insert -update -delete"] - } + isInsertable: true, + isUpdatable: true, + isDeletable: true, + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false } }, reservedPatchs: { @@ -5992,9 +6141,14 @@ const registry = makeRegistry({ schemaName: "a", name: "reservedPatchs" }, - tags: { - behavior: ["-select -single -list -connection -insert -update -delete"] - } + isInsertable: true, + isUpdatable: true, + isDeletable: true, + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false } }, reserved_input: { @@ -6020,9 +6174,14 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved_input" }, - tags: { - behavior: ["-select -single -list -connection -insert -update -delete"] - } + isInsertable: true, + isUpdatable: true, + isDeletable: true, + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false } }, default_value: { @@ -6048,9 +6207,14 @@ const registry = makeRegistry({ schemaName: "a", name: "default_value" }, - tags: { - behavior: ["-select -single -list -connection -insert -update -delete"] - } + isInsertable: true, + isUpdatable: true, + isDeletable: true, + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false } }, no_primary_key: { @@ -6076,9 +6240,14 @@ const registry = makeRegistry({ schemaName: "a", name: "no_primary_key" }, - tags: { - behavior: ["-select -single -list -connection -insert -update -delete"] - } + isInsertable: true, + isUpdatable: true, + isDeletable: true, + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false } }, unique_foreign_key: registryConfig_pgResources_unique_foreign_key_unique_foreign_key, @@ -6105,9 +6274,14 @@ const registry = makeRegistry({ schemaName: "c", name: "my_table" }, - tags: { - behavior: ["-select -single -list -connection -insert -update -delete"] - } + isInsertable: true, + isUpdatable: true, + isDeletable: true, + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false } }, person_secret: registryConfig_pgResources_person_secret_person_secret, @@ -6135,9 +6309,14 @@ const registry = makeRegistry({ name: "unlogged", persistence: "u" }, - tags: { - behavior: ["-select -single -list -connection -insert -update -delete"] - } + isInsertable: true, + isUpdatable: true, + isDeletable: true, + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false } }, foreign_key: registryConfig_pgResources_foreign_key_foreign_key, @@ -6157,11 +6336,54 @@ const registry = makeRegistry({ schemaName: "a", name: "testview" }, - tags: { - behavior: ["-select -single -list -connection -insert -update -delete"] - } + isInsertable: true, + isUpdatable: true, + isDeletable: true, + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false } }, + list_bde_mutation: { + executor, + name: "list_bde_mutation", + identifier: "main.b.list_bde_mutation(_text,text,text)", + from(...args) { + return sql`${list_bde_mutationFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [{ + name: "b", + required: true, + notNull: false, + codec: textArrayCodec + }, { + name: "d", + required: true, + notNull: false, + codec: TYPES.text + }, { + name: "e", + required: true, + notNull: false, + codec: TYPES.text + }], + isUnique: !false, + codec: uuidArrayCodec, + uniques: [], + isMutation: true, + extensions: { + pg: { + serviceName: "main", + schemaName: "b", + name: "list_bde_mutation" + }, + tags: {}, + canExecute: false + }, + description: undefined + }, view_table: { executor: executor, name: "view_table", @@ -6185,48 +6407,42 @@ const registry = makeRegistry({ schemaName: "a", name: "view_table" }, - tags: { - behavior: ["-select -single -list -connection -insert -update -delete"] - } + isInsertable: true, + isUpdatable: true, + isDeletable: true, + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false } }, compound_key: registryConfig_pgResources_compound_key_compound_key, - list_bde_mutation: { + edge_case_computed: { executor, - name: "list_bde_mutation", - identifier: "main.b.list_bde_mutation(_text,text,text)", + name: "edge_case_computed", + identifier: "main.c.edge_case_computed(c.edge_case)", from(...args) { - return sql`${list_bde_mutationFunctionIdentifer}(${sqlFromArgDigests(args)})`; + return sql`${edge_case_computedFunctionIdentifer}(${sqlFromArgDigests(args)})`; }, parameters: [{ - name: "b", - required: true, - notNull: false, - codec: textArrayCodec - }, { - name: "d", - required: true, - notNull: false, - codec: TYPES.text - }, { - name: "e", + name: "edge_case", required: true, notNull: false, - codec: TYPES.text + codec: edgeCaseCodec }], isUnique: !false, - codec: uuidArrayCodec, + codec: TYPES.text, uniques: [], - isMutation: true, + isMutation: false, extensions: { pg: { serviceName: "main", - schemaName: "b", - name: "list_bde_mutation" + schemaName: "c", + name: "edge_case_computed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -6253,9 +6469,14 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_1" }, - tags: { - behavior: ["-select -single -list -connection -insert -update -delete"] - } + isInsertable: true, + isUpdatable: true, + isDeletable: true, + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false } }, similar_table_2: { @@ -6281,40 +6502,16 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_2" }, - tags: { - behavior: ["-select -single -list -connection -insert -update -delete"] - } + isInsertable: true, + isUpdatable: true, + isDeletable: true, + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false } }, - edge_case_computed: { - executor, - name: "edge_case_computed", - identifier: "main.c.edge_case_computed(c.edge_case)", - from(...args) { - return sql`${edge_case_computedFunctionIdentifer}(${sqlFromArgDigests(args)})`; - }, - parameters: [{ - name: "edge_case", - required: true, - notNull: false, - codec: edgeCaseCodec - }], - isUnique: !false, - codec: TYPES.text, - uniques: [], - isMutation: false, - extensions: { - pg: { - serviceName: "main", - schemaName: "c", - name: "edge_case_computed" - }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } - }, - description: undefined - }, updatable_view: { executor: executor, name: "updatable_view", @@ -6340,11 +6537,17 @@ const registry = makeRegistry({ schemaName: "b", name: "updatable_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { uniqueKey: "x", - unique: "x|@behavior -single -update -delete", - behavior: ["-select -single -list -connection -insert -update -delete"] - } + unique: "x|@behavior -single -update -delete" + }, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false } }, null_test_record: { @@ -6370,9 +6573,14 @@ const registry = makeRegistry({ schemaName: "c", name: "null_test_record" }, - tags: { - behavior: ["-select -single -list -connection -insert -update -delete"] - } + isInsertable: true, + isUpdatable: true, + isDeletable: true, + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false } }, return_table_without_grants: PgResource.functionResourceOptions(registryConfig_pgResources_compound_key_compound_key, { @@ -6391,9 +6599,8 @@ const registry = makeRegistry({ schemaName: "c", name: "return_table_without_grants" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {}, + canExecute: true }, description: undefined }), @@ -6413,11 +6620,17 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case" }, - tags: { - behavior: ["-select -single -list -connection -insert -update -delete"] - } + isInsertable: true, + isUpdatable: true, + isDeletable: true, + tags: {}, + canSelect: false, + canInsert: false, + canUpdate: false, + canDelete: false } }, + issue756: registryConfig_pgResources_issue756_issue756, authenticate_fail: PgResource.functionResourceOptions(resourceConfig_jwt_token, { name: "authenticate_fail", identifier: "main.b.authenticate_fail()", @@ -6434,9 +6647,8 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_fail" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -6471,13 +6683,11 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), - issue756: registryConfig_pgResources_issue756_issue756, left_arm: registryConfig_pgResources_left_arm_left_arm, authenticate_many: PgResource.functionResourceOptions(resourceConfig_jwt_token, { name: "authenticate_many", @@ -6510,9 +6720,8 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_many" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -6532,9 +6741,8 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -6554,9 +6762,8 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -6586,67 +6793,9 @@ const registry = makeRegistry({ }, tags: { arg0variant: "base", - resultFieldName: "leftArm", - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } - }, - description: undefined - }), - authenticate_payload: PgResource.functionResourceOptions({ - executor: executor, - name: "auth_payload", - identifier: "main.b.auth_payload", - from: authPayloadIdentifier, - codec: authPayloadCodec, - uniques: [], - isVirtual: true, - description: undefined, - extensions: { - description: undefined, - pg: { - serviceName: "main", - schemaName: "b", - name: "auth_payload" - }, - tags: { - foreignKey: "(id) references c.person", - behavior: ["-insert", "-update", "-delete"] - } - } - }, { - name: "authenticate_payload", - identifier: "main.b.authenticate_payload(int4,numeric,int8)", - from(...args) { - return sql`${authenticate_payloadFunctionIdentifer}(${sqlFromArgDigests(args)})`; - }, - parameters: [{ - name: "a", - required: true, - notNull: false, - codec: TYPES.int - }, { - name: "b", - required: true, - notNull: false, - codec: TYPES.numeric - }, { - name: "c", - required: true, - notNull: false, - codec: TYPES.bigint - }], - returnsArray: false, - returnsSetof: false, - isMutation: true, - extensions: { - pg: { - serviceName: "main", - schemaName: "b", - name: "authenticate_payload" + resultFieldName: "leftArm" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + canExecute: true }, description: undefined }), @@ -6698,9 +6847,8 @@ const registry = makeRegistry({ schemaName: "c", name: "types_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -6732,32 +6880,90 @@ const registry = makeRegistry({ notNull: true, codec: int4ArrayCodec }, { - name: "e", + name: "e", + required: true, + notNull: true, + codec: TYPES.json + }, { + name: "f", + required: true, + notNull: true, + codec: floatrangeCodec + }], + isUnique: !false, + codec: TYPES.boolean, + uniques: [], + isMutation: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "types_query" + }, + tags: {}, + canExecute: false + }, + description: undefined + }, + authenticate_payload: PgResource.functionResourceOptions({ + executor: executor, + name: "auth_payload", + identifier: "main.b.auth_payload", + from: authPayloadIdentifier, + codec: authPayloadCodec, + uniques: [], + isVirtual: true, + description: undefined, + extensions: { + description: undefined, + pg: { + serviceName: "main", + schemaName: "b", + name: "auth_payload" + }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: { + foreignKey: "(id) references c.person" + } + } + }, { + name: "authenticate_payload", + identifier: "main.b.authenticate_payload(int4,numeric,int8)", + from(...args) { + return sql`${authenticate_payloadFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [{ + name: "a", + required: true, + notNull: false, + codec: TYPES.int + }, { + name: "b", required: true, - notNull: true, - codec: TYPES.json + notNull: false, + codec: TYPES.numeric }, { - name: "f", + name: "c", required: true, - notNull: true, - codec: floatrangeCodec + notNull: false, + codec: TYPES.bigint }], - isUnique: !false, - codec: TYPES.boolean, - uniques: [], - isMutation: false, + returnsArray: false, + returnsSetof: false, + isMutation: true, extensions: { pg: { serviceName: "main", - schemaName: "c", - name: "types_query" + schemaName: "b", + name: "authenticate_payload" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined - }, + }), compound_type_computed_field: { executor, name: "compound_type_computed_field", @@ -6781,9 +6987,8 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_computed_field" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -6810,9 +7015,8 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_compound_type" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -6839,9 +7043,8 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_compound_type" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -6868,9 +7071,8 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_set" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -6897,9 +7099,8 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -6926,9 +7127,8 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_text_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -6963,8 +7163,9 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] + }, + canExecute: false }, description: undefined }, @@ -6999,8 +7200,9 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] + }, + canExecute: false }, description: undefined }, @@ -7037,9 +7239,8 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -7076,9 +7277,8 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_no_defaults" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -7115,9 +7315,46 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_strict" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false + }, + description: undefined + }, + query_output_two_rows: { + executor, + name: "query_output_two_rows", + identifier: "main.c.query_output_two_rows(int4,int4,text,c.left_arm,a.post)", + from(...args) { + return sql`${query_output_two_rowsFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [{ + name: "left_arm_id", + required: true, + notNull: false, + codec: TYPES.int + }, { + name: "post_id", + required: true, + notNull: false, + codec: TYPES.int + }, { + name: "txt", + required: true, + notNull: false, + codec: TYPES.text + }], + isUnique: !false, + codec: registryConfig_pgCodecs_QueryOutputTwoRowsRecord_QueryOutputTwoRowsRecord, + uniques: [], + isMutation: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "c", + name: "query_output_two_rows" + }, + tags: {}, + canExecute: false }, description: undefined }, @@ -7137,9 +7374,8 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -7164,9 +7400,8 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -7191,9 +7426,8 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -7218,51 +7452,11 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), - query_output_two_rows: { - executor, - name: "query_output_two_rows", - identifier: "main.c.query_output_two_rows(int4,int4,text,c.left_arm,a.post)", - from(...args) { - return sql`${query_output_two_rowsFunctionIdentifer}(${sqlFromArgDigests(args)})`; - }, - parameters: [{ - name: "left_arm_id", - required: true, - notNull: false, - codec: TYPES.int - }, { - name: "post_id", - required: true, - notNull: false, - codec: TYPES.int - }, { - name: "txt", - required: true, - notNull: false, - codec: TYPES.text - }], - isUnique: !false, - codec: registryConfig_pgCodecs_QueryOutputTwoRowsRecord_QueryOutputTwoRowsRecord, - uniques: [], - isMutation: false, - extensions: { - pg: { - serviceName: "main", - schemaName: "c", - name: "query_output_two_rows" - }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } - }, - description: undefined - }, mutation_compound_type_array: PgResource.functionResourceOptions(resourceConfig_compound_type, { name: "mutation_compound_type_array", identifier: "main.a.mutation_compound_type_array(c.compound_type)", @@ -7284,9 +7478,8 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_compound_type_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -7311,9 +7504,8 @@ const registry = makeRegistry({ schemaName: "a", name: "query_compound_type_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -7338,9 +7530,8 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -7365,9 +7556,8 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -7398,9 +7588,8 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_compound_type_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -7425,9 +7614,8 @@ const registry = makeRegistry({ schemaName: "c", name: "table_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -7452,9 +7640,8 @@ const registry = makeRegistry({ schemaName: "c", name: "table_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -7485,9 +7672,9 @@ const registry = makeRegistry({ name: "post_with_suffix" }, tags: { - deprecated: "This is deprecated (comment on function a.post_with_suffix).", - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + deprecated: "This is deprecated (comment on function a.post_with_suffix)." + }, + canExecute: true }, description: undefined }), @@ -7512,9 +7699,8 @@ const registry = makeRegistry({ schemaName: "a", name: "post_many" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -7545,9 +7731,10 @@ const registry = makeRegistry({ notNull: true, sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards", "-queryField -mutationField -typeField -orderBy -filterBy"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] }, - singleOutputParameterName: "o1" + singleOutputParameterName: "o1", + canExecute: false }, description: undefined }, @@ -7576,8 +7763,9 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + behavior: ["orderBy order resource:connection:backwards"] + }, + canExecute: false }, description: "The first name of the person." }, @@ -7604,9 +7792,8 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_out_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -7638,10 +7825,9 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - }, - singleOutputParameterName: "ino" + tags: {}, + singleOutputParameterName: "ino", + canExecute: false }, description: undefined }, @@ -7673,9 +7859,8 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -7708,9 +7893,9 @@ const registry = makeRegistry({ name: "person_exists" }, tags: { - deprecated: "This is deprecated (comment on function c.person_exists).", - behavior: ["-queryField -mutationField typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + deprecated: "This is deprecated (comment on function c.person_exists)." + }, + canExecute: false }, description: undefined }, @@ -7737,9 +7922,8 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -7771,9 +7955,8 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -7805,9 +7988,8 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -7839,9 +8021,8 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -7873,9 +8054,8 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, @@ -7912,13 +8092,11 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_complex" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }, - person: registryConfig_pgResources_person_person, person_first_post: PgResource.functionResourceOptions(registryConfig_pgResources_post_post, { name: "person_first_post", identifier: "main.c.person_first_post(c.person)", @@ -7940,12 +8118,12 @@ const registry = makeRegistry({ schemaName: "c", name: "person_first_post" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: "The first post by the person." }), + person: registryConfig_pgResources_person_person, badly_behaved_function: PgResource.functionResourceOptions(registryConfig_pgResources_person_person, { name: "badly_behaved_function", identifier: "main.c.badly_behaved_function()", @@ -7963,9 +8141,9 @@ const registry = makeRegistry({ name: "badly_behaved_function" }, tags: { - deprecated: "This is deprecated (comment on function c.badly_behaved_function).", - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + deprecated: "This is deprecated (comment on function c.badly_behaved_function)." + }, + canExecute: false }, description: undefined }), @@ -7985,9 +8163,8 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -8007,9 +8184,8 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -8029,9 +8205,8 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -8051,9 +8226,8 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -8073,9 +8247,8 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -8098,8 +8271,9 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["queryField -mutationField -typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] + }, + canExecute: false }, description: undefined }), @@ -8119,9 +8293,8 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_query_plpgsql" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -8146,10 +8319,9 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - }, - singleOutputParameterName: "person" + tags: {}, + singleOutputParameterName: "person", + canExecute: false }, description: undefined }), @@ -8176,8 +8348,9 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + behavior: ["orderBy order resource:connection:backwards"] + }, + canExecute: false }, description: undefined }), @@ -8198,9 +8371,8 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -8220,9 +8392,8 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -8247,9 +8418,8 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -8274,9 +8444,8 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -8301,9 +8470,8 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_connection" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -8333,9 +8501,8 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -8355,9 +8522,8 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -8377,9 +8543,8 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }), @@ -8404,9 +8569,8 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_list" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order", "-queryField -mutationField -typeField -orderBy -filterBy"] - } + tags: {}, + canExecute: false }, description: undefined }) @@ -9051,6 +9215,9 @@ const parseValueLiteral = (ast, variables) => { function InternetAddressSerialize(value) { return "" + value; } +const pgFieldSource_post_computed_with_optional_argPgResource = registry.pgResources["post_computed_with_optional_arg"]; +const pgFieldSource_person_computed_outPgResource = registry.pgResources["person_computed_out"]; +const pgFieldSource_person_first_namePgResource = registry.pgResources["person_first_name"]; const argDetailsSimple3 = [{ graphqlArgName: "leftArm", postgresArgName: "left_arm", @@ -9472,6 +9639,8 @@ type PageInfo { """Methods to use when ordering \`Post\`.""" enum PostsOrderBy { NATURAL + COMPUTED_WITH_OPTIONAL_ARG_ASC + COMPUTED_WITH_OPTIONAL_ARG_DESC PRIMARY_KEY_ASC PRIMARY_KEY_DESC ID_ASC @@ -9499,6 +9668,9 @@ input PostCondition { """Checks for equality with the object’s \`authorId\` field.""" authorId: Int + + """Checks for equality with the object’s \`computedWithOptionalArg\` field.""" + computedWithOptionalArg: Int } """Tracks metadata about the left arms of various people""" @@ -9664,6 +9836,10 @@ type PeopleEdge { """Methods to use when ordering \`Person\`.""" enum PeopleOrderBy { NATURAL + COMPUTED_OUT_ASC + COMPUTED_OUT_DESC + FIRST_NAME_ASC + FIRST_NAME_DESC PRIMARY_KEY_ASC PRIMARY_KEY_DESC ID_ASC @@ -9724,6 +9900,9 @@ input PersonCondition { """Checks for equality with the object’s \`createdAt\` field.""" createdAt: Datetime + + """Checks for equality with the object’s \`computedOut\` field.""" + computedOut: String } """An input for mutations affecting \`WrappedUrl\`""" @@ -11012,6 +11191,36 @@ export const plans = { NATURAL: { applyPlan() {} }, + COMPUTED_WITH_OPTIONAL_ARG_ASC: { + applyPlan(step) { + if (typeof pgFieldSource_post_computed_with_optional_argPgResource.from !== "function") { + throw new Error("Invalid computed attribute 'from'"); + } + const expression = sql`${pgFieldSource_post_computed_with_optional_argPgResource.from({ + placeholder: step.alias + })}`; + step.orderBy({ + codec: pgFieldSource_post_computed_with_optional_argPgResource.codec, + fragment: expression, + direction: "asc".toUpperCase() + }); + } + }, + COMPUTED_WITH_OPTIONAL_ARG_DESC: { + applyPlan(step) { + if (typeof pgFieldSource_post_computed_with_optional_argPgResource.from !== "function") { + throw new Error("Invalid computed attribute 'from'"); + } + const expression = sql`${pgFieldSource_post_computed_with_optional_argPgResource.from({ + placeholder: step.alias + })}`; + step.orderBy({ + codec: pgFieldSource_post_computed_with_optional_argPgResource.codec, + fragment: expression, + direction: "desc".toUpperCase() + }); + } + }, PRIMARY_KEY_ASC: { applyPlan(step) { postUniques[0].attributes.forEach(attributeName => { @@ -11273,6 +11482,21 @@ export const plans = { }, autoApplyAfterParentInputPlan: true, autoApplyAfterParentApplyPlan: true + }, + computedWithOptionalArg: { + applyPlan($condition, val) { + if (typeof pgFieldSource_post_computed_with_optional_argPgResource.from !== "function") { + throw new Error("Invalid computed attribute 'from'"); + } + const expression = sql`${pgFieldSource_post_computed_with_optional_argPgResource.from({ + placeholder: $condition.alias + })}`; + if (val.getRaw().evalIs(null)) { + $condition.where(sql`${expression} is null`); + } else { + $condition.where(sql`${expression} = ${$condition.placeholder(val.get(), pgFieldSource_post_computed_with_optional_argPgResource.codec)}`); + } + } } }, LeftArm: { @@ -11820,6 +12044,66 @@ export const plans = { NATURAL: { applyPlan() {} }, + COMPUTED_OUT_ASC: { + applyPlan(step) { + if (typeof pgFieldSource_person_computed_outPgResource.from !== "function") { + throw new Error("Invalid computed attribute 'from'"); + } + const expression = sql`${pgFieldSource_person_computed_outPgResource.from({ + placeholder: step.alias + })}`; + step.orderBy({ + codec: pgFieldSource_person_computed_outPgResource.codec, + fragment: expression, + direction: "asc".toUpperCase() + }); + } + }, + COMPUTED_OUT_DESC: { + applyPlan(step) { + if (typeof pgFieldSource_person_computed_outPgResource.from !== "function") { + throw new Error("Invalid computed attribute 'from'"); + } + const expression = sql`${pgFieldSource_person_computed_outPgResource.from({ + placeholder: step.alias + })}`; + step.orderBy({ + codec: pgFieldSource_person_computed_outPgResource.codec, + fragment: expression, + direction: "desc".toUpperCase() + }); + } + }, + FIRST_NAME_ASC: { + applyPlan(step) { + if (typeof pgFieldSource_person_first_namePgResource.from !== "function") { + throw new Error("Invalid computed attribute 'from'"); + } + const expression = sql`${pgFieldSource_person_first_namePgResource.from({ + placeholder: step.alias + })}`; + step.orderBy({ + codec: pgFieldSource_person_first_namePgResource.codec, + fragment: expression, + direction: "asc".toUpperCase() + }); + } + }, + FIRST_NAME_DESC: { + applyPlan(step) { + if (typeof pgFieldSource_person_first_namePgResource.from !== "function") { + throw new Error("Invalid computed attribute 'from'"); + } + const expression = sql`${pgFieldSource_person_first_namePgResource.from({ + placeholder: step.alias + })}`; + step.orderBy({ + codec: pgFieldSource_person_first_namePgResource.codec, + fragment: expression, + direction: "desc".toUpperCase() + }); + } + }, PRIMARY_KEY_ASC: { applyPlan(step) { personUniques[0].attributes.forEach(attributeName => { @@ -12446,6 +12730,21 @@ export const plans = { }, autoApplyAfterParentInputPlan: true, autoApplyAfterParentApplyPlan: true + }, + computedOut: { + applyPlan($condition, val) { + if (typeof pgFieldSource_person_computed_outPgResource.from !== "function") { + throw new Error("Invalid computed attribute 'from'"); + } + const expression = sql`${pgFieldSource_person_computed_outPgResource.from({ + placeholder: $condition.alias + })}`; + if (val.getRaw().evalIs(null)) { + $condition.where(sql`${expression} is null`); + } else { + $condition.where(sql`${expression} = ${$condition.placeholder(val.get(), pgFieldSource_person_computed_outPgResource.codec)}`); + } + } } }, WrappedUrlInput: { 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 43fe7e8a97..87880572e4 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/rbac.ignore.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/rbac.ignore.1.export.mjs @@ -3169,6 +3169,9 @@ const registryConfig_pgResources_foreign_key_foreign_key = { schemaName: "a", name: "foreign_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3195,6 +3198,9 @@ const registryConfig_pgResources_unique_foreign_key_unique_foreign_key = { schemaName: "a", name: "unique_foreign_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "create,update,delete,all,order,filter", behavior: spec_uniqueForeignKey.extensions.tags.behavior @@ -3233,6 +3239,9 @@ const registryConfig_pgResources_person_secret_person_secret = { schemaName: "c", name: "person_secret" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { deprecated: "This is deprecated (comment on table c.person_secret)." } @@ -3270,6 +3279,9 @@ const registryConfig_pgResources_compound_key_compound_key = { schemaName: "c", name: "compound_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3331,6 +3343,9 @@ const registryConfig_pgResources_left_arm_left_arm = { schemaName: "c", name: "left_arm" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3351,9 +3366,10 @@ const resourceConfig_jwt_token = { schemaName: "b", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const authenticateFunctionIdentifer = sql.identifier("b", "authenticate"); @@ -3381,6 +3397,9 @@ const registryConfig_pgResources_issue756_issue756 = { schemaName: "c", name: "issue756" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3427,6 +3446,9 @@ const registryConfig_pgResources_post_post = { schemaName: "a", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3447,9 +3469,10 @@ const resourceConfig_compound_type = { schemaName: "c", name: "compound_type" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const compound_type_mutationFunctionIdentifer = sql.identifier("b", "compound_type_mutation"); @@ -3508,6 +3531,9 @@ const registryConfig_pgResources_person_person = { schemaName: "c", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3545,6 +3571,9 @@ const registryConfig_pgResources_types_types = { schemaName: "b", name: "types" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { foreignKey: spec_types.extensions.tags.foreignKey } @@ -3898,9 +3927,7 @@ const registry = makeRegistry({ schemaName: "c", name: "current_user_id" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3922,9 +3949,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3947,9 +3972,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3972,9 +3995,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3996,9 +4017,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4021,9 +4040,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4046,9 +4063,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4070,9 +4085,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4094,9 +4107,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4118,9 +4129,7 @@ const registry = makeRegistry({ schemaName: "a", name: "return_void_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4142,9 +4151,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_set" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4166,9 +4173,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_set" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4190,9 +4195,7 @@ const registry = makeRegistry({ schemaName: "a", name: "static_big_integer" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4219,9 +4222,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4249,9 +4250,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_one_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -4279,9 +4278,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4309,9 +4306,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_one_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -4339,9 +4334,7 @@ const registry = makeRegistry({ schemaName: "a", name: "assert_something" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4370,7 +4363,7 @@ const registry = makeRegistry({ }, tags: { omit: "execute", - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField"] + behavior: ["-queryField -mutationField -typeField"] } }, description: undefined @@ -4398,9 +4391,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4427,9 +4418,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4456,9 +4445,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4485,9 +4472,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4514,9 +4499,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4543,9 +4526,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql_with_default" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4577,9 +4558,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 1 mutation" }, @@ -4611,9 +4590,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 1 query" }, @@ -4645,9 +4622,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 2 mutation" }, @@ -4679,9 +4654,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 2 query" }, @@ -4713,9 +4686,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 3 mutation" }, @@ -4747,9 +4718,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 3 query" }, @@ -4781,9 +4750,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 4 mutation" }, @@ -4815,9 +4782,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation_error" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4849,9 +4814,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 4 query" }, @@ -4883,9 +4846,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_1" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4917,9 +4878,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_2" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4951,9 +4910,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_3" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4985,9 +4942,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_4" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5019,9 +4974,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_inout" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -5044,9 +4997,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5068,9 +5019,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5092,9 +5041,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5126,9 +5073,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_inout" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -5151,9 +5096,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5175,9 +5118,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5199,9 +5140,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5225,7 +5164,7 @@ const registry = makeRegistry({ }, tags: { simpleCollections: "only", - behavior: ["queryField -mutationField -typeField", "-filter -order", "+list -connection"] + behavior: ["+list -connection"] } }, description: undefined @@ -5263,9 +5202,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_1" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5302,9 +5239,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_2" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5341,9 +5276,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_3" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5380,9 +5313,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_4" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5419,9 +5350,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_5" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5443,9 +5372,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5472,9 +5399,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_multi_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5511,9 +5436,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5550,9 +5473,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5574,9 +5495,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5603,9 +5522,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_multi_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5632,9 +5549,7 @@ const registry = makeRegistry({ schemaName: "b", name: "guid_fn" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5656,9 +5571,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5680,9 +5593,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5704,9 +5615,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_text_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5728,9 +5637,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_text_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5750,9 +5657,10 @@ const registry = makeRegistry({ schemaName: "a", name: "non_updatable_view" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, inputs: { @@ -5771,6 +5679,9 @@ const registry = makeRegistry({ schemaName: "a", name: "inputs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5790,6 +5701,9 @@ const registry = makeRegistry({ schemaName: "a", name: "patchs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5809,6 +5723,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5828,6 +5745,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reservedPatchs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5847,6 +5767,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved_input" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5866,6 +5789,9 @@ const registry = makeRegistry({ schemaName: "a", name: "default_value" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5893,6 +5819,9 @@ const registry = makeRegistry({ schemaName: "a", name: "no_primary_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5912,6 +5841,9 @@ const registry = makeRegistry({ schemaName: "a", name: "testview" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5932,6 +5864,9 @@ const registry = makeRegistry({ schemaName: "c", name: "my_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5960,6 +5895,9 @@ const registry = makeRegistry({ name: "unlogged", persistence: "u" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5979,6 +5917,9 @@ const registry = makeRegistry({ schemaName: "a", name: "view_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5999,6 +5940,9 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_1" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6018,6 +5962,9 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_2" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6046,6 +5993,9 @@ const registry = makeRegistry({ schemaName: "b", name: "updatable_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { uniqueKey: "x", unique: "x|@behavior -single -update -delete" @@ -6068,6 +6018,9 @@ const registry = makeRegistry({ schemaName: "c", name: "null_test_record" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6094,9 +6047,7 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case_computed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6116,9 +6067,7 @@ const registry = makeRegistry({ schemaName: "c", name: "return_table_without_grants" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6155,9 +6104,7 @@ const registry = makeRegistry({ schemaName: "b", name: "list_bde_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6177,6 +6124,9 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6197,9 +6147,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_fail" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6234,9 +6182,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6267,8 +6213,7 @@ const registry = makeRegistry({ }, tags: { arg0variant: "base", - resultFieldName: "leftArm", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "leftArm" } }, description: undefined @@ -6289,9 +6234,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6311,9 +6254,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6348,9 +6289,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_many" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6370,9 +6309,11 @@ const registry = makeRegistry({ schemaName: "b", name: "auth_payload" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - foreignKey: "(id) references c.person", - behavior: ["-insert", "-update", "-delete"] + foreignKey: "(id) references c.person" } } }, { @@ -6406,9 +6347,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_payload" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6460,9 +6399,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6514,9 +6451,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6543,9 +6478,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_computed_field" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6572,9 +6505,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_set" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6601,9 +6532,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6630,9 +6559,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_text_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6667,7 +6594,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -6703,7 +6630,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -6731,9 +6658,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_compound_type" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6760,9 +6685,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_compound_type" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6799,9 +6722,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6838,9 +6759,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_no_defaults" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6877,9 +6796,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_strict" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6916,9 +6833,7 @@ const registry = makeRegistry({ schemaName: "c", name: "query_output_two_rows" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6939,9 +6854,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6966,9 +6879,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6993,9 +6904,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7020,9 +6929,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7047,9 +6954,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7074,9 +6979,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7107,8 +7010,7 @@ const registry = makeRegistry({ name: "post_with_suffix" }, tags: { - deprecated: "This is deprecated (comment on function a.post_with_suffix).", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function a.post_with_suffix)." } }, description: undefined @@ -7134,9 +7036,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_compound_type_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7161,9 +7061,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_compound_type_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7188,9 +7086,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7215,9 +7111,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7247,9 +7141,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_compound_type_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7274,9 +7166,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_many" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7307,7 +7197,7 @@ const registry = makeRegistry({ notNull: true, sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] }, singleOutputParameterName: "o1" }, @@ -7338,7 +7228,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: "The first name of the person." @@ -7366,9 +7256,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_out_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7400,9 +7288,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -7435,9 +7321,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7470,8 +7354,7 @@ const registry = makeRegistry({ name: "person_exists" }, tags: { - deprecated: "This is deprecated (comment on function c.person_exists).", - behavior: ["-queryField -mutationField typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.person_exists)." } }, description: undefined @@ -7499,9 +7382,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7533,9 +7414,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7567,9 +7446,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7601,9 +7478,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7635,9 +7510,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7674,9 +7547,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_complex" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7701,9 +7572,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_first_post" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: "The first post by the person." }), @@ -7725,8 +7594,7 @@ const registry = makeRegistry({ name: "badly_behaved_function" }, tags: { - deprecated: "This is deprecated (comment on function c.badly_behaved_function).", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.badly_behaved_function)." } }, description: undefined @@ -7747,9 +7615,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7769,9 +7635,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7791,9 +7655,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7813,9 +7675,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7835,9 +7695,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7860,7 +7718,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["queryField -mutationField -typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -7881,9 +7739,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_query_plpgsql" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7908,9 +7764,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "person" }, description: undefined @@ -7938,7 +7792,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: undefined @@ -7960,9 +7814,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7982,9 +7834,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8009,9 +7859,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8036,9 +7884,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8063,9 +7909,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_connection" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8095,9 +7939,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8117,9 +7959,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8139,9 +7979,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8166,9 +8004,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_list" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }) diff --git a/postgraphile/postgraphile/__tests__/schema/v4/refs.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/refs.1.export.mjs index ac58dfe84f..04b783bd29 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/refs.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/refs.1.export.mjs @@ -191,6 +191,9 @@ const registryConfig_pgResources_people_people = { schemaName: "refs", name: "people" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -218,6 +221,9 @@ const registryConfig_pgResources_posts_posts = { schemaName: "refs", name: "posts" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { ref: "author via:(user_id)->people(id) singular" } diff --git a/postgraphile/postgraphile/__tests__/schema/v4/relay.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/relay.1.export.mjs index 7a48a7fe9b..cc558be427 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/relay.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/relay.1.export.mjs @@ -557,6 +557,9 @@ const registryConfig_pgResources_studios_studios = { schemaName: "d", name: "studios" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -584,6 +587,9 @@ const registryConfig_pgResources_post_post = { schemaName: "d", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -611,6 +617,9 @@ const registryConfig_pgResources_tv_episodes_tv_episodes = { schemaName: "d", name: "tv_episodes" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -638,6 +647,9 @@ const registryConfig_pgResources_tv_shows_tv_shows = { schemaName: "d", name: "tv_shows" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -670,6 +682,9 @@ const registryConfig_pgResources_person_person = { schemaName: "d", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -712,8 +727,7 @@ const registryConfig = { name: "original_function" }, tags: { - name: "renamed_function", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "renamed_function" } }, description: undefined @@ -734,9 +748,11 @@ const registryConfig = { schemaName: "d", name: "flibble" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - name: "flamble", - behavior: ["-insert", "-update", "-delete"] + name: "flamble" } } }, { @@ -755,9 +771,7 @@ const registryConfig = { schemaName: "d", name: "getflamble" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -777,6 +791,9 @@ const registryConfig = { schemaName: "d", name: "original_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "renamed_table" } @@ -798,6 +815,9 @@ const registryConfig = { schemaName: "d", name: "films" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -821,9 +841,10 @@ const registryConfig = { schemaName: "d", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "login", @@ -848,8 +869,7 @@ const registryConfig = { }, tags: { name: "login", - resultFieldName: "token", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "token" } }, description: undefined @@ -882,7 +902,7 @@ const registryConfig = { }, tags: { fieldName: "name", - behavior: ["-queryField -mutationField typeField", "-filter -order", "+queryField"], + behavior: "+queryField", arg0variant: "nodeId" } }, @@ -910,8 +930,7 @@ const registryConfig = { name: "search_posts" }, tags: { - name: "returnPostsMatching", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + name: "returnPostsMatching" } }, description: undefined diff --git a/postgraphile/postgraphile/__tests__/schema/v4/relay1.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/relay1.1.export.mjs index 5c1a8f47f4..6043f17888 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/relay1.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/relay1.1.export.mjs @@ -2368,6 +2368,9 @@ const registryConfig_pgResources_person_secret_person_secret = { schemaName: "c", name: "person_secret" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { deprecated: "This is deprecated (comment on table c.person_secret)." } @@ -2397,6 +2400,9 @@ const registryConfig_pgResources_compound_key_compound_key = { schemaName: "c", name: "compound_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2441,6 +2447,9 @@ const registryConfig_pgResources_left_arm_left_arm = { schemaName: "c", name: "left_arm" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2469,6 +2478,9 @@ const registryConfig_pgResources_issue756_issue756 = { schemaName: "c", name: "issue756" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2526,6 +2538,9 @@ const registryConfig_pgResources_person_person = { schemaName: "c", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2676,9 +2691,7 @@ const registry = makeRegistry({ schemaName: "c", name: "current_user_id" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2700,9 +2713,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2725,9 +2736,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2750,9 +2759,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2774,9 +2781,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2799,9 +2804,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2824,9 +2827,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2848,9 +2849,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2872,9 +2871,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2901,9 +2898,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2931,9 +2926,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_one_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -2961,9 +2954,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2991,9 +2982,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_one_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -3021,9 +3010,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3050,9 +3037,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3079,9 +3064,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3108,9 +3091,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3137,9 +3118,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3166,9 +3145,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql_with_default" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3200,9 +3177,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_inout" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -3225,9 +3200,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3249,9 +3222,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3273,9 +3244,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3307,9 +3276,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_inout" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -3332,9 +3299,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3356,9 +3321,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3380,9 +3343,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3404,9 +3365,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3433,9 +3392,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_multi_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3472,9 +3429,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3511,9 +3466,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3535,9 +3488,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3564,9 +3515,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_multi_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3590,7 +3539,7 @@ const registry = makeRegistry({ }, tags: { simpleCollections: "only", - behavior: ["queryField -mutationField -typeField", "-filter -order", "+list -connection"] + behavior: ["+list -connection"] } }, description: undefined @@ -3611,6 +3560,9 @@ const registry = makeRegistry({ schemaName: "c", name: "my_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3639,6 +3591,9 @@ const registry = makeRegistry({ name: "unlogged", persistence: "u" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3659,6 +3614,9 @@ const registry = makeRegistry({ schemaName: "c", name: "null_test_record" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3685,9 +3643,7 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case_computed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3707,9 +3663,7 @@ const registry = makeRegistry({ schemaName: "c", name: "return_table_without_grants" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -3729,6 +3683,9 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3759,8 +3716,7 @@ const registry = makeRegistry({ }, tags: { arg0variant: "base", - resultFieldName: "leftArm", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "leftArm" } }, description: undefined @@ -3782,9 +3738,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -3804,9 +3758,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -3858,9 +3810,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3912,9 +3862,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3941,9 +3889,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_computed_field" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3970,9 +3916,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_compound_type" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3999,9 +3943,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_compound_type" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4038,9 +3980,7 @@ const registry = makeRegistry({ schemaName: "c", name: "query_output_two_rows" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4060,9 +4000,10 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "compound_type_set_query", @@ -4080,9 +4021,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4110,9 +4049,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4140,9 +4077,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4173,7 +4108,7 @@ const registry = makeRegistry({ notNull: true, sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] }, singleOutputParameterName: "o1" }, @@ -4204,7 +4139,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: "The first name of the person." @@ -4232,9 +4167,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_out_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4266,9 +4199,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -4301,9 +4232,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4336,8 +4265,7 @@ const registry = makeRegistry({ name: "person_exists" }, tags: { - deprecated: "This is deprecated (comment on function c.person_exists).", - behavior: ["-queryField -mutationField typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.person_exists)." } }, description: undefined @@ -4365,9 +4293,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4399,9 +4325,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4433,9 +4357,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4467,9 +4389,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4501,9 +4421,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4540,9 +4458,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_complex" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4571,9 +4487,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_first_post" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: "The first post by the person." }), @@ -4594,8 +4508,7 @@ const registry = makeRegistry({ name: "badly_behaved_function" }, tags: { - deprecated: "This is deprecated (comment on function c.badly_behaved_function).", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.badly_behaved_function)." } }, description: undefined @@ -4616,9 +4529,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4638,9 +4549,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4660,9 +4569,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4682,9 +4589,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4704,9 +4609,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4729,7 +4632,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["queryField -mutationField -typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -4750,9 +4653,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_query_plpgsql" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4777,9 +4678,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "person" }, description: undefined @@ -4807,7 +4706,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: undefined @@ -4836,9 +4735,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_connection" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4871,9 +4768,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4901,9 +4796,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_list" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }) 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 9020d5a7c6..c37e799332 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.1.export.mjs @@ -2368,6 +2368,9 @@ const registryConfig_pgResources_person_secret_person_secret = { schemaName: "c", name: "person_secret" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { deprecated: "This is deprecated (comment on table c.person_secret)." } @@ -2397,6 +2400,9 @@ const registryConfig_pgResources_compound_key_compound_key = { schemaName: "c", name: "compound_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2441,6 +2447,9 @@ const registryConfig_pgResources_left_arm_left_arm = { schemaName: "c", name: "left_arm" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2469,6 +2478,9 @@ const registryConfig_pgResources_issue756_issue756 = { schemaName: "c", name: "issue756" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2526,6 +2538,9 @@ const registryConfig_pgResources_person_person = { schemaName: "c", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2676,9 +2691,7 @@ const registry = makeRegistry({ schemaName: "c", name: "current_user_id" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2700,9 +2713,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2725,9 +2736,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2750,9 +2759,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2774,9 +2781,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2799,9 +2804,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2824,9 +2827,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2848,9 +2849,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2872,9 +2871,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2901,9 +2898,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2931,9 +2926,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_one_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -2961,9 +2954,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2991,9 +2982,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_one_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -3021,9 +3010,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3050,9 +3037,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3079,9 +3064,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3108,9 +3091,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3137,9 +3118,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3166,9 +3145,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql_with_default" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3200,9 +3177,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_inout" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -3225,9 +3200,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3249,9 +3222,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3273,9 +3244,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3307,9 +3276,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_inout" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -3332,9 +3299,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3356,9 +3321,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3380,9 +3343,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3404,9 +3365,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3433,9 +3392,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_multi_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3472,9 +3429,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3511,9 +3466,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3535,9 +3488,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3564,9 +3515,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_multi_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3590,7 +3539,7 @@ const registry = makeRegistry({ }, tags: { simpleCollections: "only", - behavior: ["queryField -mutationField -typeField", "-filter -order", "+list -connection"] + behavior: ["+list -connection"] } }, description: undefined @@ -3611,6 +3560,9 @@ const registry = makeRegistry({ schemaName: "c", name: "my_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3639,6 +3591,9 @@ const registry = makeRegistry({ name: "unlogged", persistence: "u" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3659,6 +3614,9 @@ const registry = makeRegistry({ schemaName: "c", name: "null_test_record" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3685,9 +3643,7 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case_computed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3707,9 +3663,7 @@ const registry = makeRegistry({ schemaName: "c", name: "return_table_without_grants" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -3729,6 +3683,9 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3759,8 +3716,7 @@ const registry = makeRegistry({ }, tags: { arg0variant: "base", - resultFieldName: "leftArm", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "leftArm" } }, description: undefined @@ -3782,9 +3738,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -3804,9 +3758,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -3858,9 +3810,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3912,9 +3862,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3941,9 +3889,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_computed_field" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3970,9 +3916,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_compound_type" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3999,9 +3943,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_compound_type" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4038,9 +3980,7 @@ const registry = makeRegistry({ schemaName: "c", name: "query_output_two_rows" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4060,9 +4000,10 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "compound_type_set_query", @@ -4080,9 +4021,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4110,9 +4049,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4140,9 +4077,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4173,7 +4108,7 @@ const registry = makeRegistry({ notNull: true, sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] }, singleOutputParameterName: "o1" }, @@ -4204,7 +4139,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: "The first name of the person." @@ -4232,9 +4167,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_out_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4266,9 +4199,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -4301,9 +4232,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4336,8 +4265,7 @@ const registry = makeRegistry({ name: "person_exists" }, tags: { - deprecated: "This is deprecated (comment on function c.person_exists).", - behavior: ["-queryField -mutationField typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.person_exists)." } }, description: undefined @@ -4365,9 +4293,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4399,9 +4325,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4433,9 +4357,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4467,9 +4389,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4501,9 +4421,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4540,9 +4458,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_complex" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4571,9 +4487,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_first_post" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: "The first post by the person." }), @@ -4594,8 +4508,7 @@ const registry = makeRegistry({ name: "badly_behaved_function" }, tags: { - deprecated: "This is deprecated (comment on function c.badly_behaved_function).", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.badly_behaved_function)." } }, description: undefined @@ -4616,9 +4529,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4638,9 +4549,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4660,9 +4569,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4682,9 +4589,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4704,9 +4609,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4729,7 +4632,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["queryField -mutationField -typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -4750,9 +4653,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_query_plpgsql" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4777,9 +4678,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "person" }, description: undefined @@ -4807,7 +4706,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: undefined @@ -4836,9 +4735,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_connection" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4871,9 +4768,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4901,9 +4796,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_list" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }) diff --git a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.omit-pets-simple.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.omit-pets-simple.1.export.mjs index fb86b24fac..a828a59518 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.omit-pets-simple.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.omit-pets-simple.1.export.mjs @@ -182,6 +182,9 @@ const registryConfig_pgResources_people_people = { schemaName: "simple_collections", name: "people" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -209,6 +212,9 @@ const registryConfig_pgResources_pets_pets = { schemaName: "simple_collections", name: "pets" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -251,7 +257,7 @@ const registry = makeRegistry({ }, tags: { simpleCollections: "only", - behavior: ["-queryField -mutationField typeField", "-filter -order", "+list -connection"] + behavior: ["+list -connection"] } }, description: undefined diff --git a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.only-people-omit.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.only-people-omit.1.export.mjs index 722dac07ae..5eac6bd8d3 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.only-people-omit.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.only-people-omit.1.export.mjs @@ -185,6 +185,9 @@ const registryConfig_pgResources_people_people = { schemaName: "simple_collections", name: "people" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { simpleCollections: "omit", behavior: spec_people.extensions.tags.behavior @@ -215,6 +218,9 @@ const registryConfig_pgResources_pets_pets = { schemaName: "simple_collections", name: "pets" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -255,9 +261,7 @@ const registry = makeRegistry({ schemaName: "simple_collections", name: "people_odd_pets" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }) 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 d12584ac3c..613e4c0ef8 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 @@ -2368,6 +2368,9 @@ const registryConfig_pgResources_person_secret_person_secret = { schemaName: "c", name: "person_secret" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { deprecated: "This is deprecated (comment on table c.person_secret)." } @@ -2397,6 +2400,9 @@ const registryConfig_pgResources_compound_key_compound_key = { schemaName: "c", name: "compound_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2441,6 +2447,9 @@ const registryConfig_pgResources_left_arm_left_arm = { schemaName: "c", name: "left_arm" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2469,6 +2478,9 @@ const registryConfig_pgResources_issue756_issue756 = { schemaName: "c", name: "issue756" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2526,6 +2538,9 @@ const registryConfig_pgResources_person_person = { schemaName: "c", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2676,9 +2691,7 @@ const registry = makeRegistry({ schemaName: "c", name: "current_user_id" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2700,9 +2713,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2725,9 +2736,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2750,9 +2759,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2774,9 +2781,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2799,9 +2804,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2824,9 +2827,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2848,9 +2849,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2872,9 +2871,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -2901,9 +2898,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2931,9 +2926,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_one_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -2961,9 +2954,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -2991,9 +2982,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_one_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -3021,9 +3010,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3050,9 +3037,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3079,9 +3064,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3108,9 +3091,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3137,9 +3118,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3166,9 +3145,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql_with_default" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3200,9 +3177,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_inout" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -3225,9 +3200,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3249,9 +3222,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3273,9 +3244,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3307,9 +3276,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_inout" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -3332,9 +3299,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3356,9 +3321,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3380,9 +3343,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3404,9 +3365,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3433,9 +3392,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_multi_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3472,9 +3429,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3511,9 +3466,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3535,9 +3488,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3564,9 +3515,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_multi_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3590,7 +3539,7 @@ const registry = makeRegistry({ }, tags: { simpleCollections: "only", - behavior: ["queryField -mutationField -typeField", "-filter -order", "+list -connection"] + behavior: ["+list -connection"] } }, description: undefined @@ -3611,6 +3560,9 @@ const registry = makeRegistry({ schemaName: "c", name: "my_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3639,6 +3591,9 @@ const registry = makeRegistry({ name: "unlogged", persistence: "u" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3659,6 +3614,9 @@ const registry = makeRegistry({ schemaName: "c", name: "null_test_record" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3685,9 +3643,7 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case_computed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3707,9 +3663,7 @@ const registry = makeRegistry({ schemaName: "c", name: "return_table_without_grants" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -3729,6 +3683,9 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -3759,8 +3716,7 @@ const registry = makeRegistry({ }, tags: { arg0variant: "base", - resultFieldName: "leftArm", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "leftArm" } }, description: undefined @@ -3782,9 +3738,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -3804,9 +3758,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -3858,9 +3810,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3912,9 +3862,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3941,9 +3889,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_computed_field" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3970,9 +3916,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_compound_type" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3999,9 +3943,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_compound_type" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4038,9 +3980,7 @@ const registry = makeRegistry({ schemaName: "c", name: "query_output_two_rows" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4060,9 +4000,10 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, { name: "compound_type_set_query", @@ -4080,9 +4021,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4110,9 +4049,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4140,9 +4077,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4173,7 +4108,7 @@ const registry = makeRegistry({ notNull: true, sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] }, singleOutputParameterName: "o1" }, @@ -4204,7 +4139,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: "The first name of the person." @@ -4232,9 +4167,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_out_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4266,9 +4199,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -4301,9 +4232,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4336,8 +4265,7 @@ const registry = makeRegistry({ name: "person_exists" }, tags: { - deprecated: "This is deprecated (comment on function c.person_exists).", - behavior: ["-queryField -mutationField typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.person_exists)." } }, description: undefined @@ -4365,9 +4293,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4399,9 +4325,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4433,9 +4357,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4467,9 +4389,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4501,9 +4421,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4540,9 +4458,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_complex" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4571,9 +4487,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_first_post" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: "The first post by the person." }), @@ -4594,8 +4508,7 @@ const registry = makeRegistry({ name: "badly_behaved_function" }, tags: { - deprecated: "This is deprecated (comment on function c.badly_behaved_function).", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.badly_behaved_function)." } }, description: undefined @@ -4616,9 +4529,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4638,9 +4549,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4660,9 +4569,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4682,9 +4589,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4704,9 +4609,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4729,7 +4632,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["queryField -mutationField -typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -4750,9 +4653,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_query_plpgsql" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4777,9 +4678,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "person" }, description: undefined @@ -4807,7 +4706,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: undefined @@ -4836,9 +4735,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_connection" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4871,9 +4768,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -4901,9 +4796,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_list" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }) diff --git a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.pets-simple.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.pets-simple.1.export.mjs index 1ee6404967..eb32a89989 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.pets-simple.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.pets-simple.1.export.mjs @@ -182,6 +182,9 @@ const registryConfig_pgResources_people_people = { schemaName: "simple_collections", name: "people" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -209,6 +212,9 @@ const registryConfig_pgResources_pets_pets = { schemaName: "simple_collections", name: "pets" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -249,9 +255,7 @@ const registry = makeRegistry({ schemaName: "simple_collections", name: "people_odd_pets" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }) diff --git a/postgraphile/postgraphile/__tests__/schema/v4/simplePrint.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/simplePrint.export.mjs index 43fe7e8a97..87880572e4 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/simplePrint.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/simplePrint.export.mjs @@ -3169,6 +3169,9 @@ const registryConfig_pgResources_foreign_key_foreign_key = { schemaName: "a", name: "foreign_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3195,6 +3198,9 @@ const registryConfig_pgResources_unique_foreign_key_unique_foreign_key = { schemaName: "a", name: "unique_foreign_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "create,update,delete,all,order,filter", behavior: spec_uniqueForeignKey.extensions.tags.behavior @@ -3233,6 +3239,9 @@ const registryConfig_pgResources_person_secret_person_secret = { schemaName: "c", name: "person_secret" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { deprecated: "This is deprecated (comment on table c.person_secret)." } @@ -3270,6 +3279,9 @@ const registryConfig_pgResources_compound_key_compound_key = { schemaName: "c", name: "compound_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3331,6 +3343,9 @@ const registryConfig_pgResources_left_arm_left_arm = { schemaName: "c", name: "left_arm" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3351,9 +3366,10 @@ const resourceConfig_jwt_token = { schemaName: "b", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const authenticateFunctionIdentifer = sql.identifier("b", "authenticate"); @@ -3381,6 +3397,9 @@ const registryConfig_pgResources_issue756_issue756 = { schemaName: "c", name: "issue756" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3427,6 +3446,9 @@ const registryConfig_pgResources_post_post = { schemaName: "a", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3447,9 +3469,10 @@ const resourceConfig_compound_type = { schemaName: "c", name: "compound_type" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const compound_type_mutationFunctionIdentifer = sql.identifier("b", "compound_type_mutation"); @@ -3508,6 +3531,9 @@ const registryConfig_pgResources_person_person = { schemaName: "c", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3545,6 +3571,9 @@ const registryConfig_pgResources_types_types = { schemaName: "b", name: "types" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { foreignKey: spec_types.extensions.tags.foreignKey } @@ -3898,9 +3927,7 @@ const registry = makeRegistry({ schemaName: "c", name: "current_user_id" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3922,9 +3949,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3947,9 +3972,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3972,9 +3995,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3996,9 +4017,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4021,9 +4040,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4046,9 +4063,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4070,9 +4085,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4094,9 +4107,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4118,9 +4129,7 @@ const registry = makeRegistry({ schemaName: "a", name: "return_void_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4142,9 +4151,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_set" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4166,9 +4173,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_set" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4190,9 +4195,7 @@ const registry = makeRegistry({ schemaName: "a", name: "static_big_integer" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4219,9 +4222,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4249,9 +4250,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_one_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -4279,9 +4278,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4309,9 +4306,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_one_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -4339,9 +4334,7 @@ const registry = makeRegistry({ schemaName: "a", name: "assert_something" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4370,7 +4363,7 @@ const registry = makeRegistry({ }, tags: { omit: "execute", - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField"] + behavior: ["-queryField -mutationField -typeField"] } }, description: undefined @@ -4398,9 +4391,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4427,9 +4418,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4456,9 +4445,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4485,9 +4472,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4514,9 +4499,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4543,9 +4526,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql_with_default" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4577,9 +4558,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 1 mutation" }, @@ -4611,9 +4590,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 1 query" }, @@ -4645,9 +4622,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 2 mutation" }, @@ -4679,9 +4654,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 2 query" }, @@ -4713,9 +4686,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 3 mutation" }, @@ -4747,9 +4718,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 3 query" }, @@ -4781,9 +4750,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 4 mutation" }, @@ -4815,9 +4782,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation_error" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4849,9 +4814,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 4 query" }, @@ -4883,9 +4846,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_1" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4917,9 +4878,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_2" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4951,9 +4910,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_3" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4985,9 +4942,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_4" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5019,9 +4974,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_inout" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -5044,9 +4997,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5068,9 +5019,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5092,9 +5041,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5126,9 +5073,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_inout" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -5151,9 +5096,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5175,9 +5118,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5199,9 +5140,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5225,7 +5164,7 @@ const registry = makeRegistry({ }, tags: { simpleCollections: "only", - behavior: ["queryField -mutationField -typeField", "-filter -order", "+list -connection"] + behavior: ["+list -connection"] } }, description: undefined @@ -5263,9 +5202,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_1" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5302,9 +5239,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_2" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5341,9 +5276,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_3" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5380,9 +5313,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_4" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5419,9 +5350,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_5" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5443,9 +5372,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5472,9 +5399,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_multi_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5511,9 +5436,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5550,9 +5473,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5574,9 +5495,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5603,9 +5522,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_multi_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5632,9 +5549,7 @@ const registry = makeRegistry({ schemaName: "b", name: "guid_fn" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5656,9 +5571,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5680,9 +5593,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5704,9 +5615,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_text_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5728,9 +5637,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_text_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5750,9 +5657,10 @@ const registry = makeRegistry({ schemaName: "a", name: "non_updatable_view" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, inputs: { @@ -5771,6 +5679,9 @@ const registry = makeRegistry({ schemaName: "a", name: "inputs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5790,6 +5701,9 @@ const registry = makeRegistry({ schemaName: "a", name: "patchs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5809,6 +5723,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5828,6 +5745,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reservedPatchs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5847,6 +5767,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved_input" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5866,6 +5789,9 @@ const registry = makeRegistry({ schemaName: "a", name: "default_value" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5893,6 +5819,9 @@ const registry = makeRegistry({ schemaName: "a", name: "no_primary_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5912,6 +5841,9 @@ const registry = makeRegistry({ schemaName: "a", name: "testview" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5932,6 +5864,9 @@ const registry = makeRegistry({ schemaName: "c", name: "my_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5960,6 +5895,9 @@ const registry = makeRegistry({ name: "unlogged", persistence: "u" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5979,6 +5917,9 @@ const registry = makeRegistry({ schemaName: "a", name: "view_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5999,6 +5940,9 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_1" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6018,6 +5962,9 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_2" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6046,6 +5993,9 @@ const registry = makeRegistry({ schemaName: "b", name: "updatable_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { uniqueKey: "x", unique: "x|@behavior -single -update -delete" @@ -6068,6 +6018,9 @@ const registry = makeRegistry({ schemaName: "c", name: "null_test_record" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6094,9 +6047,7 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case_computed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6116,9 +6067,7 @@ const registry = makeRegistry({ schemaName: "c", name: "return_table_without_grants" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6155,9 +6104,7 @@ const registry = makeRegistry({ schemaName: "b", name: "list_bde_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6177,6 +6124,9 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6197,9 +6147,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_fail" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6234,9 +6182,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6267,8 +6213,7 @@ const registry = makeRegistry({ }, tags: { arg0variant: "base", - resultFieldName: "leftArm", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "leftArm" } }, description: undefined @@ -6289,9 +6234,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6311,9 +6254,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6348,9 +6289,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_many" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6370,9 +6309,11 @@ const registry = makeRegistry({ schemaName: "b", name: "auth_payload" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - foreignKey: "(id) references c.person", - behavior: ["-insert", "-update", "-delete"] + foreignKey: "(id) references c.person" } } }, { @@ -6406,9 +6347,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_payload" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6460,9 +6399,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6514,9 +6451,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6543,9 +6478,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_computed_field" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6572,9 +6505,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_set" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6601,9 +6532,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6630,9 +6559,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_text_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6667,7 +6594,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -6703,7 +6630,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -6731,9 +6658,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_compound_type" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6760,9 +6685,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_compound_type" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6799,9 +6722,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6838,9 +6759,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_no_defaults" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6877,9 +6796,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_strict" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6916,9 +6833,7 @@ const registry = makeRegistry({ schemaName: "c", name: "query_output_two_rows" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6939,9 +6854,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6966,9 +6879,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6993,9 +6904,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7020,9 +6929,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7047,9 +6954,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7074,9 +6979,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7107,8 +7010,7 @@ const registry = makeRegistry({ name: "post_with_suffix" }, tags: { - deprecated: "This is deprecated (comment on function a.post_with_suffix).", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function a.post_with_suffix)." } }, description: undefined @@ -7134,9 +7036,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_compound_type_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7161,9 +7061,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_compound_type_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7188,9 +7086,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7215,9 +7111,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7247,9 +7141,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_compound_type_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7274,9 +7166,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_many" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7307,7 +7197,7 @@ const registry = makeRegistry({ notNull: true, sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] }, singleOutputParameterName: "o1" }, @@ -7338,7 +7228,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: "The first name of the person." @@ -7366,9 +7256,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_out_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7400,9 +7288,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -7435,9 +7321,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7470,8 +7354,7 @@ const registry = makeRegistry({ name: "person_exists" }, tags: { - deprecated: "This is deprecated (comment on function c.person_exists).", - behavior: ["-queryField -mutationField typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.person_exists)." } }, description: undefined @@ -7499,9 +7382,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7533,9 +7414,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7567,9 +7446,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7601,9 +7478,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7635,9 +7510,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7674,9 +7547,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_complex" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7701,9 +7572,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_first_post" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: "The first post by the person." }), @@ -7725,8 +7594,7 @@ const registry = makeRegistry({ name: "badly_behaved_function" }, tags: { - deprecated: "This is deprecated (comment on function c.badly_behaved_function).", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.badly_behaved_function)." } }, description: undefined @@ -7747,9 +7615,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7769,9 +7635,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7791,9 +7655,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7813,9 +7675,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7835,9 +7695,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7860,7 +7718,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["queryField -mutationField -typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -7881,9 +7739,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_query_plpgsql" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7908,9 +7764,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "person" }, description: undefined @@ -7938,7 +7792,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: undefined @@ -7960,9 +7814,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7982,9 +7834,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8009,9 +7859,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8036,9 +7884,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8063,9 +7909,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_connection" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8095,9 +7939,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8117,9 +7959,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8139,9 +7979,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8166,9 +8004,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_list" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }) diff --git a/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.1.export.mjs index 842e0662d0..23d8675372 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.1.export.mjs @@ -3107,6 +3107,9 @@ const registryConfig_pgResources_foreign_key_foreign_key = { schemaName: "a", name: "foreign_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3133,6 +3136,9 @@ const registryConfig_pgResources_unique_foreign_key_unique_foreign_key = { schemaName: "a", name: "unique_foreign_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "create,update,delete,all,order,filter", behavior: spec_uniqueForeignKey.extensions.tags.behavior @@ -3171,6 +3177,9 @@ const registryConfig_pgResources_person_secret_person_secret = { schemaName: "c", name: "person_secret" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { deprecated: "This is deprecated (comment on table c.person_secret)." } @@ -3208,6 +3217,9 @@ const registryConfig_pgResources_compound_key_compound_key = { schemaName: "c", name: "compound_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3269,6 +3281,9 @@ const registryConfig_pgResources_left_arm_left_arm = { schemaName: "c", name: "left_arm" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3289,9 +3304,10 @@ const resourceConfig_jwt_token = { schemaName: "b", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const authenticateFunctionIdentifer = sql.identifier("b", "authenticate"); @@ -3319,6 +3335,9 @@ const registryConfig_pgResources_issue756_issue756 = { schemaName: "c", name: "issue756" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3365,6 +3384,9 @@ const registryConfig_pgResources_post_post = { schemaName: "a", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3385,9 +3407,10 @@ const resourceConfig_compound_type = { schemaName: "c", name: "compound_type" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const compound_type_mutationFunctionIdentifer = sql.identifier("b", "compound_type_mutation"); @@ -3446,6 +3469,9 @@ const registryConfig_pgResources_person_person = { schemaName: "c", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3483,6 +3509,9 @@ const registryConfig_pgResources_types_types = { schemaName: "b", name: "types" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { foreignKey: spec_types.extensions.tags.foreignKey } @@ -3836,9 +3865,7 @@ const registry = makeRegistry({ schemaName: "c", name: "current_user_id" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3860,9 +3887,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3885,9 +3910,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3910,9 +3933,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -3934,9 +3955,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3959,9 +3978,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3984,9 +4001,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4008,9 +4023,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4032,9 +4045,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4056,9 +4067,7 @@ const registry = makeRegistry({ schemaName: "a", name: "return_void_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4080,9 +4089,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_set" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4104,9 +4111,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_set" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4128,9 +4133,7 @@ const registry = makeRegistry({ schemaName: "a", name: "static_big_integer" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4157,9 +4160,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4187,9 +4188,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_one_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -4217,9 +4216,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4247,9 +4244,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_one_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -4277,9 +4272,7 @@ const registry = makeRegistry({ schemaName: "a", name: "assert_something" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4308,7 +4301,7 @@ const registry = makeRegistry({ }, tags: { omit: "execute", - behavior: ["queryField -mutationField -typeField", "-filter -order", "-queryField -mutationField -typeField"] + behavior: ["-queryField -mutationField -typeField"] } }, description: undefined @@ -4336,9 +4329,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4365,9 +4356,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4394,9 +4383,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4423,9 +4410,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4452,9 +4437,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4481,9 +4464,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql_with_default" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4515,9 +4496,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 1 mutation" }, @@ -4549,9 +4528,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 1 query" }, @@ -4583,9 +4560,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 2 mutation" }, @@ -4617,9 +4592,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 2 query" }, @@ -4651,9 +4624,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 3 mutation" }, @@ -4685,9 +4656,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 3 query" }, @@ -4719,9 +4688,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 4 mutation" }, @@ -4753,9 +4720,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation_error" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4787,9 +4752,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: "lol, add some stuff 4 query" }, @@ -4821,9 +4784,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_1" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4855,9 +4816,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_2" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4889,9 +4848,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_3" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4923,9 +4880,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_4" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -4957,9 +4912,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_inout" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -4982,9 +4935,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5006,9 +4957,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5030,9 +4979,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5064,9 +5011,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_inout" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -5089,9 +5034,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5113,9 +5056,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5137,9 +5078,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5163,7 +5102,7 @@ const registry = makeRegistry({ }, tags: { simpleCollections: "only", - behavior: ["queryField -mutationField -typeField", "-filter -order", "+list -connection"] + behavior: ["+list -connection"] } }, description: undefined @@ -5201,9 +5140,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_1" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5240,9 +5177,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_2" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5279,9 +5214,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_3" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5318,9 +5251,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_4" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5357,9 +5288,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_5" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5381,9 +5310,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5410,9 +5337,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_multi_col" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5449,9 +5374,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5488,9 +5411,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5512,9 +5433,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5541,9 +5460,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_multi_col" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5570,9 +5487,7 @@ const registry = makeRegistry({ schemaName: "b", name: "guid_fn" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5594,9 +5509,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5618,9 +5531,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5642,9 +5553,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_text_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5666,9 +5575,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_text_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -5688,9 +5595,10 @@ const registry = makeRegistry({ schemaName: "a", name: "non_updatable_view" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, inputs: { @@ -5709,6 +5617,9 @@ const registry = makeRegistry({ schemaName: "a", name: "inputs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5728,6 +5639,9 @@ const registry = makeRegistry({ schemaName: "a", name: "patchs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5747,6 +5661,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5766,6 +5683,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reservedPatchs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5785,6 +5705,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved_input" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5804,6 +5727,9 @@ const registry = makeRegistry({ schemaName: "a", name: "default_value" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5831,6 +5757,9 @@ const registry = makeRegistry({ schemaName: "a", name: "no_primary_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5850,6 +5779,9 @@ const registry = makeRegistry({ schemaName: "a", name: "testview" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5870,6 +5802,9 @@ const registry = makeRegistry({ schemaName: "c", name: "my_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5898,6 +5833,9 @@ const registry = makeRegistry({ name: "unlogged", persistence: "u" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5917,6 +5855,9 @@ const registry = makeRegistry({ schemaName: "a", name: "view_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5937,6 +5878,9 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_1" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5956,6 +5900,9 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_2" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5984,6 +5931,9 @@ const registry = makeRegistry({ schemaName: "b", name: "updatable_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { uniqueKey: "x", unique: "x|@behavior -single -update -delete" @@ -6006,6 +5956,9 @@ const registry = makeRegistry({ schemaName: "c", name: "null_test_record" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6032,9 +5985,7 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case_computed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6054,9 +6005,7 @@ const registry = makeRegistry({ schemaName: "c", name: "return_table_without_grants" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6093,9 +6042,7 @@ const registry = makeRegistry({ schemaName: "b", name: "list_bde_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6115,6 +6062,9 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6135,9 +6085,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_fail" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6172,9 +6120,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6205,8 +6151,7 @@ const registry = makeRegistry({ }, tags: { arg0variant: "base", - resultFieldName: "leftArm", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + resultFieldName: "leftArm" } }, description: undefined @@ -6227,9 +6172,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6249,9 +6192,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6286,9 +6227,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_many" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6308,9 +6247,11 @@ const registry = makeRegistry({ schemaName: "b", name: "auth_payload" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - foreignKey: "(id) references c.person", - behavior: ["-insert", "-update", "-delete"] + foreignKey: "(id) references c.person" } } }, { @@ -6344,9 +6285,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_payload" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6398,9 +6337,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6452,9 +6389,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6481,9 +6416,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_computed_field" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6510,9 +6443,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_set" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6539,9 +6470,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6568,9 +6497,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_text_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6605,7 +6532,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -6641,7 +6568,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -6669,9 +6596,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_compound_type" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6698,9 +6623,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_compound_type" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6737,9 +6660,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6776,9 +6697,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_no_defaults" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6815,9 +6734,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_strict" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6854,9 +6771,7 @@ const registry = makeRegistry({ schemaName: "c", name: "query_output_two_rows" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -6877,9 +6792,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_set_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6904,9 +6817,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6931,9 +6842,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6958,9 +6867,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -6985,9 +6892,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7012,9 +6917,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7045,8 +6948,7 @@ const registry = makeRegistry({ name: "post_with_suffix" }, tags: { - deprecated: "This is deprecated (comment on function a.post_with_suffix).", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function a.post_with_suffix)." } }, description: undefined @@ -7072,9 +6974,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_compound_type_array" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7099,9 +6999,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_compound_type_array" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7126,9 +7024,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7153,9 +7049,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_query" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7185,9 +7079,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_compound_type_array" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7212,9 +7104,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_many" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7245,7 +7135,7 @@ const registry = makeRegistry({ notNull: true, sortable: true, filterable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] }, singleOutputParameterName: "o1" }, @@ -7276,7 +7166,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: "The first name of the person." @@ -7304,9 +7194,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_out_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7338,9 +7226,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -7373,9 +7259,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7408,8 +7292,7 @@ const registry = makeRegistry({ name: "person_exists" }, tags: { - deprecated: "This is deprecated (comment on function c.person_exists).", - behavior: ["-queryField -mutationField typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.person_exists)." } }, description: undefined @@ -7437,9 +7320,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout_out" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7471,9 +7352,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7505,9 +7384,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7539,9 +7416,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7573,9 +7448,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7612,9 +7485,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_complex" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }, @@ -7639,9 +7510,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_first_post" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: "The first post by the person." }), @@ -7663,8 +7532,7 @@ const registry = makeRegistry({ name: "badly_behaved_function" }, tags: { - deprecated: "This is deprecated (comment on function c.badly_behaved_function).", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + deprecated: "This is deprecated (comment on function c.badly_behaved_function)." } }, description: undefined @@ -7685,9 +7553,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7707,9 +7573,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table_setof" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7729,9 +7593,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7751,9 +7613,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table_setof" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7773,9 +7633,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7798,7 +7656,7 @@ const registry = makeRegistry({ tags: { sortable: true, filterable: true, - behavior: ["queryField -mutationField -typeField", "-filter -order", "filter filterBy", "orderBy order resource:connection:backwards"] + behavior: ["filter filterBy", "orderBy order resource:connection:backwards"] } }, description: undefined @@ -7819,9 +7677,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_query_plpgsql" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7846,9 +7702,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - }, + tags: {}, singleOutputParameterName: "person" }, description: undefined @@ -7876,7 +7730,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - behavior: ["-queryField -mutationField typeField", "-filter -order", "orderBy order resource:connection:backwards"] + behavior: ["orderBy order resource:connection:backwards"] } }, description: undefined @@ -7898,9 +7752,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7920,9 +7772,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7947,9 +7797,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -7974,9 +7822,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8001,9 +7847,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_connection" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8033,9 +7877,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8055,9 +7897,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8077,9 +7917,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list_mutation" }, - tags: { - behavior: ["-queryField mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -8104,9 +7942,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_list" }, - tags: { - behavior: ["-queryField -mutationField typeField", "-filter -order"] - } + tags: {} }, description: undefined }) 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 9cd4cc87a1..cdf9417dd2 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.polymorphic.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.polymorphic.1.export.mjs @@ -2324,6 +2324,9 @@ const registryConfig_pgResources_aws_application_first_party_vulnerabilities_aws schemaName: "polymorphic", name: "aws_application_first_party_vulnerabilities" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: true, behavior: spec_awsApplicationFirstPartyVulnerabilities.extensions.tags.behavior @@ -2353,6 +2356,9 @@ const registryConfig_pgResources_aws_application_third_party_vulnerabilities_aws schemaName: "polymorphic", name: "aws_application_third_party_vulnerabilities" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: true, behavior: spec_awsApplicationThirdPartyVulnerabilities.extensions.tags.behavior @@ -2382,6 +2388,9 @@ const registryConfig_pgResources_gcp_application_first_party_vulnerabilities_gcp schemaName: "polymorphic", name: "gcp_application_first_party_vulnerabilities" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: true, behavior: spec_gcpApplicationFirstPartyVulnerabilities.extensions.tags.behavior @@ -2411,6 +2420,9 @@ const registryConfig_pgResources_gcp_application_third_party_vulnerabilities_gcp schemaName: "polymorphic", name: "gcp_application_third_party_vulnerabilities" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: true, behavior: spec_gcpApplicationThirdPartyVulnerabilities.extensions.tags.behavior @@ -2448,6 +2460,9 @@ const registryConfig_pgResources_organizations_organizations = { schemaName: "polymorphic", name: "organizations" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { unionMember: "PersonOrOrganization" } @@ -2484,6 +2499,9 @@ const registryConfig_pgResources_people_people = { schemaName: "polymorphic", name: "people" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { unionMember: "PersonOrOrganization", ref: "applications to:Application", @@ -2514,6 +2532,9 @@ const registryConfig_pgResources_priorities_priorities = { schemaName: "polymorphic", name: "priorities" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "create,update,delete,filter,order", behavior: spec_priorities.extensions.tags.behavior @@ -2544,6 +2565,9 @@ const registryConfig_pgResources_relational_checklists_relational_checklists = { schemaName: "polymorphic", name: "relational_checklists" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2571,6 +2595,9 @@ const registryConfig_pgResources_relational_item_relation_composite_pks_relation schemaName: "polymorphic", name: "relational_item_relation_composite_pks" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2598,6 +2625,9 @@ const registryConfig_pgResources_relational_topics_relational_topics = { schemaName: "polymorphic", name: "relational_topics" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2625,6 +2655,9 @@ const registryConfig_pgResources_single_table_item_relation_composite_pks_single schemaName: "polymorphic", name: "single_table_item_relation_composite_pks" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2652,6 +2685,9 @@ const registryConfig_pgResources_relational_checklist_items_relational_checklist schemaName: "polymorphic", name: "relational_checklist_items" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2679,6 +2715,9 @@ const registryConfig_pgResources_relational_dividers_relational_dividers = { schemaName: "polymorphic", name: "relational_dividers" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2713,6 +2752,9 @@ const registryConfig_pgResources_relational_item_relations_relational_item_relat schemaName: "polymorphic", name: "relational_item_relations" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2747,6 +2789,9 @@ const registryConfig_pgResources_single_table_item_relations_single_table_item_r schemaName: "polymorphic", name: "single_table_item_relations" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2774,6 +2819,9 @@ const registryConfig_pgResources_log_entries_log_entries = { schemaName: "polymorphic", name: "log_entries" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { ref: "author to:PersonOrOrganization singular", refVia: spec_logEntries.extensions.tags.refVia @@ -2804,6 +2852,9 @@ const registryConfig_pgResources_relational_posts_relational_posts = { schemaName: "polymorphic", name: "relational_posts" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2831,6 +2882,9 @@ const registryConfig_pgResources_first_party_vulnerabilities_first_party_vulnera schemaName: "polymorphic", name: "first_party_vulnerabilities" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { implements: "Vulnerability", ref: spec_firstPartyVulnerabilities.extensions.tags.ref, @@ -2862,6 +2916,9 @@ const registryConfig_pgResources_third_party_vulnerabilities_third_party_vulnera schemaName: "polymorphic", name: "third_party_vulnerabilities" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { implements: "Vulnerability", ref: spec_thirdPartyVulnerabilities.extensions.tags.ref, @@ -2893,6 +2950,9 @@ const registryConfig_pgResources_aws_applications_aws_applications = { schemaName: "polymorphic", name: "aws_applications" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { implements: "Application", ref: spec_awsApplications.extensions.tags.ref, @@ -2924,6 +2984,9 @@ const registryConfig_pgResources_gcp_applications_gcp_applications = { schemaName: "polymorphic", name: "gcp_applications" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { implements: "Application", ref: spec_gcpApplications.extensions.tags.ref, @@ -2956,6 +3019,9 @@ const registryConfig_pgResources_single_table_items_single_table_items = { schemaName: "polymorphic", name: "single_table_items" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { interface: "mode:single type:type", type: spec_singleTableItems.extensions.tags.type, @@ -2989,6 +3055,9 @@ const registryConfig_pgResources_relational_items_relational_items = { schemaName: "polymorphic", name: "relational_items" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { interface: "mode:relational", type: spec_relationalItems.extensions.tags.type @@ -3085,8 +3154,7 @@ const registryConfig = { name: "custom_delete_relational_item" }, tags: { - arg0variant: "nodeId", - behavior: ["-queryField mutationField -typeField", "-filter -order"] + arg0variant: "nodeId" } }, description: undefined @@ -3108,9 +3176,7 @@ const registryConfig = { schemaName: "polymorphic", name: "all_single_tables" }, - tags: { - behavior: ["queryField -mutationField -typeField", "-filter -order"] - } + tags: {} }, description: undefined }), @@ -3136,8 +3202,7 @@ const registryConfig = { name: "get_single_table_topic_by_id" }, tags: { - returnType: "SingleTableTopic", - behavior: ["queryField -mutationField -typeField", "-filter -order"] + returnType: "SingleTableTopic" } }, description: undefined 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 e20545e449..06545ac1b2 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 @@ -529,6 +529,9 @@ const registryConfig_pgResources_post_table_post_table = { schemaName: "smart_comment_relations", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "post_table", omit: true, @@ -560,6 +563,9 @@ const registryConfig_pgResources_posts_posts = { schemaName: "smart_comment_relations", name: "post_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "posts", primaryKey: "id" @@ -589,6 +595,9 @@ const registryConfig_pgResources_offer_table_offer_table = { schemaName: "smart_comment_relations", name: "offer" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "offer_table", omit: true, @@ -620,6 +629,9 @@ const registryConfig_pgResources_offers_offers = { schemaName: "smart_comment_relations", name: "offer_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "offers", primaryKey: "id", @@ -658,6 +670,9 @@ const registryConfig_pgResources_streets_streets = { schemaName: "smart_comment_relations", name: "streets" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { unique: "name" } @@ -687,6 +702,9 @@ const registryConfig_pgResources_properties_properties = { schemaName: "smart_comment_relations", name: "properties" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -714,6 +732,9 @@ const registryConfig_pgResources_street_property_street_property = { schemaName: "smart_comment_relations", name: "street_property" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -741,10 +762,12 @@ const registryConfig_pgResources_houses_houses = { schemaName: "smart_comment_relations", name: "houses" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { primaryKey: "street_id,property_id", - foreignKey: spec_houses.extensions.tags.foreignKey, - behavior: ["-insert", "-update", "-delete"] + foreignKey: spec_houses.extensions.tags.foreignKey } } }; @@ -772,6 +795,9 @@ const registryConfig_pgResources_buildings_buildings = { schemaName: "smart_comment_relations", name: "buildings" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { foreignKey: "(name) references streets (name)|@fieldName namedAfterStreet|@foreignFieldName buildingsNamedAfterStreet|@foreignSimpleFieldName buildingsNamedAfterStreetList" } 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 993ddb7fd2..db9a7f3830 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 @@ -529,6 +529,9 @@ const registryConfig_pgResources_post_table_post_table = { schemaName: "smart_comment_relations", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "post_table", omit: true, @@ -567,6 +570,9 @@ const registryConfig_pgResources_offer_table_offer_table = { schemaName: "smart_comment_relations", name: "offer" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "offer_table", omit: true, @@ -598,6 +604,9 @@ const registryConfig_pgResources_offers_offers = { schemaName: "smart_comment_relations", name: "offer_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "offers", primaryKey: "id", @@ -636,6 +645,9 @@ const registryConfig_pgResources_streets_streets = { schemaName: "smart_comment_relations", name: "streets" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { unique: "name" } @@ -665,6 +677,9 @@ const registryConfig_pgResources_properties_properties = { schemaName: "smart_comment_relations", name: "properties" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -692,6 +707,9 @@ const registryConfig_pgResources_street_property_street_property = { schemaName: "smart_comment_relations", name: "street_property" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -719,10 +737,12 @@ const registryConfig_pgResources_houses_houses = { schemaName: "smart_comment_relations", name: "houses" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { primaryKey: "street_id,property_id", - foreignKey: spec_houses.extensions.tags.foreignKey, - behavior: ["-insert", "-update", "-delete"] + foreignKey: spec_houses.extensions.tags.foreignKey } } }; @@ -750,6 +770,9 @@ const registryConfig_pgResources_buildings_buildings = { schemaName: "smart_comment_relations", name: "buildings" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { foreignKey: "(name) references streets (name)|@fieldName namedAfterStreet|@foreignFieldName buildingsNamedAfterStreet|@foreignSimpleFieldName buildingsNamedAfterStreetList" } @@ -793,6 +816,9 @@ const registry = makeRegistry({ schemaName: "smart_comment_relations", name: "post_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "posts", primaryKey: "id" 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 bb64c2c989..f596d51edc 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 @@ -529,6 +529,9 @@ const registryConfig_pgResources_post_table_post_table = { schemaName: "smart_comment_relations", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "post_table", omit: true, @@ -560,6 +563,9 @@ const registryConfig_pgResources_posts_posts = { schemaName: "smart_comment_relations", name: "post_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "posts", primaryKey: "id" @@ -589,6 +595,9 @@ const registryConfig_pgResources_offer_table_offer_table = { schemaName: "smart_comment_relations", name: "offer" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "offer_table", omit: true, @@ -620,6 +629,9 @@ const registryConfig_pgResources_offers_offers = { schemaName: "smart_comment_relations", name: "offer_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "offers", primaryKey: "id", @@ -658,6 +670,9 @@ const registryConfig_pgResources_streets_streets = { schemaName: "smart_comment_relations", name: "streets" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { unique: "name" } @@ -687,6 +702,9 @@ const registryConfig_pgResources_properties_properties = { schemaName: "smart_comment_relations", name: "properties" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -714,6 +732,9 @@ const registryConfig_pgResources_street_property_street_property = { schemaName: "smart_comment_relations", name: "street_property" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -741,10 +762,12 @@ const registryConfig_pgResources_houses_houses = { schemaName: "smart_comment_relations", name: "houses" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { primaryKey: "street_id,property_id", - foreignKey: spec_houses.extensions.tags.foreignKey, - behavior: ["-insert", "-update", "-delete"] + foreignKey: spec_houses.extensions.tags.foreignKey } } }; @@ -772,6 +795,9 @@ const registryConfig_pgResources_buildings_buildings = { schemaName: "smart_comment_relations", name: "buildings" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { foreignKey: "(name) references streets (name)|@fieldName namedAfterStreet|@foreignFieldName buildingsNamedAfterStreet|@foreignSimpleFieldName buildingsNamedAfterStreetList" } 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 6c976f015e..285f7ef225 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 @@ -530,6 +530,9 @@ const registryConfig_pgResources_post_table_post_table = { schemaName: "smart_comment_relations", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "post_table", omit: true, @@ -562,6 +565,9 @@ const registryConfig_pgResources_posts_posts = { schemaName: "smart_comment_relations", name: "post_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "posts", uniqueKey: "id", @@ -592,6 +598,9 @@ const registryConfig_pgResources_offer_table_offer_table = { schemaName: "smart_comment_relations", name: "offer" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "offer_table", omit: true, @@ -623,6 +632,9 @@ const registryConfig_pgResources_offers_offers = { schemaName: "smart_comment_relations", name: "offer_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "offers", primaryKey: "id", @@ -661,6 +673,9 @@ const registryConfig_pgResources_streets_streets = { schemaName: "smart_comment_relations", name: "streets" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { unique: "name" } @@ -690,6 +705,9 @@ const registryConfig_pgResources_properties_properties = { schemaName: "smart_comment_relations", name: "properties" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -717,6 +735,9 @@ const registryConfig_pgResources_street_property_street_property = { schemaName: "smart_comment_relations", name: "street_property" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -744,10 +765,12 @@ const registryConfig_pgResources_houses_houses = { schemaName: "smart_comment_relations", name: "houses" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { primaryKey: "street_id,property_id", - foreignKey: spec_houses.extensions.tags.foreignKey, - behavior: ["-insert", "-update", "-delete"] + foreignKey: spec_houses.extensions.tags.foreignKey } } }; @@ -775,6 +798,9 @@ const registryConfig_pgResources_buildings_buildings = { schemaName: "smart_comment_relations", name: "buildings" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { foreignKey: "(name) references streets (name)|@fieldName namedAfterStreet|@foreignFieldName buildingsNamedAfterStreet|@foreignSimpleFieldName buildingsNamedAfterStreetList" } 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 19f2cc3735..4b11739f9c 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 @@ -529,6 +529,9 @@ const registryConfig_pgResources_post_table_post_table = { schemaName: "smart_comment_relations", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "post_table", omit: true, @@ -559,6 +562,9 @@ const registryConfig_pgResources_posts_posts = { schemaName: "smart_comment_relations", name: "post_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "posts", unique: "id" @@ -588,6 +594,9 @@ const registryConfig_pgResources_offer_table_offer_table = { schemaName: "smart_comment_relations", name: "offer" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "offer_table", omit: true, @@ -619,6 +628,9 @@ const registryConfig_pgResources_offers_offers = { schemaName: "smart_comment_relations", name: "offer_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "offers", primaryKey: "id", @@ -657,6 +669,9 @@ const registryConfig_pgResources_streets_streets = { schemaName: "smart_comment_relations", name: "streets" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { unique: "name" } @@ -686,6 +701,9 @@ const registryConfig_pgResources_properties_properties = { schemaName: "smart_comment_relations", name: "properties" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -713,6 +731,9 @@ const registryConfig_pgResources_street_property_street_property = { schemaName: "smart_comment_relations", name: "street_property" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -740,10 +761,12 @@ const registryConfig_pgResources_houses_houses = { schemaName: "smart_comment_relations", name: "houses" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { primaryKey: "street_id,property_id", - foreignKey: spec_houses.extensions.tags.foreignKey, - behavior: ["-insert", "-update", "-delete"] + foreignKey: spec_houses.extensions.tags.foreignKey } } }; @@ -771,6 +794,9 @@ const registryConfig_pgResources_buildings_buildings = { schemaName: "smart_comment_relations", name: "buildings" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { foreignKey: "(name) references streets (name)|@fieldName namedAfterStreet|@foreignFieldName buildingsNamedAfterStreet|@foreignSimpleFieldName buildingsNamedAfterStreetList" } 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 020c86d5cc..c1b32160ad 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 @@ -530,6 +530,9 @@ const registryConfig_pgResources_post_table_post_table = { schemaName: "smart_comment_relations", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "post_table", omit: true, @@ -561,6 +564,9 @@ const registryConfig_pgResources_posts_posts = { schemaName: "smart_comment_relations", name: "post_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "posts", primaryKey: "id" @@ -590,6 +596,9 @@ const registryConfig_pgResources_offer_table_offer_table = { schemaName: "smart_comment_relations", name: "offer" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "offer_table", omit: true, @@ -621,6 +630,9 @@ const registryConfig_pgResources_offers_offers = { schemaName: "smart_comment_relations", name: "offer_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { name: "offers", primaryKey: "id", @@ -659,6 +671,9 @@ const registryConfig_pgResources_streets_streets = { schemaName: "smart_comment_relations", name: "streets" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { unique: "name" } @@ -688,6 +703,9 @@ const registryConfig_pgResources_properties_properties = { schemaName: "smart_comment_relations", name: "properties" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -715,6 +733,9 @@ const registryConfig_pgResources_street_property_street_property = { schemaName: "smart_comment_relations", name: "street_property" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -771,6 +792,9 @@ const registryConfig_pgResources_buildings_buildings = { schemaName: "smart_comment_relations", name: "buildings" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { foreignKey: "(name) references streets (name)|@fieldName namedAfterStreet|@foreignFieldName buildingsNamedAfterStreet|@foreignSimpleFieldName buildingsNamedAfterStreetList" } @@ -820,11 +844,13 @@ const registry = makeRegistry({ schemaName: "smart_comment_relations", name: "houses" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { name: "houses", primaryKey: "street_id,property_id", - unique: spec_houses.extensions.tags.unique, - behavior: ["-insert", "-update", "-delete"] + unique: spec_houses.extensions.tags.unique } } }, diff --git a/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.1.export.mjs index 03e79a98fd..d59fe35405 100644 --- a/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.1.export.mjs @@ -3105,6 +3105,9 @@ const registryConfig_pgResources_foreign_key_foreign_key = { schemaName: "a", name: "foreign_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3131,6 +3134,9 @@ const registryConfig_pgResources_unique_foreign_key_unique_foreign_key = { schemaName: "a", name: "unique_foreign_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "create,update,delete,all,order,filter" } @@ -3168,6 +3174,9 @@ const registryConfig_pgResources_c_person_secret_c_person_secret = { schemaName: "c", name: "person_secret" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { deprecated: "This is deprecated (comment on table c.person_secret)." } @@ -3205,6 +3214,9 @@ const registryConfig_pgResources_c_compound_key_c_compound_key = { schemaName: "c", name: "compound_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3266,6 +3278,9 @@ const registryConfig_pgResources_c_left_arm_c_left_arm = { schemaName: "c", name: "left_arm" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3286,9 +3301,10 @@ const resourceConfig_b_jwt_token = { schemaName: "b", name: "jwt_token" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const authenticateFunctionIdentifer = sql.identifier("b", "authenticate"); @@ -3316,6 +3332,9 @@ const registryConfig_pgResources_c_issue756_c_issue756 = { schemaName: "c", name: "issue756" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3362,6 +3381,9 @@ const registryConfig_pgResources_post_post = { schemaName: "a", name: "post" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3382,9 +3404,10 @@ const resourceConfig_c_compound_type = { schemaName: "c", name: "compound_type" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }; const compound_type_mutationFunctionIdentifer = sql.identifier("b", "compound_type_mutation"); @@ -3443,6 +3466,9 @@ const registryConfig_pgResources_c_person_c_person = { schemaName: "c", name: "person" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -3480,6 +3506,9 @@ const registryConfig_pgResources_b_types_b_types = { schemaName: "b", name: "types" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { foreignKey: spec_bTypes.extensions.tags.foreignKey } @@ -3833,9 +3862,7 @@ const registry = makeRegistry({ schemaName: "c", name: "current_user_id" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -3857,9 +3884,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out" }, - tags: { - behavior: ["-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3882,9 +3907,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_setof" }, - tags: { - behavior: ["-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3907,9 +3930,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -3931,9 +3952,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out" }, - tags: { - behavior: ["-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3956,9 +3975,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_setof" }, - tags: { - behavior: ["-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -3981,9 +3998,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -4005,9 +4020,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_mutation" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -4029,9 +4042,7 @@ const registry = makeRegistry({ schemaName: "c", name: "no_args_query" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -4053,9 +4064,7 @@ const registry = makeRegistry({ schemaName: "a", name: "return_void_mutation" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -4077,9 +4086,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_set" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -4101,9 +4108,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_set" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -4125,9 +4130,7 @@ const registry = makeRegistry({ schemaName: "a", name: "static_big_integer" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -4154,9 +4157,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_out" }, - tags: { - behavior: ["-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4184,9 +4185,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_one_col" }, - tags: { - behavior: ["-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -4214,9 +4213,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_out" }, - tags: { - behavior: ["-filter -order"] - }, + tags: {}, singleOutputParameterName: "o" }, description: undefined @@ -4244,9 +4241,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_one_col" }, - tags: { - behavior: ["-filter -order"] - }, + tags: {}, singleOutputParameterName: "col1" }, description: undefined @@ -4274,9 +4269,7 @@ const registry = makeRegistry({ schemaName: "a", name: "assert_something" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -4304,8 +4297,7 @@ const registry = makeRegistry({ name: "assert_something_nx" }, tags: { - omit: "execute", - behavior: ["-filter -order"] + omit: "execute" } }, description: undefined @@ -4333,9 +4325,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -4362,9 +4352,7 @@ const registry = makeRegistry({ schemaName: "c", name: "json_identity_mutation" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -4391,9 +4379,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -4420,9 +4406,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -4449,9 +4433,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -4478,9 +4460,7 @@ const registry = makeRegistry({ schemaName: "c", name: "jsonb_identity_mutation_plpgsql_with_default" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -4512,9 +4492,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_mutation" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: "lol, add some stuff 1 mutation" }, @@ -4546,9 +4524,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_1_query" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: "lol, add some stuff 1 query" }, @@ -4580,9 +4556,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_mutation" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: "lol, add some stuff 2 mutation" }, @@ -4614,9 +4588,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_2_query" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: "lol, add some stuff 2 query" }, @@ -4648,9 +4620,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_mutation" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: "lol, add some stuff 3 mutation" }, @@ -4682,9 +4652,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_3_query" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: "lol, add some stuff 3 query" }, @@ -4716,9 +4684,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: "lol, add some stuff 4 mutation" }, @@ -4750,9 +4716,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_mutation_error" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -4784,9 +4748,7 @@ const registry = makeRegistry({ schemaName: "a", name: "add_4_query" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: "lol, add some stuff 4 query" }, @@ -4818,9 +4780,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_1" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -4852,9 +4812,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_2" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -4886,9 +4844,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_3" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -4920,9 +4876,7 @@ const registry = makeRegistry({ schemaName: "b", name: "mult_4" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -4954,9 +4908,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_in_inout" }, - tags: { - behavior: ["-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -4979,9 +4931,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5003,9 +4953,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_setof" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5027,9 +4975,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_unnamed" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5061,9 +5007,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_in_inout" }, - tags: { - behavior: ["-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -5086,9 +5030,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5110,9 +5052,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_setof" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5134,9 +5074,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_unnamed" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5159,8 +5097,7 @@ const registry = makeRegistry({ name: "search_test_summaries" }, tags: { - simpleCollections: "only", - behavior: ["-filter -order"] + simpleCollections: "only" } }, description: undefined @@ -5198,9 +5135,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_1" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5237,9 +5172,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_2" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5276,9 +5209,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_3" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5315,9 +5246,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_4" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5354,9 +5283,7 @@ const registry = makeRegistry({ schemaName: "a", name: "optional_missing_middle_5" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5378,9 +5305,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5407,9 +5332,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_returns_table_multi_col" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5446,9 +5369,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_mutation" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5485,9 +5406,7 @@ const registry = makeRegistry({ schemaName: "c", name: "int_set_query" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5509,9 +5428,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_unnamed_out_out_unnamed" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5538,9 +5455,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_returns_table_multi_col" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5567,9 +5482,7 @@ const registry = makeRegistry({ schemaName: "b", name: "guid_fn" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5591,9 +5504,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_interval_array" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5615,9 +5526,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_interval_array" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5639,9 +5548,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_text_array" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5663,9 +5570,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_text_array" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -5685,9 +5590,10 @@ const registry = makeRegistry({ schemaName: "a", name: "non_updatable_view" }, - tags: { - behavior: ["-insert", "-update", "-delete"] - } + isInsertable: false, + isUpdatable: false, + isDeletable: false, + tags: {} } }, inputs: { @@ -5706,6 +5612,9 @@ const registry = makeRegistry({ schemaName: "a", name: "inputs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5725,6 +5634,9 @@ const registry = makeRegistry({ schemaName: "a", name: "patchs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5744,6 +5656,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5763,6 +5678,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reservedPatchs" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5782,6 +5700,9 @@ const registry = makeRegistry({ schemaName: "a", name: "reserved_input" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5801,6 +5722,9 @@ const registry = makeRegistry({ schemaName: "a", name: "default_value" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5828,6 +5752,9 @@ const registry = makeRegistry({ schemaName: "a", name: "no_primary_key" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5847,6 +5774,9 @@ const registry = makeRegistry({ schemaName: "a", name: "testview" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5867,6 +5797,9 @@ const registry = makeRegistry({ schemaName: "c", name: "my_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5895,6 +5828,9 @@ const registry = makeRegistry({ name: "unlogged", persistence: "u" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5914,6 +5850,9 @@ const registry = makeRegistry({ schemaName: "a", name: "view_table" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5933,6 +5872,9 @@ const registry = makeRegistry({ schemaName: "b", name: "updatable_view" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { uniqueKey: "x" } @@ -5955,6 +5897,9 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_1" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5974,6 +5919,9 @@ const registry = makeRegistry({ schemaName: "a", name: "similar_table_2" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -5993,6 +5941,9 @@ const registry = makeRegistry({ schemaName: "c", name: "null_test_record" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6019,9 +5970,7 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case_computed" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -6041,9 +5990,7 @@ const registry = makeRegistry({ schemaName: "c", name: "return_table_without_grants" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -6080,9 +6027,7 @@ const registry = makeRegistry({ schemaName: "b", name: "list_bde_mutation" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -6102,6 +6047,9 @@ const registry = makeRegistry({ schemaName: "c", name: "edge_case" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }, @@ -6122,9 +6070,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_fail" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -6159,9 +6105,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -6192,8 +6136,7 @@ const registry = makeRegistry({ }, tags: { arg0variant: "base", - resultFieldName: "leftArm", - behavior: ["-filter -order"] + resultFieldName: "leftArm" } }, description: undefined @@ -6214,9 +6157,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_mutation" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -6236,9 +6177,7 @@ const registry = makeRegistry({ schemaName: "c", name: "issue756_set_mutation" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -6273,9 +6212,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_many" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -6295,9 +6232,11 @@ const registry = makeRegistry({ schemaName: "b", name: "auth_payload" }, + isInsertable: false, + isUpdatable: false, + isDeletable: false, tags: { - foreignKey: "(id) references c.person", - behavior: ["-insert", "-update", "-delete"] + foreignKey: "(id) references c.person" } } }, { @@ -6331,9 +6270,7 @@ const registry = makeRegistry({ schemaName: "b", name: "authenticate_payload" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -6385,9 +6322,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_mutation" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -6439,9 +6374,7 @@ const registry = makeRegistry({ schemaName: "c", name: "types_query" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -6468,9 +6401,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_computed_field" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -6497,9 +6428,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_set" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -6526,9 +6455,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_interval_array" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -6555,9 +6482,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_text_array" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -6591,8 +6516,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - filterable: true, - behavior: ["-filter -order"] + filterable: true } }, description: undefined @@ -6627,8 +6551,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - filterable: true, - behavior: ["-filter -order"] + filterable: true } }, description: undefined @@ -6656,9 +6579,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_out_compound_type" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -6685,9 +6606,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_out_compound_type" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -6724,9 +6643,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -6763,9 +6680,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_no_defaults" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -6802,9 +6717,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_headline_trimmed_strict" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -6841,9 +6754,7 @@ const registry = makeRegistry({ schemaName: "c", name: "query_output_two_rows" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -6864,9 +6775,7 @@ const registry = makeRegistry({ schemaName: "c", name: "compound_type_set_query" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -6891,9 +6800,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_mutation" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -6918,9 +6825,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_query" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -6945,9 +6850,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_set_mutation" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -6972,9 +6875,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_mutation" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -6999,9 +6900,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_query" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -7032,8 +6931,7 @@ const registry = makeRegistry({ name: "post_with_suffix" }, tags: { - deprecated: "This is deprecated (comment on function a.post_with_suffix).", - behavior: ["-filter -order"] + deprecated: "This is deprecated (comment on function a.post_with_suffix)." } }, description: undefined @@ -7059,9 +6957,7 @@ const registry = makeRegistry({ schemaName: "a", name: "mutation_compound_type_array" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -7086,9 +6982,7 @@ const registry = makeRegistry({ schemaName: "a", name: "query_compound_type_array" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -7113,9 +7007,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_mutation" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -7140,9 +7032,7 @@ const registry = makeRegistry({ schemaName: "b", name: "compound_type_array_query" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -7172,9 +7062,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_computed_compound_type_array" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -7199,9 +7087,7 @@ const registry = makeRegistry({ schemaName: "a", name: "post_many" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -7231,8 +7117,7 @@ const registry = makeRegistry({ tags: { notNull: true, sortable: true, - filterable: true, - behavior: ["-filter -order"] + filterable: true }, singleOutputParameterName: "o1" }, @@ -7262,8 +7147,7 @@ const registry = makeRegistry({ name: "person_first_name" }, tags: { - sortable: true, - behavior: ["-filter -order"] + sortable: true } }, description: "The first name of the person." @@ -7291,9 +7175,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_out_out" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -7325,9 +7207,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout" }, - tags: { - behavior: ["-filter -order"] - }, + tags: {}, singleOutputParameterName: "ino" }, description: undefined @@ -7360,9 +7240,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_inout_out" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -7395,8 +7273,7 @@ const registry = makeRegistry({ name: "person_exists" }, tags: { - deprecated: "This is deprecated (comment on function c.person_exists).", - behavior: ["-filter -order"] + deprecated: "This is deprecated (comment on function c.person_exists)." } }, description: undefined @@ -7424,9 +7301,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout_out" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -7458,9 +7333,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -7492,9 +7365,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_complex_setof" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -7526,9 +7397,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -7560,9 +7429,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_complex_setof" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -7599,9 +7466,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_complex" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }, @@ -7626,9 +7491,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_first_post" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: "The first post by the person." }), @@ -7650,8 +7513,7 @@ const registry = makeRegistry({ name: "badly_behaved_function" }, tags: { - deprecated: "This is deprecated (comment on function c.badly_behaved_function).", - behavior: ["-filter -order"] + deprecated: "This is deprecated (comment on function c.badly_behaved_function)." } }, description: undefined @@ -7672,9 +7534,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -7694,9 +7554,7 @@ const registry = makeRegistry({ schemaName: "c", name: "func_out_table_setof" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -7716,9 +7574,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -7738,9 +7594,7 @@ const registry = makeRegistry({ schemaName: "c", name: "mutation_out_table_setof" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -7760,9 +7614,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_mutation" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -7784,8 +7636,7 @@ const registry = makeRegistry({ }, tags: { sortable: true, - filterable: true, - behavior: ["-filter -order"] + filterable: true } }, description: undefined @@ -7806,9 +7657,7 @@ const registry = makeRegistry({ schemaName: "c", name: "table_set_query_plpgsql" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -7833,9 +7682,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_computed_first_arg_inout" }, - tags: { - behavior: ["-filter -order"] - }, + tags: {}, singleOutputParameterName: "person" }, description: undefined @@ -7862,8 +7709,7 @@ const registry = makeRegistry({ name: "person_friends" }, tags: { - sortable: true, - behavior: ["-filter -order"] + sortable: true } }, description: undefined @@ -7885,9 +7731,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -7907,9 +7751,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_connection_mutation" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -7934,9 +7776,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -7961,9 +7801,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_mutation" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -7988,9 +7826,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_connection" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -8020,9 +7856,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -8042,9 +7876,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -8064,9 +7896,7 @@ const registry = makeRegistry({ schemaName: "b", name: "type_function_list_mutation" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -8091,9 +7921,7 @@ const registry = makeRegistry({ schemaName: "c", name: "person_type_function_list" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }) diff --git a/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.polymorphic.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.polymorphic.1.export.mjs index 439debb06b..c579bfce8d 100644 --- a/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.polymorphic.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.polymorphic.1.export.mjs @@ -2320,6 +2320,9 @@ const registryConfig_pgResources_aws_application_first_party_vulnerabilities_aws schemaName: "polymorphic", name: "aws_application_first_party_vulnerabilities" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: true } @@ -2349,6 +2352,9 @@ const registryConfig_pgResources_aws_application_third_party_vulnerabilities_aws schemaName: "polymorphic", name: "aws_application_third_party_vulnerabilities" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: true } @@ -2378,6 +2384,9 @@ const registryConfig_pgResources_gcp_application_first_party_vulnerabilities_gcp schemaName: "polymorphic", name: "gcp_application_first_party_vulnerabilities" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: true } @@ -2407,6 +2416,9 @@ const registryConfig_pgResources_gcp_application_third_party_vulnerabilities_gcp schemaName: "polymorphic", name: "gcp_application_third_party_vulnerabilities" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: true } @@ -2443,6 +2455,9 @@ const registryConfig_pgResources_organizations_organizations = { schemaName: "polymorphic", name: "organizations" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { unionMember: "PersonOrOrganization" } @@ -2479,6 +2494,9 @@ const registryConfig_pgResources_people_people = { schemaName: "polymorphic", name: "people" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { unionMember: "PersonOrOrganization", ref: "applications to:Application", @@ -2510,6 +2528,9 @@ const registryConfig_pgResources_priorities_priorities = { schemaName: "polymorphic", name: "priorities" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { omit: "create,update,delete,filter,order" } @@ -2539,6 +2560,9 @@ const registryConfig_pgResources_relational_checklists_relational_checklists = { schemaName: "polymorphic", name: "relational_checklists" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2566,6 +2590,9 @@ const registryConfig_pgResources_relational_item_relation_composite_pks_relation schemaName: "polymorphic", name: "relational_item_relation_composite_pks" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2593,6 +2620,9 @@ const registryConfig_pgResources_relational_topics_relational_topics = { schemaName: "polymorphic", name: "relational_topics" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2620,6 +2650,9 @@ const registryConfig_pgResources_single_table_item_relation_composite_pks_single schemaName: "polymorphic", name: "single_table_item_relation_composite_pks" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2647,6 +2680,9 @@ const registryConfig_pgResources_relational_checklist_items_relational_checklist schemaName: "polymorphic", name: "relational_checklist_items" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2674,6 +2710,9 @@ const registryConfig_pgResources_relational_dividers_relational_dividers = { schemaName: "polymorphic", name: "relational_dividers" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2708,6 +2747,9 @@ const registryConfig_pgResources_relational_item_relations_relational_item_relat schemaName: "polymorphic", name: "relational_item_relations" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2742,6 +2784,9 @@ const registryConfig_pgResources_single_table_item_relations_single_table_item_r schemaName: "polymorphic", name: "single_table_item_relations" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2769,6 +2814,9 @@ const registryConfig_pgResources_log_entries_log_entries = { schemaName: "polymorphic", name: "log_entries" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { ref: "author to:PersonOrOrganization singular", refVia: spec_logEntries.extensions.tags.refVia @@ -2799,6 +2847,9 @@ const registryConfig_pgResources_relational_posts_relational_posts = { schemaName: "polymorphic", name: "relational_posts" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: {} } }; @@ -2826,6 +2877,9 @@ const registryConfig_pgResources_first_party_vulnerabilities_first_party_vulnera schemaName: "polymorphic", name: "first_party_vulnerabilities" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { implements: "Vulnerability", ref: spec_firstPartyVulnerabilities.extensions.tags.ref, @@ -2857,6 +2911,9 @@ const registryConfig_pgResources_third_party_vulnerabilities_third_party_vulnera schemaName: "polymorphic", name: "third_party_vulnerabilities" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { implements: "Vulnerability", ref: spec_thirdPartyVulnerabilities.extensions.tags.ref, @@ -2888,6 +2945,9 @@ const registryConfig_pgResources_aws_applications_aws_applications = { schemaName: "polymorphic", name: "aws_applications" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { implements: "Application", ref: spec_awsApplications.extensions.tags.ref, @@ -2919,6 +2979,9 @@ const registryConfig_pgResources_gcp_applications_gcp_applications = { schemaName: "polymorphic", name: "gcp_applications" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { implements: "Application", ref: spec_gcpApplications.extensions.tags.ref, @@ -2951,6 +3014,9 @@ const registryConfig_pgResources_single_table_items_single_table_items = { schemaName: "polymorphic", name: "single_table_items" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { interface: "mode:single type:type", type: spec_singleTableItems.extensions.tags.type, @@ -2984,6 +3050,9 @@ const registryConfig_pgResources_relational_items_relational_items = { schemaName: "polymorphic", name: "relational_items" }, + isInsertable: true, + isUpdatable: true, + isDeletable: true, tags: { interface: "mode:relational", type: spec_relationalItems.extensions.tags.type @@ -3080,8 +3149,7 @@ const registryConfig = { name: "custom_delete_relational_item" }, tags: { - arg0variant: "nodeId", - behavior: ["-filter -order"] + arg0variant: "nodeId" } }, description: undefined @@ -3103,9 +3171,7 @@ const registryConfig = { schemaName: "polymorphic", name: "all_single_tables" }, - tags: { - behavior: ["-filter -order"] - } + tags: {} }, description: undefined }), @@ -3131,8 +3197,7 @@ const registryConfig = { name: "get_single_table_topic_by_id" }, tags: { - returnType: "SingleTableTopic", - behavior: ["-filter -order"] + returnType: "SingleTableTopic" } }, description: undefined From 4b3dd3f4463baa402e119057efe08724b45016b5 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Thu, 26 Sep 2024 16:41:49 +0100 Subject: [PATCH 35/50] User has explicitly marked these non-executable fields as filterable/sortable, so we should honour them. --- .../postgraphile/__tests__/schema/v4/rbac.1.graphql | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/postgraphile/postgraphile/__tests__/schema/v4/rbac.1.graphql b/postgraphile/postgraphile/__tests__/schema/v4/rbac.1.graphql index 96684afff9..b9f2459362 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/rbac.1.graphql +++ b/postgraphile/postgraphile/__tests__/schema/v4/rbac.1.graphql @@ -645,12 +645,16 @@ type PeopleEdge { enum PeopleOrderBy { ABOUT_ASC ABOUT_DESC + COMPUTED_OUT_ASC + COMPUTED_OUT_DESC CONFIG_ASC CONFIG_DESC CREATED_AT_ASC CREATED_AT_DESC EMAIL_ASC EMAIL_DESC + FIRST_NAME_ASC + FIRST_NAME_DESC ID_ASC ID_DESC LAST_LOGIN_FROM_IP_ASC @@ -737,6 +741,9 @@ input PersonCondition { """Checks for equality with the object’s `aliases` field.""" aliases: [String] + """Checks for equality with the object’s `computedOut` field.""" + computedOut: String + """Checks for equality with the object’s `config` field.""" config: KeyValueHash @@ -884,6 +891,9 @@ input PostCondition { """Checks for equality with the object’s `body` field.""" body: String + """Checks for equality with the object’s `computedWithOptionalArg` field.""" + computedWithOptionalArg: Int + """Checks for equality with the object’s `headline` field.""" headline: String @@ -923,6 +933,8 @@ enum PostsOrderBy { AUTHOR_ID_DESC BODY_ASC BODY_DESC + COMPUTED_WITH_OPTIONAL_ARG_ASC + COMPUTED_WITH_OPTIONAL_ARG_DESC HEADLINE_ASC HEADLINE_DESC ID_ASC From 7f7c267635abb8c6b1ed2c05c96111e288fdbd04 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Thu, 26 Sep 2024 16:44:38 +0100 Subject: [PATCH 36/50] Lint --- .../src/plugins/PgV4BehaviorPlugin.ts | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/postgraphile/postgraphile/src/plugins/PgV4BehaviorPlugin.ts b/postgraphile/postgraphile/src/plugins/PgV4BehaviorPlugin.ts index 4555b58313..0c059db28f 100644 --- a/postgraphile/postgraphile/src/plugins/PgV4BehaviorPlugin.ts +++ b/postgraphile/postgraphile/src/plugins/PgV4BehaviorPlugin.ts @@ -3,7 +3,6 @@ import "graphile-build-pg"; import type { PgResource, PgResourceOptions } from "@dataplan/pg"; import type { PgProc } from "graphile-build-pg/pg-introspection"; -import { inspect } from "util"; declare global { namespace GraphileConfig { @@ -39,26 +38,6 @@ const v4ComputedAttributeChecks = (s: PgResource): boolean => { return true; }; -const v4ComputedAttributeChecks_ = ( - _s: PgResourceOptions, - pgProc: PgProc, -): boolean => { - const args = pgProc.getArguments(); - const firstArg = args[0]; - - // Has to be in same schema - if (firstArg.type.typnamespace !== pgProc.pronamespace) { - return false; - } - - // Has to start with the name prefix - if (!pgProc.proname.startsWith(firstArg.type.typname + "_")) { - return false; - } - - return true; -}; - export const PgV4BehaviorPlugin: GraphileConfig.Plugin = { name: "PgV4BehaviorPlugin", description: From 426e9320e76ef95927eebb6fe4072050b6208771 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Thu, 26 Sep 2024 16:54:09 +0100 Subject: [PATCH 37/50] docs(changeset): Massive overhaul of the behavior system which now has a centralized registry of known behaviors and applies behaviors in a more careful and nuanced way, removing many hacks and workarounds, and ultimately meaning that `defaultBehavior: "-*"` should now operate correctly. Technically this is a breaking change because the order in which behaviors are applied has changed, and so a different behavior might ultimately "win". This shows up in places where there is ambiguity, for example if you add `@filterable` to a function that you don't have execute permissions on, that function will now show up in the schema since user overrides (smart tags) "win" versus inferred behaviors such as introspected permissions; this wasn't the case before. Hopefully most users will not notice any difference, and for those who do, the `graphile behavior debug` CLI may be able to help you figure out what's going on. Be sure to print your schema before and after this update and look for changes; if there are changes then you likely need to fix the relevant behaviors/smart tags. (Hopefully there's no changes for you!) --- .changeset/modern-bananas-drop.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .changeset/modern-bananas-drop.md diff --git a/.changeset/modern-bananas-drop.md b/.changeset/modern-bananas-drop.md new file mode 100644 index 0000000000..6e43887eef --- /dev/null +++ b/.changeset/modern-bananas-drop.md @@ -0,0 +1,24 @@ +--- +"graphile-build-pg": patch +"graphile-build": patch +"postgraphile": patch +--- + +Massive overhaul of the behavior system which now has a centralized registry of +known behaviors and applies behaviors in a more careful and nuanced way, +removing many hacks and workarounds, and ultimately meaning that +`defaultBehavior: "-*"` should now operate correctly. + +Technically this is a breaking change because the order in which behaviors are +applied has changed, and so a different behavior might ultimately "win". This +shows up in places where there is ambiguity, for example if you add +`@filterable` to a function that you don't have execute permissions on, that +function will now show up in the schema since user overrides (smart tags) "win" +versus inferred behaviors such as introspected permissions; this wasn't the case +before. Hopefully most users will not notice any difference, and for those who +do, the `graphile behavior debug` CLI may be able to help you figure out what's +going on. + +Be sure to print your schema before and after this update and look for changes; +if there are changes then you likely need to fix the relevant behaviors/smart +tags. (Hopefully there's no changes for you!) From e72070229439ca0acc988fa48b969cf78296ad58 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Thu, 26 Sep 2024 17:09:56 +0100 Subject: [PATCH 38/50] Fix preset default behavior - it should override plugins --- graphile-build/graphile-build/src/behavior.ts | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index f3ee8aaed1..95e88ab506 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -194,27 +194,29 @@ export class Behavior { } } + const pluginDefaultBehavior = this.resolveBehavior( + null, + NULL_BEHAVIOR, + plugins.map((p) => [ + `${p.name}.schema.globalBehavior`, + p.schema?.globalBehavior, + ]), + build, + ); const defaultBehaviorFromPreset = this.resolvedPreset.schema?.defaultBehavior ?? ""; - const resolvedDefaultBehavior: ResolvedBehavior = { - behaviorString: defaultBehaviorFromPreset as GraphileBuild.BehaviorString, + this.globalDefaultBehavior = { + behaviorString: + `${pluginDefaultBehavior.behaviorString} ${defaultBehaviorFromPreset}` as GraphileBuild.BehaviorString, stack: [ + ...pluginDefaultBehavior.stack, { source: "preset.schema.defaultBehavior", - prefix: defaultBehaviorFromPreset, - suffix: "", + prefix: "", + suffix: defaultBehaviorFromPreset, }, ], }; - this.globalDefaultBehavior = this.resolveBehavior( - null, - resolvedDefaultBehavior, - plugins.map((p) => [ - `${p.name}.schema.globalBehavior`, - p.schema?.globalBehavior, - ]), - build, - ); orderedApply( plugins, From 421578692fc080d8b1dc296ff9a4badb05200ca0 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Thu, 26 Sep 2024 17:10:13 +0100 Subject: [PATCH 39/50] Fix behavior string validation, it should allow whitespace padding --- graphile-build/graphile-build/src/behavior.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index 95e88ab506..9c4fbcb553 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -861,7 +861,7 @@ export function isValidBehaviorString( ): behavior is GraphileBuild.BehaviorString { return ( typeof behavior === "string" && - /^[+-]?([a-zA-Z](?:[_:]?[a-zA-Z0-9])+|\*)(?:\s+[+-]?(?:[a-zA-Z]([_:]?[a-zA-Z0-9])+|\*))*$/.test( + /^\s*[+-]?([a-zA-Z](?:[_:]?[a-zA-Z0-9])+|\*)(?:\s+[+-]?(?:[a-zA-Z]([_:]?[a-zA-Z0-9])+|\*))*\s*$/.test( behavior, ) ); From 12aa3e096b415f0863d55a1d7340dc6341cf5c14 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Thu, 26 Sep 2024 17:20:10 +0100 Subject: [PATCH 40/50] Fix lint --- postgraphile/postgraphile/src/plugins/PgV4BehaviorPlugin.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/postgraphile/postgraphile/src/plugins/PgV4BehaviorPlugin.ts b/postgraphile/postgraphile/src/plugins/PgV4BehaviorPlugin.ts index 0c059db28f..0c45590ff2 100644 --- a/postgraphile/postgraphile/src/plugins/PgV4BehaviorPlugin.ts +++ b/postgraphile/postgraphile/src/plugins/PgV4BehaviorPlugin.ts @@ -1,8 +1,7 @@ import "graphile-config"; import "graphile-build-pg"; -import type { PgResource, PgResourceOptions } from "@dataplan/pg"; -import type { PgProc } from "graphile-build-pg/pg-introspection"; +import type { PgResource } from "@dataplan/pg"; declare global { namespace GraphileConfig { From 822085bda1218fae7dda3724e8dd2dd50f77d151 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Thu, 26 Sep 2024 18:18:41 +0100 Subject: [PATCH 41/50] Don't duplicate definition --- graphile-build/graphile-build-pg/src/index.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/graphile-build/graphile-build-pg/src/index.ts b/graphile-build/graphile-build-pg/src/index.ts index 3de75aa090..54d7d68a60 100644 --- a/graphile-build/graphile-build-pg/src/index.ts +++ b/graphile-build/graphile-build-pg/src/index.ts @@ -108,9 +108,6 @@ declare global { interface PgResourceExtensions { description?: string; tags: Partial; - isInsertable?: boolean; - isUpdatable?: boolean; - isDeletable?: boolean; singleOutputParameterName?: string; /** For v4 compatibility, what's the name of the actual table. */ pg?: { From cde36fdc64fc9ffe11a336e1dc41f7c915cea63e Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Fri, 27 Sep 2024 09:46:01 +0100 Subject: [PATCH 42/50] Update release notes --- .changeset/modern-bananas-drop.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.changeset/modern-bananas-drop.md b/.changeset/modern-bananas-drop.md index 6e43887eef..64f75a6aea 100644 --- a/.changeset/modern-bananas-drop.md +++ b/.changeset/modern-bananas-drop.md @@ -7,17 +7,21 @@ Massive overhaul of the behavior system which now has a centralized registry of known behaviors and applies behaviors in a more careful and nuanced way, removing many hacks and workarounds, and ultimately meaning that -`defaultBehavior: "-*"` should now operate correctly. +`defaultBehavior: "-*"` should now operate correctly. Importantly, +`addBehaviorToTags()` has been removed - you should use +`plugin.schema.entityBehaviors` to indicate behaviors as shown in this PR - do +not mod the tags directly unless they're explicitly meant to be overrides. -Technically this is a breaking change because the order in which behaviors are -applied has changed, and so a different behavior might ultimately "win". This -shows up in places where there is ambiguity, for example if you add -`@filterable` to a function that you don't have execute permissions on, that -function will now show up in the schema since user overrides (smart tags) "win" -versus inferred behaviors such as introspected permissions; this wasn't the case -before. Hopefully most users will not notice any difference, and for those who -do, the `graphile behavior debug` CLI may be able to help you figure out what's -going on. +Technically this is a breaking change (besides the removal of the +`addBehaviorToTags()` helper) because the order in which behaviors are applied +has changed, and so a different behavior might ultimately "win". This shows up +in places where there is ambiguity, for example if you add `@filterable` to a +function that you don't have execute permissions on, that function will now show +up in the schema since user overrides (smart tags) "win" versus inferred +behaviors such as introspected permissions; this wasn't the case before. +Hopefully most users will not notice any difference, and for those who do, the +`graphile behavior debug` CLI may be able to help you figure out what's going +on. Be sure to print your schema before and after this update and look for changes; if there are changes then you likely need to fix the relevant behaviors/smart From 54054b8733236ba7b2f2fa47d84e085f7196e3f9 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Fri, 27 Sep 2024 10:02:47 +0100 Subject: [PATCH 43/50] docs(changeset): Fix bug where creating the build object also initialized it; this is incorrect since if you just want the build object you don't necessarily want to register all of the GraphQL types (and potentially discover naming conflicts) at that moment. Introduced new `schemaBuilder.initBuild(schemaBuilder.createBuild(input))` API to explicitly handle initing if you need an initialized build object. --- .changeset/good-rocks-deny.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .changeset/good-rocks-deny.md diff --git a/.changeset/good-rocks-deny.md b/.changeset/good-rocks-deny.md new file mode 100644 index 0000000000..e5998ae28d --- /dev/null +++ b/.changeset/good-rocks-deny.md @@ -0,0 +1,10 @@ +--- +"graphile-build": patch +--- + +Fix bug where creating the build object also initialized it; this is incorrect +since if you just want the build object you don't necessarily want to register +all of the GraphQL types (and potentially discover naming conflicts) at that +moment. Introduced new +`schemaBuilder.initBuild(schemaBuilder.createBuild(input))` API to explicitly +handle initing if you need an initialized build object. From 205cfe3843e0acb6fb665518c1a37b99f1c7f2bf Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Fri, 27 Sep 2024 10:50:50 +0100 Subject: [PATCH 44/50] Stricter behaviors in more places --- .../src/plugins/PgBasicsPlugin.ts | 13 +- .../src/plugins/PgConditionArgumentPlugin.ts | 2 +- .../src/plugins/PgCustomTypeFieldPlugin.ts | 7 +- .../PgInterfaceModeUnionAllRowsPlugin.ts | 19 +++ .../src/plugins/PgJWTPlugin.ts | 16 ++- .../plugins/PgMutationUpdateDeletePlugin.ts | 15 +- .../src/plugins/PgNodeIdAttributesPlugin.ts | 2 +- .../src/plugins/PgRelationsPlugin.ts | 4 +- graphile-build/graphile-build/src/behavior.ts | 133 +++++++++++------- graphile-build/graphile-build/src/index.ts | 7 +- .../postgraphile/src/presets/relay.ts | 25 ++-- postgraphile/postgraphile/src/presets/v4.ts | 20 ++- 12 files changed, 180 insertions(+), 83 deletions(-) diff --git a/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts index 460c49c828..96b0d0095e 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts @@ -42,6 +42,8 @@ declare global { filterBy: true; order: true; orderBy: true; + "resource:connection": true; + "resource:list": true; } type HasGraphQLTypeForPgCodec = ( codec: PgCodec, @@ -187,7 +189,7 @@ export const PgBasicsPlugin: GraphileConfig.Plugin = { }), schema: { - globalBehavior: "connection -list", + globalBehavior: ["connection", "-list"], behaviorRegistry: { add: { select: { @@ -215,6 +217,15 @@ export const PgBasicsPlugin: GraphileConfig.Plugin = { filterBy: { description: "can we filter by this thing?", entities: [] }, order: { description: "can we order these results?", entities: [] }, orderBy: { description: "can we order by this thing?", entities: [] }, + + "resource:connection": { + description: "should we use a connection field for this?", + entities: ["pgCodec", "pgResource", "pgResourceUnique"], + }, + "resource:list": { + description: "should we use a list field for this?", + entities: ["pgCodec", "pgResource", "pgResourceUnique"], + }, }, }, entityBehavior: { diff --git a/graphile-build/graphile-build-pg/src/plugins/PgConditionArgumentPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgConditionArgumentPlugin.ts index e22e8723de..4572163d7c 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgConditionArgumentPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgConditionArgumentPlugin.ts @@ -140,7 +140,7 @@ export const PgConditionArgumentPlugin: GraphileConfig.Plugin = { } const desiredBehavior = fieldBehaviorScope - ? `${fieldBehaviorScope}:filter` + ? (`${fieldBehaviorScope}:filter` as keyof GraphileBuild.BehaviorStrings) : `filter`; if ( pgResource diff --git a/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts index a0ace4d79e..7343504ce6 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts @@ -1182,10 +1182,11 @@ export const PgCustomTypeFieldPlugin: GraphileConfig.Plugin = { !resource.sqlPartitionByIndex && !resource.isList; const baseScope = isRootQuery ? `queryField` : `typeField`; - const connectionFieldBehaviorScope = `${baseScope}:resource:connection`; + const connectionFieldBehaviorScope = + `${baseScope}:resource:connection` as const; const listFieldBehaviorScope = canUseConnection - ? `${baseScope}:resource:list` - : `${baseScope}:resource:array`; + ? (`${baseScope}:resource:list` as const) + : (`${baseScope}:resource:array` as const); if ( canUseConnection && build.behavior.pgResourceMatches( diff --git a/graphile-build/graphile-build-pg/src/plugins/PgInterfaceModeUnionAllRowsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgInterfaceModeUnionAllRowsPlugin.ts index 95f23a10ca..c490a46977 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgInterfaceModeUnionAllRowsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgInterfaceModeUnionAllRowsPlugin.ts @@ -21,6 +21,11 @@ declare global { } namespace GraphileBuild { + interface BehaviorStrings { + "query:interface:connection": true; + "query:interface:list": true; + } + interface Inflection { /** * The base inflector used by allInterfaceModeUnionRowsConnection and @@ -67,6 +72,20 @@ export const PgInterfaceModeUnionAllRowsPlugin: GraphileConfig.Plugin = { }, schema: { + behaviorRegistry: { + add: { + "query:interface:connection": { + description: + "Should we add a root-level query field to fetch a connection over all rows matching this codec interface?", + entities: ["pgCodec"], + }, + "query:interface:list": { + description: + "Should we add a root-level query field to fetch all rows matching this codec interface?", + entities: ["pgCodec"], + }, + }, + }, entityBehavior: { pgCodec: { inferred: { diff --git a/graphile-build/graphile-build-pg/src/plugins/PgJWTPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgJWTPlugin.ts index 8c287f854b..9009058bb1 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgJWTPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgJWTPlugin.ts @@ -10,6 +10,10 @@ import { version } from "../version.js"; declare global { namespace GraphileBuild { + interface BehaviorStrings { + jwt: true; + } + interface SchemaOptions { pgJwtSecret?: Secret; pgJwtSignOptions?: SignOptions; @@ -38,9 +42,7 @@ declare global { pgCodec?: PgCodec; } } -} -declare global { namespace GraphileConfig { interface Plugins { PgJWTPlugin: true; @@ -108,6 +110,8 @@ export const PgJWTPlugin: GraphileConfig.Plugin = { // It's a JWT type! pgCodec.extensions ||= Object.create(null); pgCodec.extensions!.tags ||= Object.create(null); + // TODO: the -table should be achieved via behavior dependencies + // (i.e. `jwt` automatically disables `table`) pgCodec.extensions!.tags!.behavior = ["-table", "jwt"]; } }, @@ -115,6 +119,14 @@ export const PgJWTPlugin: GraphileConfig.Plugin = { }), schema: { + behaviorRegistry: { + add: { + jwt: { + description: "Does this codec represent a JWT?", + entities: ["pgCodec"], + }, + }, + }, hooks: { init(_, build) { const { diff --git a/graphile-build/graphile-build-pg/src/plugins/PgMutationUpdateDeletePlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgMutationUpdateDeletePlugin.ts index be8281e853..4ebf6d8eb0 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgMutationUpdateDeletePlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgMutationUpdateDeletePlugin.ts @@ -37,6 +37,8 @@ declare global { interface BehaviorStrings { "constraint:resource:update": true; "constraint:resource:delete": true; + "nodeId:resource:update": true; + "nodeId:resource:delete": true; "update:resource:select": true; "delete:resource:nodeId": true; "delete:resource:select": true; @@ -256,6 +258,15 @@ export const PgMutationUpdateDeletePlugin: GraphileConfig.Plugin = { description: "can delete a record by this constraint", entities: ["pgResourceUnique"], }, + "nodeId:resource:update": { + description: "can update a record by this nodeId", + entities: ["pgResourceUnique"], + }, + "nodeId:resource:delete": { + description: "can delete a record by this nodeId", + entities: ["pgResourceUnique"], + }, + // TODO: should this exist?! Perhaps the `-nodeId` behavior should imply `-nodeId:*:*` in the behavior registry? "delete:resource:nodeId": { description: "can delete a record by its Node ID", entities: ["pgResource"], @@ -942,11 +953,11 @@ function getSpecs( const primaryUnique = resource.uniques.find( (u: PgResourceUnique) => u.isPrimary, ); - const constraintMode = `constraint:${mode}`; + const constraintMode = `constraint:${mode}` as const; const specs = [ ...(primaryUnique && build.getNodeIdCodec !== undefined && - build.behavior.pgCodecMatches(resource.codec, `nodeId:${mode}`) + build.behavior.pgCodecMatches(resource.codec, `nodeId:${mode}` as const) ? [{ unique: primaryUnique, uniqueMode: "node" }] : []), ...resource.uniques diff --git a/graphile-build/graphile-build-pg/src/plugins/PgNodeIdAttributesPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgNodeIdAttributesPlugin.ts index e1b3661b20..1d4c7af83c 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgNodeIdAttributesPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgNodeIdAttributesPlugin.ts @@ -159,7 +159,7 @@ export const PgNodeIdAttributesPlugin: GraphileConfig.Plugin = { ? "filterBy" : "insert"; - const fieldBehaviorScope = `nodeId:${action}`; + const fieldBehaviorScope = `nodeId:${action}` as const; if ( !build.behavior.pgCodecRelationMatches( relation, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts index 529f8cc9c4..c143d33df9 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgRelationsPlugin.ts @@ -926,7 +926,7 @@ function addRelations( isUnique && build.behavior.pgCodecRelationMatches( relation, - `${relationTypeScope}:resource:single`, + `${relationTypeScope as "singularRelation"}:resource:single` as const, ); const shouldAddConnectionField = build.behavior.pgCodecRelationMatches( relation, @@ -1353,7 +1353,7 @@ function addRelations( isUnique && build.behavior.stringMatches( behavior, - `${relationTypeScope}:resource:single`, + `${relationTypeScope as "singularRelation"}:resource:single`, ); const shouldAddConnectionField = build.behavior.stringMatches( behavior, diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index 9c4fbcb553..556e29286e 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -80,7 +80,7 @@ const getEntityBehaviorOverrideHooks = (plugin: GraphileConfig.Plugin) => { export type BehaviorDynamicMethods = { [entityType in keyof GraphileBuild.BehaviorEntities as `${entityType}Matches`]: ( entity: GraphileBuild.BehaviorEntities[entityType], - filter: string, + filter: keyof GraphileBuild.BehaviorStrings, ) => boolean | undefined; } & { [entityType in keyof GraphileBuild.BehaviorEntities as `${entityType}Behavior`]: ( @@ -96,20 +96,20 @@ export class Behavior { [ source: string, callback: ( - behavior: string, + behavior: GraphileBuild.BehaviorString, entity: GraphileBuild.BehaviorEntities[entityType], build: GraphileBuild.Build, - ) => string | string[], + ) => GraphileBuild.BehaviorString | GraphileBuild.BehaviorString[], ] >; overrideBehaviorCallbacks: Array< [ source: string, callback: ( - behavior: string, + behavior: GraphileBuild.BehaviorString, entity: GraphileBuild.BehaviorEntities[entityType], build: GraphileBuild.Build, - ) => string | string[], + ) => GraphileBuild.BehaviorString | GraphileBuild.BehaviorString[], ] >; listCache: Map; @@ -133,7 +133,7 @@ export class Behavior { entities: { [entity in keyof GraphileBuild.BehaviorEntities]?: { description: string; - pluginName: string; + pluginName: string | null; }; }; }; @@ -280,8 +280,8 @@ export class Behavior { }; (this as this & BehaviorDynamicMethods)[`${entityType}Matches`] = ( entity: GraphileBuild.BehaviorEntities[TEntityType], - behavior: string, - ): boolean | undefined => this.entityMatches(entityType, entity, behavior); + filter: keyof GraphileBuild.BehaviorStrings, + ): boolean | undefined => this.entityMatches(entityType, entity, filter); (this as this & BehaviorDynamicMethods)[`${entityType}Behavior`] = ( entity: GraphileBuild.BehaviorEntities[TEntityType], ): string => this.getBehaviorForEntity(entityType, entity).behaviorString; @@ -311,11 +311,52 @@ export class Behavior { */ public entityMatches< TEntityType extends keyof GraphileBuild.BehaviorEntities, + TFilter extends keyof GraphileBuild.BehaviorStrings, >( entityType: TEntityType, entity: GraphileBuild.BehaviorEntities[TEntityType], - filter: string, + filter: TFilter, ): boolean | undefined { + if (!this.behaviorRegistry[filter]) { + console.trace( + `Behavior '${filter}' is not registered; please be sure to register it within a plugin via \`plugin.schema.behaviorRegistry.add[${JSON.stringify( + filter, + )}] = { description: "...", entities: [${JSON.stringify( + entityType, + )}] }\`.`, + ); + // Register it so we don't see this warning again + this.behaviorRegistry[filter] = { + entities: { + [entityType]: { + description: "Unregistered.", + pluginName: null, + }, + }, + }; + } else if ( + !Object.entries(this.behaviorRegistry).some( + ([bhv, { entities }]) => + entities[entityType] && stringMatches(bhv, filter), + ) + ) { + console.trace( + `Behavior '${filter}' is not registered for entity type '${entityType}'; it's only expected to be used with '${Object.keys( + this.behaviorRegistry[filter].entities, + ).join( + "', '", + )}'; if this usage is valid, register it within a plugin with \`plugin.schema.behaviorRegistry.add[${JSON.stringify( + filter, + )}] = { description: "...", entities: [${JSON.stringify( + entityType, + )}] }\`.`, + ); + // Register it so we don't see this warning again + this.behaviorRegistry[filter].entities[entityType] = { + description: "Unregistered!", + pluginName: null, + }; + } const finalString = this.getBehaviorForEntity( entityType, entity, @@ -545,10 +586,14 @@ export class Behavior { [ source: string, callback: - | string + | GraphileBuild.BehaviorString + | GraphileBuild.BehaviorString[] | null | undefined - | ((behavior: string, ...args: TArgs) => string | string[]), + | (( + behavior: GraphileBuild.BehaviorString, + ...args: TArgs + ) => GraphileBuild.BehaviorString | GraphileBuild.BehaviorString[]), ] >, ...args: TArgs @@ -556,18 +601,24 @@ export class Behavior { let behaviorString: string = initialBehavior.behaviorString; const stack: Array = [...initialBehavior.stack]; - for (const [source, g] of callbacks) { + for (const [source, rawG] of callbacks) { const oldBehavior = behaviorString; - if (typeof g === "string") { - if (g === "") { - continue; - } else if (behaviorString === "") { - behaviorString = g; - } else { - behaviorString = g + " " + behaviorString; + const g = typeof rawG === "string" ? [rawG] : rawG; + if (Array.isArray(g)) { + for (const str of g) { + if (str === "") { + continue; + } else if (behaviorString === "") { + behaviorString = str; + } else { + behaviorString = str + " " + behaviorString; + } } } else if (typeof g === "function") { - const newBehavior = g(oldBehavior, ...args); + const newBehavior: string | string[] = g( + oldBehavior as GraphileBuild.BehaviorString, + ...args, + ); if (!newBehavior.includes(oldBehavior)) { throw new Error( `${source} callback must return a list that contains the current (passed in) behavior in addition to any other behaviors you wish to set.`, @@ -601,38 +652,18 @@ export class Behavior { entityType: keyof GraphileBuild.BehaviorEntities | null, source: string, behaviorString: string, - ): void /*asserts behaviorString is GraphileBuild.BehaviorString*/ { - const result = this.parseBehaviorString(behaviorString); - if (!entityType) { - return; - } - for (const { scope } of result) { - const behavior = scope.join(":") as keyof GraphileBuild.BehaviorStrings; - if ( - !Object.keys(this.behaviorRegistry).some((bhv) => - stringMatches(bhv, behavior), - ) - ) { - console.trace( - `Behavior '${behavior}' has not been registered! (Source: ${source})`, - ); - this.behaviorRegistry[behavior] = { - entities: {}, - }; - } - - if ( - !Object.entries(this.behaviorRegistry).some( - ([bhv /*, { entities } */]) => - /*entities[entityType] &&*/ stringMatches(bhv, behavior), - ) - ) { - console.trace( - `Behavior '${behavior}' is not registered for entity type '${entityType}'; it's only expected to be used with '${Object.keys( - this.behaviorRegistry[behavior].entities, - ).join("', '")}'. (Source: ${source})`, - ); + ): asserts behaviorString is GraphileBuild.BehaviorString { + try { + this.parseBehaviorString(behaviorString); + if (!entityType) { + return; } + } catch (e) { + throw new Error( + `Failed parsing behavior string ${JSON.stringify( + behaviorString, + )} from '${source}': ${e.message}`, + ); } } diff --git a/graphile-build/graphile-build/src/index.ts b/graphile-build/graphile-build/src/index.ts index afe307db24..d1a1367705 100644 --- a/graphile-build/graphile-build/src/index.ts +++ b/graphile-build/graphile-build/src/index.ts @@ -861,11 +861,12 @@ declare global { schema?: { globalBehavior?: - | string + | GraphileBuild.BehaviorString + | GraphileBuild.BehaviorString[] | (( - behavior: string, + behavior: GraphileBuild.BehaviorString, build: GraphileBuild.Build, - ) => string | string[]); + ) => GraphileBuild.BehaviorString | GraphileBuild.BehaviorString[]); behaviorRegistry?: { add?: Partial< diff --git a/postgraphile/postgraphile/src/presets/relay.ts b/postgraphile/postgraphile/src/presets/relay.ts index 77e92be5a4..ee09c03f05 100644 --- a/postgraphile/postgraphile/src/presets/relay.ts +++ b/postgraphile/postgraphile/src/presets/relay.ts @@ -45,17 +45,20 @@ export const PgRelayPlugin: GraphileConfig.Plugin = { }, schema: { - globalBehavior: `\ -+node \ -+connection -list \ --query:resource:single \ -+nodeId:filterBy \ -+nodeId:resource:update -constraint:resource:update \ -+nodeId:resource:delete -constraint:resource:delete \ -+nodeId:insert \ -+nodeId:update \ -+nodeId:base \ -`, + globalBehavior: [ + "node", + "connection", + "-list", + "-query:resource:single", + "nodeId:filterBy", + "nodeId:resource:update", + "constraint:resource:update", + "nodeId:resource:delete", + "constraint:resource:delete", + "nodeId:insert", + "nodeId:update", + "nodeId:base", + ], entityBehavior: { pgCodecAttribute: { inferred(behavior, [codec, attributeName], build) { diff --git a/postgraphile/postgraphile/src/presets/v4.ts b/postgraphile/postgraphile/src/presets/v4.ts index 1adae9b82b..ef68ecc878 100644 --- a/postgraphile/postgraphile/src/presets/v4.ts +++ b/postgraphile/postgraphile/src/presets/v4.ts @@ -108,19 +108,19 @@ const makeV4Plugin = (options: V4Options): GraphileConfig.Plugin => { `The 'defaultRole' V4 option is not currently supported in V5; please use the \`preset.grafast.context\` callback instead.`, ); } - const simpleCollectionsBehavior = (() => { + const simpleCollectionsBehavior = ((): GraphileBuild.BehaviorString[] => { switch (options.simpleCollections) { case "both": { - return "+connection +resource:connection +list +resource:list"; + return ["connection", "resource:connection", "list", "resource:list"]; } case "only": { - return "-connection -resource:connection +list +resource:list"; + return ["-connection", "-resource:connection", "list", "resource:list"]; } case "omit": { - return "+connection +resource:connection -list -resource:list"; + return ["connection", "resource:connection", "-list", "-resource:list"]; } default: { - return ""; + return []; } } })(); @@ -157,7 +157,15 @@ const makeV4Plugin = (options: V4Options): GraphileConfig.Plugin => { schema: { // We could base this on the legacy relations setting; but how to set deprecated? globalBehavior(behavior) { - return `${behavior} ${simpleCollectionsBehavior} -singularRelation:resource:connection -singularRelation:resource:list +condition:attribute:filterBy +attribute:orderBy +resource:connection:backwards`; + return [ + behavior, + ...simpleCollectionsBehavior, + "-singularRelation:resource:connection", + "-singularRelation:resource:list", + "condition:attribute:filterBy", + "attribute:orderBy", + "resource:connection:backwards", + ]; }, entityBehavior: { pgResource: "delete:resource:select", From b67e2220bf99b5d19f31a59fbd58bf35bc708a51 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Fri, 27 Sep 2024 11:04:41 +0100 Subject: [PATCH 45/50] Register yet more behaviors --- .../src/plugins/PgBasicsPlugin.ts | 13 +++++++- .../src/plugins/PgConditionArgumentPlugin.ts | 30 ++++++++++++++++--- .../src/plugins/PgCustomTypeFieldPlugin.ts | 8 +++++ .../src/plugins/PgPolymorphismPlugin.ts | 9 ++++++ graphile-build/graphile-build/src/index.ts | 2 +- 5 files changed, 56 insertions(+), 6 deletions(-) diff --git a/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts index 96b0d0095e..5c4ec4c4b4 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgBasicsPlugin.ts @@ -215,9 +215,20 @@ export const PgBasicsPlugin: GraphileConfig.Plugin = { }, // filter: { description: "can we filter these results?", entities: [] }, filterBy: { description: "can we filter by this thing?", entities: [] }, - order: { description: "can we order these results?", entities: [] }, + order: { + description: "can we order these results?", + entities: ["pgCodec", "pgResource"], + }, orderBy: { description: "can we order by this thing?", entities: [] }, + connection: { + description: "should we use a connection field for this?", + entities: ["pgCodec", "pgResource", "pgResourceUnique"], + }, + list: { + description: "should we use a list field for this?", + entities: ["pgCodec", "pgResource", "pgResourceUnique"], + }, "resource:connection": { description: "should we use a connection field for this?", entities: ["pgCodec", "pgResource", "pgResourceUnique"], diff --git a/graphile-build/graphile-build-pg/src/plugins/PgConditionArgumentPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgConditionArgumentPlugin.ts index 4572163d7c..db5ddb0166 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgConditionArgumentPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgConditionArgumentPlugin.ts @@ -22,6 +22,16 @@ declare global { namespace GraphileBuild { interface BehaviorStrings { filter: true; + "query:resource:list:filter": true; + "query:resource:connection:filter": true; + "manyRelation:resource:list:filter": true; + "manyRelation:resource:connection:filter": true; + "singularRelation:resource:list:filter": true; + "singularRelation:resource:connection:filter": true; + "typeField:resource:list:filter": true; + "typeField:resource:connection:filter": true; + "queryField:resource:list:filter": true; + "queryField:resource:connection:filter": true; } interface Inflection { conditionType(this: Inflection, typeName: string): string; @@ -35,6 +45,11 @@ declare global { } } +const FILTER_DEF = { + description: "can we filter this resource/codec", + entities: ["pgCodec", "pgResource"], +} as const; + export const PgConditionArgumentPlugin: GraphileConfig.Plugin = { name: "PgConditionArgumentPlugin", description: "Adds the 'condition' argument to connections and lists", @@ -51,10 +66,17 @@ export const PgConditionArgumentPlugin: GraphileConfig.Plugin = { schema: { behaviorRegistry: { add: { - filter: { - description: "can we filter this resource/codec", - entities: ["pgCodec", "pgResource"], - }, + filter: FILTER_DEF, + "query:resource:list:filter": FILTER_DEF, + "query:resource:connection:filter": FILTER_DEF, + "manyRelation:resource:list:filter": FILTER_DEF, + "manyRelation:resource:connection:filter": FILTER_DEF, + "singularRelation:resource:list:filter": FILTER_DEF, + "singularRelation:resource:connection:filter": FILTER_DEF, + "typeField:resource:list:filter": FILTER_DEF, + "typeField:resource:connection:filter": FILTER_DEF, + "queryField:resource:list:filter": FILTER_DEF, + "queryField:resource:connection:filter": FILTER_DEF, }, }, diff --git a/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts index 7343504ce6..ae4dc82a51 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgCustomTypeFieldPlugin.ts @@ -374,6 +374,10 @@ export const PgCustomTypeFieldPlugin: GraphileConfig.Plugin = { description: "", entities: ["pgResource"], }, + "typeField:resource:array": { + description: "", + entities: ["pgResource"], + }, "queryField:resource:connection": { description: "", entities: ["pgResource"], @@ -382,6 +386,10 @@ export const PgCustomTypeFieldPlugin: GraphileConfig.Plugin = { description: "", entities: ["pgResource"], }, + "queryField:resource:array": { + description: "", + entities: ["pgResource"], + }, "typeField:single": { description: "", entities: ["pgResource"], diff --git a/graphile-build/graphile-build-pg/src/plugins/PgPolymorphismPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgPolymorphismPlugin.ts index 1b19d7277b..894f5145b7 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgPolymorphismPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgPolymorphismPlugin.ts @@ -655,6 +655,15 @@ export const PgPolymorphismPlugin: GraphileConfig.Plugin = { }, }), schema: { + behaviorRegistry: { + add: { + "interface:node": { + description: + "should this codec representing a polymorphic interface implement the Node interface?", + entities: ["pgCodec"], + }, + }, + }, entityBehavior: { pgCodec: { inferred: { diff --git a/graphile-build/graphile-build/src/index.ts b/graphile-build/graphile-build/src/index.ts index d1a1367705..2d00025212 100644 --- a/graphile-build/graphile-build/src/index.ts +++ b/graphile-build/graphile-build/src/index.ts @@ -874,7 +874,7 @@ declare global { keyof GraphileBuild.BehaviorStrings, { description: string; - entities: (keyof GraphileBuild.BehaviorEntities)[]; + entities: ReadonlyArray; } > >; From a47794a6a1eda8c861b71c9d36924e9f9a9dfd2c Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Fri, 27 Sep 2024 11:15:07 +0100 Subject: [PATCH 46/50] Fix bug --- graphile-build/graphile-build/src/behavior.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/graphile-build/graphile-build/src/behavior.ts b/graphile-build/graphile-build/src/behavior.ts index 556e29286e..2df5cf6678 100644 --- a/graphile-build/graphile-build/src/behavior.ts +++ b/graphile-build/graphile-build/src/behavior.ts @@ -605,14 +605,11 @@ export class Behavior { const oldBehavior = behaviorString; const g = typeof rawG === "string" ? [rawG] : rawG; if (Array.isArray(g)) { - for (const str of g) { - if (str === "") { - continue; - } else if (behaviorString === "") { - behaviorString = str; - } else { - behaviorString = str + " " + behaviorString; - } + if (g.length === 0) continue; + if (behaviorString === "") { + behaviorString = g.join(" "); + } else { + behaviorString = g.join(" ") + " " + behaviorString; } } else if (typeof g === "function") { const newBehavior: string | string[] = g( From 68dc392766c511199ea0a5011258c4b189b099c0 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Fri, 27 Sep 2024 11:17:21 +0100 Subject: [PATCH 47/50] Fix accidental loss of '-' --- postgraphile/postgraphile/src/presets/relay.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/postgraphile/postgraphile/src/presets/relay.ts b/postgraphile/postgraphile/src/presets/relay.ts index ee09c03f05..038e19bdd7 100644 --- a/postgraphile/postgraphile/src/presets/relay.ts +++ b/postgraphile/postgraphile/src/presets/relay.ts @@ -47,14 +47,20 @@ export const PgRelayPlugin: GraphileConfig.Plugin = { schema: { globalBehavior: [ "node", + "connection", "-list", + "-query:resource:single", + "nodeId:filterBy", + "nodeId:resource:update", - "constraint:resource:update", + "-constraint:resource:update", + "nodeId:resource:delete", - "constraint:resource:delete", + "-constraint:resource:delete", + "nodeId:insert", "nodeId:update", "nodeId:base", From 21f89887ea1efb356530431eb3d0699345190ec1 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Fri, 27 Sep 2024 11:23:11 +0100 Subject: [PATCH 48/50] Note about stricter typings --- .changeset/modern-bananas-drop.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.changeset/modern-bananas-drop.md b/.changeset/modern-bananas-drop.md index 64f75a6aea..8981c1aad8 100644 --- a/.changeset/modern-bananas-drop.md +++ b/.changeset/modern-bananas-drop.md @@ -12,7 +12,7 @@ removing many hacks and workarounds, and ultimately meaning that `plugin.schema.entityBehaviors` to indicate behaviors as shown in this PR - do not mod the tags directly unless they're explicitly meant to be overrides. -Technically this is a breaking change (besides the removal of the +Technically this is a significant breaking change (besides the removal of the `addBehaviorToTags()` helper) because the order in which behaviors are applied has changed, and so a different behavior might ultimately "win". This shows up in places where there is ambiguity, for example if you add `@filterable` to a @@ -26,3 +26,9 @@ on. Be sure to print your schema before and after this update and look for changes; if there are changes then you likely need to fix the relevant behaviors/smart tags. (Hopefully there's no changes for you!) + +You'll also need to change any places where you're specifying behaviors that +will be type checked; you can either cast your existing strings e.g. +`defaultBehavior: "+connection -list" as GraphileBuild.BehaviorString`, or +preferably you can specify your behaviors as an array, which should give you +auto-complete on each entry; e.g. `defaultBehavior: ["connection", "-list"]`. From 979ab9976e36b50d18567c020c86c86be2098207 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Fri, 27 Sep 2024 11:43:04 +0100 Subject: [PATCH 49/50] Fix types --- utils/graphile/src/commands/behavior/debug/main.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/utils/graphile/src/commands/behavior/debug/main.ts b/utils/graphile/src/commands/behavior/debug/main.ts index 04daf71d3c..de120eb57b 100644 --- a/utils/graphile/src/commands/behavior/debug/main.ts +++ b/utils/graphile/src/commands/behavior/debug/main.ts @@ -103,7 +103,10 @@ ${chalk.whiteBright.underline(entry.source)}: } const matchText = filterString - ? build.behavior.stringMatches(finalString, filterString) + ? build.behavior.stringMatches( + finalString, + filterString as keyof GraphileBuild.BehaviorStrings, + ) ? chalk.whiteBright.bold(`Positive match`) : chalk.red.bold(`Negative match`) : null; @@ -155,7 +158,10 @@ function debugAndSimplify( const isOverridden = hasExisting(spec.scope); const isMatch = filterString - ? build.behavior.stringMatches(spec.scope.join(":"), filterString) + ? build.behavior.stringMatches( + spec.scope.join(":"), + filterString as keyof GraphileBuild.BehaviorStrings, + ) : false; const highlightedScopeStringBase = ( From 2dfc10fb6be16f7a9e902f7e0a360cbeab5b55db Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Fri, 27 Sep 2024 11:45:19 +0100 Subject: [PATCH 50/50] docs(changeset): Fix interactions with behavior system, including fixing debugging behaviors when naming conflicts occur in the schema. --- .changeset/serious-cheetahs-dream.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/serious-cheetahs-dream.md diff --git a/.changeset/serious-cheetahs-dream.md b/.changeset/serious-cheetahs-dream.md new file mode 100644 index 0000000000..072eb61c42 --- /dev/null +++ b/.changeset/serious-cheetahs-dream.md @@ -0,0 +1,6 @@ +--- +"graphile": patch +--- + +Fix interactions with behavior system, including fixing debugging behaviors when +naming conflicts occur in the schema.