Skip to content

Add models_only option to skip client code generation#419

Open
magicmark wants to merge 1 commit intomirumee:mainfrom
magicmark:models-only-option
Open

Add models_only option to skip client code generation#419
magicmark wants to merge 1 commit intomirumee:mainfrom
magicmark:models-only-option

Conversation

@magicmark
Copy link
Copy Markdown

Summary

  • Adds a models_only configuration option (models_only = true in TOML) that generates only Pydantic models (input types, enums, result types, fragments, base model) without the runtime client code (client class, base client, exceptions)
  • Makes queries_path and base client configuration optional when models_only is enabled
  • Removes the httpx dependency for type-only use cases

Closes #418

Test plan

  • All existing tests pass (645 passed, 0 failures)
  • New tests verify models_only skips client/exceptions files
  • New tests verify __init__.py has no client imports in models_only mode
  • New tests verify result types are still generated from operations
  • New settings tests verify models_only works without queries_path and skips base client validation

🤖 Generated with Claude Code

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 12, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 52738f2e-6a6a-4210-b8f9-691d2d07e746

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@magicmark magicmark force-pushed the models-only-option branch 5 times, most recently from 4538133 to 0dcf601 Compare March 12, 2026 04:40
@magicmark magicmark marked this pull request as ready for review March 12, 2026 04:43
…ent code

When `models_only = true`, ariadne-codegen generates only input types, enums,
result types, fragments, and the base model — skipping the client class, base
client, and exceptions module. This removes the httpx dependency for type-only
use cases. The `queries_path` and base client configuration become optional in
this mode.

Closes mirumee#418

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@magicmark magicmark force-pushed the models-only-option branch from 0dcf601 to 7cc2114 Compare March 12, 2026 05:07
@DamianCzajkowski
Copy link
Copy Markdown
Collaborator

I’m on board with the goal here, and the use case makes sense.
I’m not sold on adding models_only as a boolean in settings, though.

This feels more like a generation mode than a config toggle. I’d rather model it like existing strategies (client, graphqlschema) and add models_only at the entrypoint/strategy level, then keep settings focused on strategy-specific params.

So +1 on the feature itself. I’d just prefer shipping it as a strategy/mode instead of models_only = true in settings.

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.

Option to disable runtime codegen; pydantic models only

2 participants