fix(node-type-registry): BlueprintField uses is_required, not is_not_null#910
Conversation
…null The SQL function construct_blueprint() and metaschema_public.field table both use is_required for the NOT NULL constraint flag. is_not_null only exists in the low-level PostgreSQL AST package (ColumnDef parse nodes).
🤖 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:
|
| ), | ||
| addJSDoc( | ||
| optionalProp('is_not_null', t.tsBooleanKeyword()), | ||
| optionalProp('is_required', t.tsBooleanKeyword()), |
There was a problem hiding this comment.
🟡 README example uses stale is_not_null property after rename to is_required
The PR renames BlueprintField.is_not_null to is_required in generate-types.ts:209 and the generated output, but the README.md example at graphile/node-type-registry/README.md:42 still uses { name: 'title', type: 'text', is_not_null: true }. Users copying the README example will silently get no NOT NULL constraint on the column, since is_not_null is now an unrecognized property that TypeScript will flag (or silently ignore in plain JSONB usage).
Prompt for agents
Update graphile/node-type-registry/README.md line 42 to use the new property name: change `{ name: 'title', type: 'text', is_not_null: true }` to `{ name: 'title', type: 'text', is_required: true }` to match the renamed BlueprintField property in generate-types.ts:209.
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Fixes the
BlueprintFieldgenerated type to useis_requiredinstead ofis_not_nullfor the NOT NULL constraint flag.The
construct_blueprint()SQL function passes field JSONB objects directly intosecure_table_provision, which reads the"is_required"key (per its column comment). Themetaschema_public.fieldtable also usesis_required. Theis_not_nullname only exists in the low-level PostgreSQL AST package (ColumnDefparse tree nodes) — a completely different layer.Changes:
generate-types.ts:optionalProp('is_not_null', ...)→optionalProp('is_required', ...)blueprint-types.generated.ts: regenerated (single field rename)Review & Testing Checklist for Human
construct_blueprint()andsecure_table_provisionreadis_required(notis_not_null) from field JSONB — check the column comment onsecure_table_provision.fieldsand themetaschema.create_field()functionis_not_nullfrom the previous publish, those will need updating tooNotes
is_required→is_not_nullbased on the incorrect generated typeLink to Devin session: https://app.devin.ai/sessions/ce1b2dafd42341bea5d7793b0c05ba6c
Requested by: @pyramation