feat: consolidate graphile-misc-plugins into graphile-settings and add @requiredInput plugin#842
Merged
pyramation merged 2 commits intomainfrom Mar 17, 2026
Conversation
…@RequiredInput plugin - Move all plugin source files from graphile-misc-plugins/src/ to graphile-settings/src/plugins/ - Move all tests from graphile-misc-plugins/__tests__/ to graphile-settings/__tests__/ - Update all imports to use local paths instead of graphile-misc-plugins package - Update graphile-settings package.json with dependencies from graphile-misc-plugins - Remove graphile-misc-plugins package from workspace - Implement RequiredInputPlugin: reads @RequiredInput smart tag and makes mutation input fields non-nullable - Add RequiredInputPreset to ConstructivePreset - Add comprehensive tests for RequiredInputPlugin (14 test cases)
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
Two changes in one PR:
1. Package consolidation: Moves all source files, tests, and dependencies from
graphile-misc-pluginsintographile-settings/src/plugins/. Thegraphile-misc-pluginspackage is deleted entirely.graphile-settingswas the only internal consumer — it previously re-exported everything fromgraphile-misc-pluginsviaworkspace:^. All imports inconstructive-preset.tsand test files are updated to use local paths.2. New
RequiredInputPlugin: Implements the missing Graphile plugin that reads the@requiredInputsmart tag (injected byconstructive-db'sapi_requiredcolumn) and wraps the corresponding GraphQL input field type withNonNull. This makes mutation inputs (create/patch/base) require the field, while keeping output types nullable. This is the application-side counterpart to the database-side plumbing inconstructive-db(seetg_sync_api_required_smart_tagtrigger).Updates since initial revision
import('../src/PublicKeySignature')path inPublicKeySignature.test.tsline 44 (static imports were updated but this dynamic import was not, causing CI failure).Review & Testing Checklist for Human
graphile-misc-plugins— the package was published to npm with"access": "public". If anything outside this monorepo imports it, this is a breaking change. Check npm dependents.build.inflection.attribute()is the correct PostGraphile v5 inflection for mapping DB attribute names → GraphQL field names inrequired-input-plugin.ts:71-74. The plugin was only tested with mocks, not a real PostGraphile build object. If this inflection is wrong, the plugin silently skips fields (fail-open) rather than crashing — safe, but incorrect.isPgPatch || isPgBaseInput || isMutationInput. Confirm these cover all mutation input type scopes in PostGraphile v5 and that no output/filter types are accidentally affected.@requiredInputsmart tags (e.g.,grantor_idon memberships) and verify the GraphQL schema shows the field as non-nullable in mutation inputs but nullable in query output types.graphile-misc-pluginspackage doesn't need cleanup inpnpm-workspace.yamlor Lerna configuration.Notes
RequiredInputPlugintests (14 cases) use mockedbuild/contextobjects, not a real PostGraphile schema. They verify the hook logic in isolation but cannot catch issues with real inflection or scope naming.graphile-misc-pluginsworkspace package, causing deduplication of transitive resolution entries.Link to Devin session: https://app.devin.ai/sessions/7b2047110b374fc884c1ea081c201ce1
Requested by: @pyramation