Skip to content

Add introspection parameters to available settings.#413

Merged
DamianCzajkowski merged 3 commits intomirumee:mainfrom
davner:feat/include-introspection-parameters
Mar 12, 2026
Merged

Add introspection parameters to available settings.#413
DamianCzajkowski merged 3 commits intomirumee:mainfrom
davner:feat/include-introspection-parameters

Conversation

@davner
Copy link
Copy Markdown
Contributor

@davner davner commented Feb 7, 2026

Hi all,

This PR exposes all available graphql.get_introspection_query options as configurable settings in the TOML configuration.

While implementing this, I identified a small bug in schema.introspect_remote_schema:

GraphQL errors were not being surfaced if the response did not include a data key. This became apparent when testing introspection against our GraphQL endpoint, which does not support schema_description. The server returned errors, but they were silently ignored.

Summary by CodeRabbit

  • New Features

    • Added introspection configuration options for remote GraphQL schemas, enabling control over query aspects like descriptions, deprecation information, specified_by_url, schema descriptions, directive repeatability, and input object one_of handling.
  • Documentation

    • Updated README with details on introspection query options and available configuration flags.
  • Tests

    • Added comprehensive test coverage for introspection settings handling and configuration behavior.

- Refactor logic unpacking response from endpoint to access errors.
- Add tests for settings and schema to cover new parameters.
- Update README to include new parameters.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 7, 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: bcbd4d55-d5e7-4907-ab24-ce1a54d3d850

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
📝 Walkthrough

Walkthrough

This pull request introduces a new introspection settings system for GraphQL remote schema fetching. It adds configuration options to customize introspection query behavior, propagates these settings through the codebase from main entry points to schema fetching logic, and includes comprehensive tests and documentation.

Changes

Cohort / File(s) Summary
Documentation
README.md
Adds new section documenting GraphQL introspection query options, detailing six introspection configuration flags and their defaults when using remote_schema_url.
Configuration & Settings
ariadne_codegen/settings.py
Introduces IntrospectionSettings dataclass with six boolean fields, extends BaseSettings with matching configuration fields, and adds properties for remote schema detection and introspection settings message formatting.
Core Schema Logic
ariadne_codegen/schema.py, ariadne_codegen/main.py
Adds introspection_settings parameter to get_graphql_schema_from_url() and introspect_remote_schema() functions, enabling dynamic introspection query construction from settings. Propagates settings from main entry points through to remote schema fetching.
Tests
tests/test_schema.py, tests/test_settings.py
Expands test coverage with 11+ new tests validating introspection settings propagation, remote schema detection, used settings message generation, and error handling across various configuration scenarios.

Sequence Diagram(s)

sequenceDiagram
    participant Config as Settings
    participant Main as main.py
    participant SchemaUtil as schema.py
    participant Introspect as Introspection Query
    participant Remote as Remote Schema

    Config->>Config: Parse introspection_<br/>settings (6 flags)
    Config->>Main: Provide IntrospectionSettings
    Main->>SchemaUtil: Call get_graphql_schema_<br/>from_url with settings
    SchemaUtil->>SchemaUtil: Create IntrospectionSettings<br/>(from param or default)
    SchemaUtil->>Introspect: introspect_remote_schema<br/>with settings
    Introspect->>Introspect: Build query from<br/>asdict(settings)
    Introspect->>Remote: POST introspection query<br/>with custom options
    Remote-->>Introspect: JSON introspection result
    Introspect-->>SchemaUtil: Parsed schema
    SchemaUtil-->>Main: GraphQLSchema
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Six little flags hop into view,
Settings dance through code so new,
From main to schema, queries take flight,
Introspection whispers feel so right,
Tests confirm what settings bring—
Customizable schemas—what a thing! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding introspection parameters as configurable settings, which is the primary objective across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan for PR comments
  • Generate coding plan

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.

@davner
Copy link
Copy Markdown
Contributor Author

davner commented Mar 5, 2026

@DamianCzajkowski how do you feel about this PR? Would love to get this merged so I can abandon using a different dependency to download our schema. Thanks!

@DamianCzajkowski DamianCzajkowski merged commit aa3b82d into mirumee:main Mar 12, 2026
6 checks passed
@davner davner deleted the feat/include-introspection-parameters branch March 12, 2026 14:48
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.

2 participants