fix(presigned-url): return PgSelectSingleStep from mutation entry points#1072
Merged
pyramation merged 1 commit intomainfrom May 8, 2026
Merged
fix(presigned-url): return PgSelectSingleStep from mutation entry points#1072pyramation merged 1 commit intomainfrom
pyramation merged 1 commit intomainfrom
Conversation
The mutation entry points were returning a generic Grafast object() step, which PostGraphile v5 rejects because sub-fields (requestUploadUrl, etc.) expect a PgSelectSingleStep to resolve column values via $parent.get(). Replace the manual lambda + object() approach with resource.find(spec).single() which returns a proper PgSelectSingleStep.
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
The per-bucket mutation entry points added in #1071 returned a generic Grafast
object()step, which PostGraphile v5 rejects at runtime because sub-fields likerequestUploadUrlcall$parent.get('column_name')— a method only available onPgSelectSingleStep(and similar Pg step types).Before: The plan function manually fetched bucket config via
lambda+withPgClient, then wrapped individual columns inaccess()calls and returnedobject(columnEntries). This produced anObjectStepthat PostGraphile couldn't use for sub-field resolution.After: The plan function looks up the
PgResourcefor the bucket codec at schema build time, then callsbucketResource.find(spec).single()in the plan. This returns a properPgSelectSingleStep, which PostGraphile can use to resolve sub-fields via.get().Review & Testing Checklist for Human
pgSettingsviawithPgClient. Verify thatresource.find()goes through PostGraphile's normal auth pipeline (selectAuth) so that RLS policies are respected on the bucket lookup.!r.isUnique && !r.isVirtual && !r.parametersis intended to find the primary table resource for each codec. Confirm this won't accidentally match a view or function resource if one exists for a bucket codec.minio-multi-scope.integration.test.tsinconstructive-db(PR #1054). After publishing, run those integration tests to confirm the fullmutation { appBucket(key: "public") { requestUploadUrl(...) { ... } } }flow works.Notes
capturedCodecvariable was removed since it's no longer needed (the resource lookup replaces the manual column iteration).owner_idin the find spec using the SQL column name, while the GraphQL arg isownerId— this is correct sinceresource.find()expects codec attribute names.Link to Devin session: https://app.devin.ai/sessions/7903d2a3e7a34c6daa605e12d6b80d9e
Requested by: @pyramation