Skip to content

Conversation

@patrick91
Copy link
Member

@patrick91 patrick91 commented Oct 30, 2025

I wanted to make it backwards compatibile, but not fully sure it is worth it, since the user changes should be pretty small

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 30, 2025

Reviewer's Guide

Transition schema configuration to a dictionary-based API by introducing a TypedDict, deprecating the StrawberryConfig class, adding normalization logic, refactoring internal accesses, and updating documentation.

File-Level Changes

Change Details Files
Introduce TypedDict-based config and deprecate class-based StrawberryConfig
  • Added StrawberryConfig TypedDict with optional fields
  • Renamed dataclass to _StrawberryConfigClass and emit deprecation warning
  • Implemented _complete_config to normalize, default, and validate configs
  • Updated all to export TypedDict and normalization function
strawberry/schema/config.py
Normalize and apply defaults in Schema constructor
  • Changed Schema.init to accept dict or deprecated class instance
  • Replaced instantiation of config dataclass with call to _complete_config
  • Updated imports to reference _complete_config and _StrawberryConfigClass
strawberry/schema/schema.py
Migrate internal config access to dictionary lookups
  • Replaced attribute-style config.field with config["field"] lookups
  • Updated name_converter, default_resolver, relay options, and directive naming in converters and printers
  • Adjusted HTTP batching and locate_definition to use dict-based config
strawberry/schema/schema_converter.py
strawberry/printer/printer.py
strawberry/federation/schema.py
strawberry/http/base.py
strawberry/relay/utils.py
strawberry/schema/base.py
strawberry/utils/locate_definition.py
Update documentation to reflect dict-based config and add breaking change entry
  • Rewrote examples in various docs to use dict syntax
  • Added breaking-changes/0.285.0.md with deprecation and migration instructions
  • Updated breaking-changes.md to include new version
docs/types/schema-configurations.md
docs/guides/query-batching.md
docs/types/defer-and-stream.md
docs/breaking-changes.md
docs/breaking-changes/0.285.0.md

Possibly linked issues

  • #issue: The PR changes StrawberryConfig to a TypedDict and deprecates the class, as suggested by the issue.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@botberry
Copy link
Member

botberry commented Oct 30, 2025

Apollo Federation Subgraph Compatibility Results

Federation 1 Support Federation 2 Support
_service🟢
@key (single)🟢
@key (multi)🟢
@key (composite)🟢
repeatable @key🟢
@requires🟢
@provides🟢
federated tracing🔲
@link🟢
@shareable🟢
@tag🟢
@override🟢
@inaccessible🟢
@composeDirective🟢
@interfaceObject🟢

Learn more:

@patrick91 patrick91 force-pushed the feature/strawberry-config-dict branch from 035c8a9 to 3823b9c Compare October 30, 2025 14:34
@codecov
Copy link

codecov bot commented Oct 30, 2025

Codecov Report

❌ Patch coverage is 77.11864% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.29%. Comparing base (846b3c4) to head (aba9676).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4039      +/-   ##
==========================================
- Coverage   94.39%   94.29%   -0.10%     
==========================================
  Files         534      535       +1     
  Lines       34834    34878      +44     
  Branches     1831     1839       +8     
==========================================
+ Hits        32881    32889       +8     
- Misses       1657     1691      +34     
- Partials      296      298       +2     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@patrick91 patrick91 force-pushed the feature/strawberry-config-dict branch 2 times, most recently from f22d944 to a0a908b Compare October 30, 2025 14:49
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 30, 2025

CodSpeed Performance Report

Merging #4039 will not alter performance

Comparing feature/strawberry-config-dict (aba9676) with main (846b3c4)

Summary

✅ 28 untouched

@patrick91 patrick91 force-pushed the feature/strawberry-config-dict branch from a0a908b to aba9676 Compare October 30, 2025 15:31
@patrick91 patrick91 changed the title Add support for dictionary config and deprecate StrawberryConfig class Change StrawberryConfig to be a dictionary instead of a class Oct 30, 2025
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.

3 participants