Add support for PostgreSQL procedures (CALL-based mutations) - #2
Closed
dargmuesli wants to merge 4 commits into
Closed
Add support for PostgreSQL procedures (CALL-based mutations)#2dargmuesli wants to merge 4 commits into
dargmuesli wants to merge 4 commits into
Conversation
dargmuesli
force-pushed
the
feat/pg-procedures
branch
from
August 5, 2026 02:15
e45fd84 to
cea2e98
Compare
Owner
Author
|
Superseded by graphile#3124, opened against upstream instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for PostgreSQL
PROCEDUREs (introduced in PG11), resolving graphile#1309. Previously a procedure either didn't appear in the schema or got built into a GraphQL field that crashed at query time, since Postgres procedures can only be invoked withcall proc(...), never embedded in aselectlike a function.@dataplan/pg: newPgCallStep/pgCall()step that builds and executes acallstatement directly, including the positional-argument handling procedures require (every parameter, including OUT-only ones, needs a value) and raw-text decoding for the output columns (which can't be wrapped in::textcasts the way a select list can).graphile-build-pg:PgProceduresPlugindetectsprokind = 'p'and builds a CALL-backed resource; procedures are always mutation fields, since they can never appear in a query, computed column, or connection.PgCustomTypeFieldPlugin'sclientMutationIdwiring is extended to recognizePgCallStepresults alongsidePgSelectStepones.proceduresschema (PG11+) covering no-output, single-output, multiple-output, andINOUTprocedures, plus a mutation test exercising each includingclientMutationId.procedures.mdnow documents the feature and its limitations instead of saying it's unsupported.Known limitation: a single-output procedure's result is a nested object (
{ result { doubled } }) rather than flattened to a bare scalar the way single-output functions are, since Postgres reportsrecordas a procedure's return type even with just one OUT parameter.