Skip to content

refactor: migrate schema output config from flat props to nested schema object#848

Merged
pyramation merged 1 commit intomainfrom
devin/1773817039-schema-config-refactor
Mar 18, 2026
Merged

refactor: migrate schema output config from flat props to nested schema object#848
pyramation merged 1 commit intomainfrom
devin/1773817039-schema-config-refactor

Conversation

@pyramation
Copy link
Contributor

Summary

Replaces the flat schemaOnly / schemaOnlyOutput / schemaOnlyFilename properties with a nested schema: { enabled, output, filename } object, aligning schema export configuration with the existing nested-object paradigm used by tables, queries, codegen, docs, etc.

Config change:

// Before
{ schemaOnly: true, schemaOnlyOutput: './schemas', schemaOnlyFilename: 'public.graphql' }

// After
{ schema: { enabled: true, output: './schemas', filename: 'public.graphql' } }

CLI change: --schema-only--schema-enabled, plus new --schema-output and --schema-filename flags.

Files changed across graphql/codegen (types, generate, CLI handler/index, tests) and packages/cli (codegen command, display, README, AGENTS.md).

Review & Testing Checklist for Human

  • Behavioral change in generate.ts: The old schemaOnly triggered an early return regardless of other generators being enabled. The new code gates schema export on schemaEnabled && !runReactQuery && !runOrm && !runCli — meaning if a user sets schema: { enabled: true } alongside orm: true, the schema export is silently skipped. Verify this is the desired behavior vs. also exporting SDL when generators run.
  • Breaking change with no deprecation: Old schemaOnly/schemaOnlyOutput/schemaOnlyFilename properties are fully removed. Any existing configs or programmatic callers using these will silently stop exporting schemas (no error thrown). Consider whether a runtime warning or migration period is needed.
  • CLI breaking change: --schema-only no longer works. Verify no CI scripts, Makefiles, or downstream tooling depend on the old flag name.
  • Multi-target filename default: In generateMulti, the fallback filename changed from always being ${name}.graphql to schema?.filename ?? ${name}.graphql. Confirm user-provided filename correctly overrides the per-target default.

Notes

  • CHANGELOG.md entries referencing --schema-only were intentionally left untouched (historical records).
  • This is a breaking change to both the programmatic API and CLI interface.
  • Companion PRs for constructive-skills, constructive-private-skills, and constructive-db are planned to update docs/skills referencing the old syntax.

Link to Devin session: https://app.devin.ai/sessions/a0ac766d75d340d490fd265bfafaac83
Requested by: @pyramation

…ma object

Replaces schemaOnly/schemaOnlyOutput/schemaOnlyFilename with:
  schema: { enabled?: boolean, output?: string, filename?: string }

This aligns schema export config with the existing nested object paradigm
used by tables, queries, mutations, codegen, hooks, docs, etc.

CLI flags updated: --schema-enabled, --schema-output, --schema-filename
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@pyramation pyramation merged commit 746e95a into main Mar 18, 2026
44 checks passed
@pyramation pyramation deleted the devin/1773817039-schema-config-refactor branch March 18, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant