crystal
crystal copied to clipboard
Cannot select a 'via' attribute from PgUpdateSingleStep
Summary
We've just introduced some complex RLS permissions to part of our API. The policies seem to work correctly, and data is returned correctly, but this error is also thrown. This happens after updating a table row using the generated update mutation.
{
error: Error: Cannot select a 'via' attribute from PgUpdateSingleStep
at PgUpdateSingleStep.get (/node_modules/.pnpm/@[email protected]_@[email protected][email protected]_graphile-_20a976b458ca0b8d27e387178a47f6f2/node_modules/@dataplan/pg/dist/steps/pgUpdateSingle.js:105:19)
at /node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_453e922d01adb72b827830983c00968b/node_modules/graphile-build-pg/dist/plugins/PgAttributesPlugin.js:52:36
at /node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/grafast/dist/engine/OperationPlan.js:1125:235
at withFieldArgsForArguments (/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/grafast/dist/operationPlan-input.js:399:20)
at withGlobalLayerPlan (/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/grafast/dist/engine/lib/withGlobalLayerPlan.js:12:25)
at OperationPlan.planField (/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/grafast/dist/engine/OperationPlan.js:1125:73)
at OperationPlan.processGroupedFieldSet (/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/grafast/dist/engine/OperationPlan.js:721:48)
at OperationPlan.planSelectionSet (/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/grafast/dist/engine/OperationPlan.js:817:14)
at OperationPlan.planIntoOutputPlan (/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/grafast/dist/engine/OperationPlan.js:950:22)
at OperationPlan.processGroupedFieldSet (/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/grafast/dist/engine/OperationPlan.js:763:26),
extensions: undefined
}
The table being updated is referenced in a polymorphic table, but the update mutation and the queried result is not using the polymorphic table, it's quering the "child" table directly.